/* --- Grundfarben und Variablen --- */
:root {
    --background: #f4f7fa;
    --foreground: #222;
    --accent: #0078d7;
    --sidebar-bg: #fff;
    --sidebar-border: #e3e6ec;
    --header-bg: #fff;
    --shadow: 0 2px 8px #0001;
}

[data-theme="dark"] {
    --background: #181c22;
    --foreground: #f4f7fa;
    --accent: #00b4ff;
    --sidebar-bg: #1e1e2f;
    --sidebar-border: #2c2c3c;
    --header-bg: #23263a;
    --shadow: 0 2px 8px #0005;
}

/* --- Layout --- */
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app-container {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    width: 240px;
    padding: 32px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: var(--shadow);
}

.sidebar h2 {
    font-size: 1.3em;
    margin-bottom: 2em;
    color: var(--accent);
    letter-spacing: 1px;
    text-align: center;
}

.sidebar nav {
    flex: 1 1 auto;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.08em;
    margin: 18px 0;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
    background: var(--accent);
    color: #fff;
}
.sidebar nav a.active { background: #eaf4ff; color: #1971c2; }

.sidebar-section {
    margin: 18px 0 6px 0;
    font-weight: bold;
    color: var(--accent, #0078d7);
    letter-spacing: 0.5px;
}

.sidebar nav .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.header {
    padding: 0 32px;
    background: var(--header-bg);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 64px;
    border-bottom: 1px solid var(--sidebar-border);
    position: relative;
    box-shadow: var(--shadow);
}

#mainHeader {
    flex: 1 1 auto;
    font-size: 1.5em;
    color: var(--accent);
    margin: 0;
    display: none;
}

.theme-btn {
    background: var(--sidebar-bg);
    border: none;
    border-radius: 50%;
    padding: 10px 14px;
    font-size: 1.3em;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px #0002;
    margin-left: 16px;
}
.theme-btn:hover {
    background: var(--accent);
    color: #fff;
}
.theme-dropdown {
    display: none;
    position: absolute;
    right: 32px;
    top: 64px;
    background: var(--sidebar-bg);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 4px 16px #0002;
    z-index: 100;
}
.theme-dropdown button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 12px 24px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: 1em;
    transition: background 0.2s;
}
.theme-dropdown button:hover {
    background: var(--accent);
    color: #fff;
}

.content {
    flex: 1 1 auto;
    padding: 32px 40px;
    background: var(--bg);
    min-height: 0;
    overflow-y: auto;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.5s; }

/* Steam-Konten Box */
.steam-account-box {
    background: linear-gradient(135deg, var(--sidebar-bg) 80%, #eaf4ff 100%);
    border: 1.5px solid var(--accent);
    border-radius: 14px;
    padding: 22px 28px 18px 28px;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px #0002;
    animation: fadeInUp 0.5s;
    position: relative;
    transition: box-shadow 0.2s, border 0.2s;
}
.steam-account-box:hover {
    box-shadow: 0 8px 32px #0003;
    border-color: #339af0;
}
.steam-account-box strong {
    color: var(--accent);
    font-size: 1.15em;
    letter-spacing: 0.5px;
}
.steam-account-box button {
    background: #f8d7da;
    color: #c0392b;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25em;
    position: absolute;
    top: 18px;
    right: 18px;
    box-shadow: 0 2px 8px #0001;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.steam-account-box button:hover {
    background: #fa5252;
    color: #fff;
    box-shadow: 0 4px 16px #fa525299;
}
.steam-account-box .steam-info {
    margin-top: 14px;
    font-size: 1em;
    color: #2c3e50;
    background: #f1f8ff;
    border-left: 4px solid var(--accent);
    padding: 10px 16px;
    border-radius: 7px;
    font-style: italic;
    word-break: break-word;
    animation: fadeIn 0.7s;
    box-shadow: 0 1px 4px #0001;
}

.dashboard-stats {
    display: flex;
    gap: 32px;
    margin: 32px 0 0 0;
    flex-wrap: wrap;
}
.stat-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 14px;
    box-shadow: 0 2px 8px #0001;
    padding: 24px 32px;
    min-width: 180px;
    text-align: center;
    animation: fadeInUp 0.6s;
}
.stat-title {
    font-size: 1.1em;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 2.1em;
    font-weight: 700;
    color: var(--text);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes popIn {
    0%   { transform: scale(0.7); opacity: 0; }
    80%  { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px);}
    to   { opacity: 1; transform: translateY(0);}
}

