:root {
  --af-bg: #020617;
  --af-card: #020617;
  --af-border: #1f2937;
  --af-accent: #0ea5e9;
  --af-accent-soft: rgba(56, 189, 248, 0.15);
  --af-correct: #22c55e;
  --af-wrong: #ef4444;
}

body.bg-body {
  background: radial-gradient(circle at top, #111827, #020617);
  color: #e5e7eb;
}

.app-shell {
  max-width: 1420px;
}

/* Sidebar */

.sidebar-card {
  background: linear-gradient(145deg, #020617, #020617 60%, #020617);
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.75);
  color: #e5e7eb;
}

.logo-pill {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #38bdf8, #0ea5e9 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #020617;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
}

/* Seitenliste: vertikal untereinander */
.page-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.page-list::-webkit-scrollbar {
  width: 6px;
}

.page-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

.page-button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.92);
  color: #9ca3af;
  font-size: 0.8rem;
  padding: 4px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-button:hover {
  background: rgba(15, 23, 42, 0.96);
  border-color: var(--af-accent);
  color: var(--af-accent);
  transform: translateY(-1px);
}

/* Seite komplett richtig beantwortet -> grün */
.page-button.complete {
  border-color: var(--af-correct);
  background: rgba(22, 163, 74, 0.15);
  color: #bbf7d0;
}

/* Aktive Seite -> blau (hat Vorrang vor complete) */
.page-button.active {
  background: radial-gradient(circle at top left, var(--af-accent-soft), #020617);
  border-color: var(--af-accent);
  color: #e5e7eb;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

/* Main card */

.main-card {
  background: radial-gradient(circle at top left, #020617, #020617 60%, #020617);
  border-radius: 1.1rem;
  border: 1px solid rgba(37, 99, 235, 0.5);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.75);
  color: #e5e7eb;
}

#questionsContainer {
  max-height: calc(100vh - 170px);
}

/* Question cards */

.question-card {
  border-radius: 0.9rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(55, 65, 81, 0.9);
  margin-bottom: 0.9rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
}

.question-number {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--af-accent);
  font-weight: 600;
}

.question-id {
  font-size: 0.78rem;
  color: #9ca3af;
}

.question-text {
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Options */

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.option-label:hover {
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.option-label.correct {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(6, 95, 70, 0.23);
}

.option-label.incorrect.chosen {
  border-color: rgba(248, 113, 113, 0.9);
  background: rgba(127, 29, 29, 0.25);
}

.option-letter {
  font-weight: 600;
  font-size: 0.86rem;
  color: #9ca3af;
  min-width: 1.3rem;
}

.option-input {
  margin-top: 0.35rem;
}

/* Explanation */

.explanation-box {
  margin-top: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 0.86rem;
  color: #9ca3af;
  display: none;
}

.explanation-box.visible {
  display: block;
}

/* Light-Mode Overrides */

body.light-mode.bg-body {
  background: #f3f4f6;
  color: #111827;
}

body.light-mode .sidebar-card {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border-color: rgba(148, 163, 184, 0.6);
}

body.light-mode .main-card {
  background: #ffffff;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.7);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

body.light-mode .question-card {
  background: #f9fafb;
}

body.light-mode .page-button {
  background: #f3f4f6;
  color: #374151;
}

body.light-mode .page-button.complete {
  background: #dcfce7;
  color: #166534;
}

body.light-mode .page-button.active {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Responsive */

@media (max-width: 992px) {
  #questionsContainer {
    max-height: none;
  }
}



/* --------------------------
   Global Typo & Layout-Polish
---------------------------*/

body,
button,
input,
label {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}

.app-shell {
  max-width: 1320px;
  margin-inline: auto;
}

/* Headline mit leichtem Glow */
.brand-title {
  color: #e5e7eb;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.brand-title span {
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* Meta-Badge noch etwas dezenter */
#pageIndicator {
  font-size: 0.78rem;
}

/* Buttons kompakter & moderner */
.btn {
  border-radius: 999px;
}

.btn-sm {
  padding-inline: 0.9rem;
}

/* --------------------------
   Question Cards – Glow & Hover
---------------------------*/

.question-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.question-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.question-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.9);
  border-color: rgba(59, 130, 246, 0.9);
}

.question-card:hover::before {
  opacity: 1;
}

.question-number {
  font-size: 0.8rem;
}

.question-id {
  font-size: 0.76rem;
  opacity: 0.8;
}

/* Options noch etwas lesbarer */

.option-label {
  backdrop-filter: blur(8px);
}

.option-label .flex-grow-1 {
  line-height: 1.35;
}

/* Wenn korrekt/inkorrekt, etwas stärkere Farben */

.option-label.correct {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.9);
}

