/* Vokabeltrainer - Design angelehnt an eliasdev.de */

:root,
:root[data-theme="dark"] {
  --bg: #090c14;
  --bg-secondary: #0d111c;
  --card-bg-solid: #131926;
  --card-border: rgba(148, 163, 184, 0.12);
  --text: #e7eaf1;
  --text-muted: #8a92a8;
  --accent: #3d7eff;
  --accent-light: #74a3ff;
  --accent-dark: #245ad1;
  --success: #22c55e;
  --warning: #f5a524;
  --danger: #f0455c;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.38);
  --glass: rgba(17, 22, 35, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-display: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1080px;
  --header-h: 72px;
}

:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-secondary: #ffffff;
  --card-bg-solid: #ffffff;
  --card-border: rgba(15, 23, 42, 0.14);
  --text: #10152a;
  --text-muted: #4c5670;
  --accent: #2158e0;
  --accent-light: #3b6fe8;
  --accent-dark: #17429f;
  --success: #0d6e33;
  --warning: #9a5b00;
  --danger: #c81e3a;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.14);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(15, 23, 42, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}

.nav {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  flex: 1;
}

.nav-links a {
  position: relative;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--glass-border); }
.nav-links a.is-active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

.theme-toggle {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg-solid);
  position: relative;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.25s ease;
}
[data-theme="light"] .theme-toggle-thumb { transform: translateX(20px); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border: 1px solid var(--card-border); color: var(--text); }
.btn-ghost:hover { background: var(--glass-border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Layout */
.page { width: 100%; max-width: var(--max-width); margin-inline: auto; padding: 28px 20px 60px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 6px; }
.page-head p { color: var(--text-muted); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.card {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
a.card:hover, .card.is-hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.card p { color: var(--text-muted); font-size: 0.92rem; }

.stat-card { text-align: center; }
.stat-card .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* Formulare */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.field-hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }

input[type="text"], input[type="password"], input[type="date"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--bg-secondary);
  color: var(--text);
  transition: border-color 0.2s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; font-family: var(--font-mono, monospace); }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--card-border); }

.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--card-border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--card-border); }
.table-wrap table { min-width: 640px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-new { background: rgba(138, 146, 168, 0.18); color: var(--text-muted); }
.badge-unsure { background: rgba(245, 165, 36, 0.18); color: var(--warning); }
.badge-good { background: rgba(61, 126, 255, 0.18); color: var(--accent-light); }
.badge-learned { background: rgba(34, 197, 94, 0.18); color: var(--success); }
.badge-difficult { background: rgba(240, 69, 92, 0.18); color: var(--danger); }

/* Flash */
.flash { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 18px; font-size: 0.92rem; }
.flash-success { background: rgba(34, 197, 94, 0.14); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success); }
.flash-error { background: rgba(240, 69, 92, 0.14); border: 1px solid rgba(240, 69, 92, 0.3); color: var(--danger); }
.flash-info { background: rgba(61, 126, 255, 0.14); border: 1px solid rgba(61, 126, 255, 0.3); color: var(--accent-light); }

/* Fortschrittsbalken */
.progress-bar { height: 8px; border-radius: 999px; background: var(--card-border); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); border-radius: 999px; transition: width 0.4s ease; }

/* Lern-Runner */
.runner {
  max-width: 520px;
  margin-inline: auto;
  text-align: center;
}
.runner-progress { margin-bottom: 24px; }
.runner-progress-text { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; }

.runner-card {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  box-shadow: var(--shadow-md);
}

.runner-german { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin-bottom: 6px; }
.runner-hint { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 24px; }

.runner-input {
  width: 100%;
  padding: 16px 18px;
  font-size: 1.2rem;
  text-align: center;
  border-radius: var(--radius-md);
  border: 2px solid var(--card-border);
  background: var(--bg-secondary);
}
.runner-input:focus { outline: none; border-color: var(--accent); }
.runner-input.is-correct { border-color: var(--success); }
.runner-input.is-wrong { border-color: var(--danger); }

.runner-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: center; flex-wrap: wrap; }

.runner-feedback { margin-top: 22px; padding: 16px; border-radius: var(--radius-md); font-size: 0.98rem; animation: fadeIn 0.25s ease; }
.runner-feedback.correct { background: rgba(34, 197, 94, 0.14); color: var(--success); }
.runner-feedback.wrong { background: rgba(240, 69, 92, 0.14); color: var(--danger); }
.runner-feedback .solution { display: block; margin-top: 6px; font-weight: 700; color: var(--text); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.runner-summary { text-align: left; }
.runner-summary ul { list-style: none; margin-top: 14px; }
.runner-summary li { padding: 10px 0; border-bottom: 1px solid var(--card-border); display: flex; justify-content: space-between; }

/* Unit / Vokabel Karten */
.unit-card { display: flex; flex-direction: column; gap: 12px; }
.unit-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.unit-card h3 { margin-bottom: 0; }
.unit-meta { color: var(--text-muted); font-size: 0.85rem; }
.unit-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.preview-table td, .preview-table th { font-size: 0.88rem; }
.preview-row-error { background: rgba(240, 69, 92, 0.08); }

.modal-confirm { max-width: 420px; margin-inline: auto; }

.section { margin-bottom: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-family: var(--font-display); font-size: 1.25rem; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

@media (max-width: 860px) {
  .nav-burger { display: flex; }
  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--glass);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

@media (max-width: 560px) {
  .runner-card { padding: 28px 18px; }
  .runner-german { font-size: 1.5rem; }
}
.site-footer {
    width: 100%;
    margin-top: 60px;
    border-top: 1px solid #1f2937;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer p {
    margin: 0;
    font-size: 14px;
    color: #8ea0bd;
}

.site-footer a {
    color: #8ea0bd;
    text-decoration: none;
}

.site-footer a:hover {
    color: #ffffff;
}

@media (max-width: 700px) {
    .site-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