/* --- Willkommens-Overlay --- */
.welcome-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(30,34,47,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s;
}
.welcome-box {
    background: var(--sidebar-bg);
    color: var(--accent);
    padding: 48px 80px;
    border-radius: 24px;
    box-shadow: 0 8px 32px #0005;
    font-size: 2.2em;
    animation: popIn 0.7s;
    text-align: center;
    letter-spacing: 1px;
}

/* --- Footer immer unten --- */
.footer {
    width: 100%;
    background: var(--sidebar-bg);
    color: #888;
    text-align: center;
    padding: 16px 0 12px 0;
    font-size: 1em;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
    box-shadow: 0 -2px 8px #0001;
    position: relative;
    bottom: 0;
    left: 0;
}

#todoList {
    list-style: none;
    padding: 0;
}


[data-theme="dark"] #todoList li:hover {
    background: var(--sidebar-bg) !important;
    color: var(--text) !important;
}
#todoList li.done {
    background: var(--bg) !important;
    color: var(--text) !important;
    opacity: 0.5;
}
#todoList li {
    transition: background 0.3s, opacity 0.3s;
}
#todoList li.removed {
    opacity: 0;
    background: #fa5252;
}

/* --- Modernere Buttons --- */
button,
input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 1.08em;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 2px 8px #0001;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
    outline: none;
    margin-top: 8px;
    margin-bottom: 4px;
    display: inline-block;
}
button:hover,
input[type="submit"]:hover {
    background: #339af0;
    box-shadow: 0 4px 16px #4dabf755;
    transform: translateY(-2px) scale(1.03);
}

button:active,
input[type="submit"]:active {
    background: #1971c2;
    transform: scale(0.98);
}

/* --- Formularfelder moderner --- */
#steamForm input,
#steamForm textarea,
#todoForm input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1.5px solid var(--sidebar-border);
    border-radius: 8px;
    font-size: 1em;
    background: var(--sidebar-bg);
    color: var(--text);
    transition: border 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px #0001;
}
#steamForm input:focus,
#steamForm textarea:focus,
#todoForm input:focus {
    border-color: var(--accent);
    box-shadow: 0 2px 8px #4dabf733;
    outline: none;
}

/* --- ToDo-Liste Button anpassen --- */
#todoForm button {
    width: auto;
    margin-left: 8px;
    padding: 10px 22px;
}

/* --- Einstellungen Button --- */
#saveSettingsBtn {
    margin-top: 18px;
    width: 100%;
}
.add-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.08em;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 2px 8px #0001;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
    outline: none;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.add-btn:hover {
    background: #339af0;
    box-shadow: 0 4px 16px #4dabf755;
    transform: translateY(-2px) scale(1.03);
}
.cancel-btn {
    background: #f8d7da;
    color: #c0392b;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.cancel-btn:hover {
    background: #fa5252;
    color: #fff;
}
#steamForm, #googleForm {
    animation: fadeIn 0.4s;
}



.profile-menu {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 1100;
}
.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.2em;
    cursor: pointer;
}
.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: #fff;
    border: 1px solid #ccc;
    z-index: 1001;
    min-width: 160px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.profile-dropdown.active {
    display: block;
}
.avatar {
    cursor: pointer;
    user-select: none;
}