.option-label.incorrect.chosen {
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.9);
}

/* --------------------------
   Smooth Explanation-Toggle
---------------------------*/

/* Alte display:none/visible-Regel überschreiben */
.explanation-box {
  margin-top: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 0.86rem;
  color: #9ca3af;

  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.explanation-box.visible {
  max-height: 400px; /* reicht locker für Text */
  opacity: 1;
  transform: translateY(0);
}

/* Button für Erklärung */

.explanation-toggle {
  border-radius: 999px;
  font-size: 0.78rem;
  padding-inline: 0.9rem;
}

/* --------------------------
   Sidebar & Donation Widget
---------------------------*/

.sidebar-card {
  backdrop-filter: blur(16px);
}

.sidebar-card iframe {
  width: 100%;
  max-width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
}

/* "Pages" Liste noch feiner */

.page-list {
  margin-top: 0.2rem;
}

.page-button {
  font-weight: 500;
}

/* Page-Buttons noch klarer unterscheidbar */
.page-button.complete:not(.active) {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
}

/* --------------------------
   Responsive Fine-Tuning
---------------------------*/

@media (max-width: 768px) {
  .brand-title {
    font-size: 0.85rem;
  }

  #questionsContainer {
    max-height: none;
  }

  .sidebar-card iframe {
    height: 400px;
  }
}

/* --- Kontrast-Fix für Light Mode: Überschrift & Sidebar --- */

body.light-mode h1.text-white {
  color: #111827 !important; /* fast schwarz */
}

body.light-mode .sidebar-card .text-white {
  color: #111827 !important;
}

body.light-mode .sidebar-card .text-muted {
  color: #6b7280 !important; /* gut lesbar auf weiß */
}

/* Meta-Info oben: in Dark Mode heller, in Light Mode dunkler */

body:not(.light-mode) #metaInfo {
  color: #9ca3af !important;
}

body.light-mode #metaInfo {
  color: #4b5563 !important;
}

/* --- Light-Mode Varianten für Fragen & Antworten --- */

body.light-mode .question-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.7);
  color: #111827;
}

body.light-mode .option-label {
  background: #f9fafb;
  border-color: rgba(148, 163, 184, 0.7);
  color: #111827;
}

body.light-mode .option-label:hover {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

body.light-mode .option-label.correct {
  background: #dcfce7;
  border-color: #22c55e;
}

body.light-mode .option-label.incorrect.chosen {
  background: #fee2e2;
  border-color: #ef4444;
}

body.light-mode .option-letter {
  color: #4b5563;
}

/* Erklärungskasten im Light Mode */

body.light-mode .explanation-box {
  background: #f9fafb;
  border-color: rgba(148, 163, 184, 0.8);
  color: #4b5563;
}

/* Sidebar support / donate section */

.sidebar-support {
  color: #9ca3af;
}

.sidebar-support-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #e5e7eb;
}

.sidebar-support-text {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* kleiner, dezenter Donate-Button */
.sidebar-donate-btn {
  border-radius: 999px;
  border: 1px solid var(--af-accent);
  background: var(--af-accent-soft);
  color: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.sidebar-donate-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #f9fafb;
}

/* Light-Mode-Anpassungen */
body.light-mode .sidebar-support {
  color: #4b5563;
}

body.light-mode .sidebar-support-title {
  color: #111827;
}

body.light-mode .sidebar-donate-btn {
  background: #e0f2fe;
  color: #0f172a;
  border-color: #38bdf8;
}

body.light-mode .sidebar-donate-btn:hover {
  background: #bae6fd;
}


/* Sidebar text readability fix */

.sidebar-header {
  color: #f1f5f9;
}

.sidebar-sub {
  color: #9ca3af;
  line-height: 1.35;
  display: block;
  margin-top: 4px;
}

/* Light mode override */
body.light-mode .sidebar-header {
  color: #111827;
}

body.light-mode .sidebar-sub {
  color: #4b5563;
}
.sidebar-header {
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

.sidebar-sub {
  font-size: 0.78rem;
}