.notify-btn {
    background: none; border: none; font-size: 1.5em; margin-left: 18px; cursor: pointer; position: relative;
}
.notify-btn.has-notification::after {
    content: '';
    display: block;
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: #fa5252;
    border-radius: 50%;
}

.tags { margin-top:8px; }
.tag {
    display:inline-block; background:var(--accent); color:#fff; border-radius:6px; padding:2px 10px; margin-right:6px; font-size:0.92em;
}

.todo-flex-row {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 24px;
}
.todo-form-ios {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px #0001;
    padding: 24px 20px 16px 20px;
    margin-bottom: 0;
    max-width: 340px;
    min-width: 240px;
}
.todo-chart-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px #0001;
    padding: 12px;
    min-width: 120px;
    min-height: 120px;
    background: var(--sidebar-bg);
}
#todoStatsChart {
    width: 100px !important;
    height: 100px !important;
    max-width: 120px;
    max-height: 120px;
    display: block;
}

@media (max-width: 900px) {
    .sidebar { position: fixed; left: -240px; top: 0; height: 100vh; z-index: 1000; transition: left 0.3s; }
    .sidebar.open { left: 0; }
    .main { margin-left: 0 !important; }
}

.profile-overlay, .pwchange-overlay {
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(30,34,47,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-box, .pwchange-box {
    background: var(--sidebar-bg);
    color: var(--text);
    border-radius: 18px;
    box-shadow: 0 8px 32px #0005;
    padding: 36px 44px;
    min-width: 320px;
    text-align: center;
    animation: fadeIn 0.3s;
}
.profile-box h3 {
    margin-top: 0;
    color: var(--accent);
}
.profile-box .avatar {
    margin: 0 auto 12px auto;
    width: 60px; height: 60px; font-size: 2em;
}
.pwchange-box input[type="password"] {
    width: 90%;
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 8px;
    border: 1.5px solid #e3e6ec;
    font-size: 1em;
}
.pwchange-box button {
    margin-top: 10px;
}
.profile-overlay .close-btn,
.pwchange-overlay .close-btn {
    position: absolute;
    top: 24px; right: 32px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #888;
    cursor: pointer;
}

.search-results {
    position: absolute;
    top: 48px; left: 50%; transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e3e6ec;
    border-radius: 10px;
    box-shadow: 0 4px 16px #0002;
    min-width: 320px;
    z-index: 2000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.search-results.active { display: block; }
.search-results ul { margin: 0; padding: 8px 0; list-style: none; }
.search-results li { padding: 8px 18px; border-bottom: 1px solid #f0f0f0; }
.search-results li:last-child { border-bottom: none; }

.todo-form-ios,
.todo-chart-box {
    background: var(--bg) !important;
}
.todo-text.overdue { color: #fa5252 !important; }

#todoList li:not(.done) {
    background: #fff !important;
    color: #222 !important;
}
[data-theme="dark"] #todoList li:not(.done) {
    background: #23263a !important;
    color: #fff !important;
}
.todo-text.overdue { color: #fa5252 !important; }
.pin-btn {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    margin-right: 8px;
    color: #fab005;
    transition: color 0.2s;
}
.pin-btn:hover {
    color: #fa5252;
}

@media (max-width: 700px) {
    .todo-flex-row { flex-direction: column; gap: 0; }
    .sidebar { position: static; width: 100%; }
    .main { margin-left: 0 !important; }
    .todo-form-ios, .todo-chart-box { max-width: 100%; min-width: 0; }
    .header, .content { padding: 8px; }
    button, input, select, textarea { font-size: 1.1em; }
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 8px;
    margin-right: 6px;
    font-size: 0.95em;
    background: #eaf4ff;
    color: #222;
}
@media (max-width: 700px) {
    .sidebar { width: 100%; position: static; }
    .main { margin-left: 0 !important; }
    .todo-flex-row { flex-direction: column; }
    .header, .content { padding: 8px; }
    button, input, select, textarea { font-size: 1.1em; }
}

.page { display: none; }
.page.active { display: block; }

#progressBar {
    transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

.note-badge, .tag, .note-category-badge, .notiz-badge {
    transition: background 0.01s, color 0.01s;
}

h1, h2, h3, .header h1, .content h2, #mainHeader {
    transition: color 2s !important;
    transition-property: color !important;
}

.lss-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}
.lss-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0001;
  padding: 20px;
  flex: 1 1 350px;
  min-width: 320px;
  max-width: 100%;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}
.lss-card h3 {
  margin-top: 0;
}
.lss-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.lss-form input, .lss-form textarea, .lss-form button {
  font-size: 1em;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}
.lss-form textarea {
  flex: 1 1 100%;
  min-height: 40px;
  resize: vertical;
}
.lss-form button {
  background: #1976d2;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.lss-form button:hover {
  background: #125ea2;
}
.lss-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.lss-table th, .lss-table td {
  border: 1px solid #e0e0e0;
  padding: 6px 10px;
  text-align: left;
}
.lss-table tr:nth-child(even) {
  background: #f9f9f9;
}
.lss-table .ok { color: #2a7a2a; font-weight: bold; }
.lss-table .warn { color: #c00; font-weight: bold; }
.lss-card button {
  border-radius: 6px;
  border: none;
  background: #1976d2;
  color: #fff;
  padding: 4px 10px;
  margin-left: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.lss-card button:hover {
  background: #125ea2;
}
.lss-notes {
  list-style: disc inside;
  padding-left: 0;
}
.lss-notes li {
  margin-bottom: 6px;
  background: #f4f7fa;
  border-radius: 6px;
  padding: 6px 10px;
}
.lss-links {
  list-style: none;
  padding-left: 0;
}
.lss-links li {
  margin-bottom: 6px;
}
.lss-links a {
  color: #1976d2;
  text-decoration: none;
  font-weight: bold;
}
.lss-links a:hover {
  text-decoration: underline;
}
@media (max-width: 900px) {
  .lss-cards { flex-direction: column; }
  .lss-card { min-width: 0; }
}

.lss-card {
    background: #fff;
    color: #222; /* <-- Schriftfarbe dunkel */
    border-radius: 12px;
    box-shadow: 0 2px 8px #0001;
    padding: 20px;
    flex: 1 1 350px;
    min-width: 320px;
    max-width: 100%;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .lss-card {
    background: #222;
    color: #fff;
}

.lss-form input[type="datetime-local"] {
    min-width: 220px;
    width: 100%;
    max-width: 340px;
    font-size: 1.1em;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid #b0b0b0;
    background: #fff;
    color: #222;
    box-sizing: border-box;
}

[data-theme="dark"] .lss-form input[type="datetime-local"] {
    background: #23263a;
    color: #fff;
    border-color: #444;
}

.lss-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.lss-tab-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 6px 6px 0 0;
  background: #eaf4ff;
  color: #1976d2;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.lss-tab-btn.active {
  background: #1976d2;
  color: #fff;
}
.lss-row-fertig {
  background: transparent !important;
  transition: background 0.3s;
}
.lss-row-fertig td.lss-ende-fertig {
  color: #2a7a2a !important; /* grün */
  font-weight: bold;
}
.lss-row-aktiv td.lss-ende-aktiv {
  color: #c00 !important; /* rot */
  font-weight: bold;
}
details[open] > summary::after {
  content: "▲";
  float: right;
  font-size: 0.9em;
  margin-left: 8px;
}
details:not([open]) > summary::after {
  content: "▼";
}

body.not-logged-in #app-container,
body.not-logged-in #welcomeOverlay {
    display: none !important;
}
body.not-logged-in #loginBox {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}
.logs-table th, .logs-table td {
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: left;
}
.logs-table th {
    background: #f5f5f5;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
}
.user-table th, .user-table td {
    border: 1px solid #ccc;
    padding: 6px 10px;
    text-align: left;
}
.user-table th {
    background: #f5f5f5;
}