 /* ==========================
   🎨 Basisfarben (Light Mode)
   ========================== */
:root {
  --bg: #f5f6fa;             /* sehr helles Grau mit leichtem Blaustich */
  --card-bg: #ffffff;        /* klassisches Weiß für Karten */
  --text: #1e293b;           /* dunkelblaugrau, modern */
  --highlight: #ffd54f;      /* weiches, mattes Gelb */
  --accent: #2563eb;         /* frisches, klares Blau (Akzent) */
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --input-bg: #f1f5f9;
  --border: #e2e8f0;
  --success-bg: #c8e6c9;     /* sanftes Grün */
  --success-border: #43a047;
  --error-bg: #f8d7da;       /* leicht rosé, nicht grell */
  --error-border: #e57373;
}
/* ==========================
   🌙 Automatischer Darkmode
   ========================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;           /* Haupt-Hintergrund */
    --card-bg: #161b22;      /* Panels und Karten */
    --text: #e6edf3;         /* sanftes, leicht bläuliches Weiß */
    --highlight: #d8a824; /* dunkleres, weiches Gold */
    --accent: #3b82f6;       /* modernes Blau für aktive Elemente */
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.6);

    /* ✏️ Hier ist der Unterschied: dunkler, matter Input-Hintergrund */
    --input-bg: #0f141a;     /* dunkler als card-bg, perfekt für Textfelder */
    --border: #2d333b;       /* weicher, neutraler Rahmen */
    --success-bg: #0f2f23;   /* dunkles, entspanntes Grün */
    --success-border: #2ecc71;
    --error-bg: #3a1f1f;     /* tiefes, dunkles Rotbraun */
    --error-border: #e57373;
  }
}



/* ==========================
   🔹 Grundlayout
   ========================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==========================
   🧱 App-Container
   ========================== */
.app-container {
  width: min(420px, 90%);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* ⬅️ vorher: space-between */
  align-items: stretch;
  padding: 1rem 0 0.5rem; /* etwas mehr Platz oben */
  box-sizing: border-box;
  gap: 1rem; /* schönerer Abstand zwischen Bereichen */
}


/* ==========================
   🧭 Überschriften & Tabs
   ========================== */
h1 {
  font-size: 1.4rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.95rem;
  text-align: center;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.6rem 0 0.4rem;
}

.tabs button {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.45rem 0.9rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  transition: background 0.2s, transform 0.15s;
}

.tabs button:hover { transform: scale(1.05); }
.tabs button.active {
  background: var(--highlight);
  color: var(--text);
}

/* ==========================
   📖 Text- & Quiz-Karten
   ========================== */
.text-card,
#quizCard {
  width: 100%;
  flex: 1 1 auto;
  max-height: 55dvh;
  background: var(--card-bg);
  border-radius: 22px;
  box-shadow: var(--shadow);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 1.2rem 1rem;
   max-height: 75dvh !important;         /* falls du auch mehr Sichtfläche willst */
 
}

.text-card::-webkit-scrollbar,
#quizCard::-webkit-scrollbar {
  display: none;
}

/* ==========================
   💬 Wörter-Highlight
   ========================== */
.word {
  padding: 2px 3px;
  border-radius: 4px;
  transition: background-color 0.25s ease;
}
.highlight {
  background: var(--highlight);
  color: var(--text);
}

/* ==========================
   ✏️ Quiz-Eingaben & Buttons
   ========================== */
.question {
  margin-bottom: 1.2rem;
}

.answer-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s, background 0.3s;
}
.answer-input:focus {
  outline: none;
  border-color: var(--highlight);
  background: color-mix(in srgb, var(--input-bg) 90%, var(--highlight) 10%);
}
/* === Ergebnisfeedback für richtige/falsche Eingaben === */
.answer-input.correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--text);
}
.answer-input.incorrect {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--text);
}
.answer-input.correct,
.answer-input.incorrect {
  transition: background 0.3s ease, border-color 0.3s ease;
}



.btn-check {
  margin-top: 1.5rem;
  background: var(--highlight);
  color: var(--text);
  font-weight: 600;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-check:hover { background: #ffeb3b; }

.feedback {
  margin-top: 1rem;
  font-weight: 600;
  text-align: center;
}

/* ==========================
   🎧 Audio-Box (Player)
   ========================== */
.audio-box {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 0.7rem 1rem;      /* ⬅️ vorher 1rem 1.25rem – jetzt kompakter */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;               /* ⬅️ engerer Abstand */
  flex-shrink: 0;
  position: sticky;
  bottom: 0.3rem;            /* ⬅️ leicht angehoben für visuelle Balance */
  box-sizing: border-box;
  margin: 0 auto;
  width: 95%;                /* ⬅️ etwas schmaler – wirkt eleganter */
  max-width: 420px;          /* bleibt deckungsgleich mit Textkarte */
}


.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(26, 35, 126, 0.15);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--text);
  transition: width 0.1s linear;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}
.player-controls button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.player-controls button:hover {
  transform: scale(1.15);
  opacity: 0.8;
}

/* ==========================
   🧱 Spacer
   ========================== */
.spacer {
  width: 100%;
  height: clamp(0.8rem, 2vh, 2rem);
  flex-shrink: 0;
  background: transparent;
}
@media (min-width: 768px) {
  .spacer { height: clamp(1rem, 3vh, 2.5rem); }
}

/* ==========================
   📱 Mobile
   ========================== */
@media (max-width: 480px) {
  h1 {
    font-size: 1.1rem;
    margin-top: 0.3rem;
  }
  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
  }
  .text-card {
    font-size: 0.95rem;
    padding: 1rem;
    max-height: 52dvh;
  }
  .audio-box {
    padding: 0.6rem 0.8rem;
    gap: 0.6rem;
    width: 100%;
  }
}


/* ==========================
   ⚙️ Fixierter Footer (Dark-Mode-ready)
   ========================== */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.6;
  padding: 0.6rem 0.4rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  z-index: 50;
  transition: opacity 0.3s ease;
}

.page-footer:hover {
  opacity: 0.9;
}

.page-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.page-footer a:hover {
  color: var(--highlight);
}

/* Mobile */
@media (max-width: 480px) {
  .page-footer {
    font-size: 0.75rem;
    padding: 0.4rem 0;
  }
}
/* ==========================
   🌙 Dark Mode Feinabstimmung
   ========================== */
@media (prefers-color-scheme: dark) {
  :root {
    --highlight: #d8a824;  /* dunkleres Gold statt grellem Gelb */
    --accent: #3b82f6;     /* bleibt gleich */
  }

  /* Tabs, Buttons, Hover-Effekte */
  .tabs button.active {
    background: var(--highlight);
    color: #111;
    font-weight: 600;
  }

  .tabs button:hover {
    background: color-mix(in srgb, var(--highlight) 85%, #000 15%);
    transform: scale(1.04);
  }

  .btn-check {
    background: var(--highlight);
    color: #111;
  }

  .btn-check:hover {
    background: color-mix(in srgb, var(--highlight) 80%, #000 20%);
  }

}

/* === 🔍 Übersetzungs-Popup === */
.translation-popup {
  position: fixed;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.45rem 0.75rem;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  max-width: 220px;
  line-height: 1.4;
  z-index: 999;
  display: none;
  transform: translate(-50%, -120%);
  white-space: normal;
  pointer-events: none; /* verhindert, dass der Tooltip Klicks blockiert */
}

.translation-popup.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -100%); }
  to   { opacity: 1; transform: translate(-50%, -120%); }
}

@media (prefers-color-scheme: dark) {
  .translation-popup {
    background: #1c212c;
    border-color: rgba(255,255,255,0.12);
    color: #e9eef7;
  }
}
/* 💡 Tipp-Hinweis unter Subtitle */
.tip-hint {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: -0.4rem;
  margin-bottom: 0.8rem;
  font-style: italic;
  opacity: 0.9;
}

/* 🌙 Dark Mode-Tuning */
@media (prefers-color-scheme: dark) {
  .tip-hint {
    color: #a0aec0; /* etwas wärmeres Grau für Lesbarkeit */
    opacity: 0.85;
  }
}

/* === Foto-Popup (Overlay) === */
.foto-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;                 /* initial unsichtbar */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.foto-content {
  position: relative;
  background: var(--card-bg);
  color: var(--text);
  padding: 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 90%;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  animation: fadeIn 0.25s ease-out;
}

.foto-content img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}

.foto-caption {
  font-size: 0.9rem;
  opacity: 0.85;
  text-align: center;
  font-style: italic;
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.close-btn:hover { opacity: 1; }

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Darkmode optimiert */
@media (prefers-color-scheme: dark) {
  .foto-popup {
    background: rgba(0, 0, 0, 0.75);
  }
  .foto-content {
    background: #1a1f28;
  }
}

.foto-content img {
  width: auto;
  max-width: 85%;
  max-height: 70vh; /* nie höher als 70% der Bildschirmhöhe */
  object-fit: contain;
  border-radius: 14px;
}

/* === Eduki CTA Section (kompakter) === */
/* === Eduki CTA Section (responsive + dark mode) === */
.cta-eduki {
  background: var(--cta-bg, #fff);
  color: var(--cta-text, #111);
  border-radius: 14px;
  padding: 1.6rem 1.8rem 2rem;
  text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  max-width: 680px;
  margin: 1.2rem auto 1.8rem;
  transition: all 0.3s ease;
}

.cta-eduki h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.3;
  text-align: center;
}

.cta-eduki .highlight {
  background: #ffeb3b;
  padding: 0 6px 2px;
  border-radius: 3px;
}

.cta-eduki .intro {
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 1.2rem;
  color: var(--cta-sub, #333);
}

/* Button */
.cta-eduki-btn {
  display: block;
  width: fit-content;
  background: #ff6f61;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  text-decoration: none;
  margin: 0 auto 1.4rem;
  box-shadow: 0 3px 10px rgba(255, 111, 97, 0.25);
  transition: all 0.25s ease;
  text-align: center;
}
.cta-eduki-btn:hover { transform: translateY(-2px); background: #ff5a4a; }

.cta-divider {
  height: 1px;
  background: #eee;
  margin: 1.2rem 0 1rem;
}

.cta-eduki .steps-title { margin-bottom: 0.4rem; font-weight: 700; }
.cta-eduki .cta-list { list-style: none; padding-left: 0; margin: 0 0 0.8rem; }
.cta-eduki .cta-list li { margin: 0.25rem 0; line-height: 1.45; }

.cta-eduki .niveaus {
  font-weight: 500;
  margin: 0.6rem 0 1.2rem;
  color: #444;
}

.cta-eduki .subline {
  color: #555;
  font-style: italic;
  text-align: center;
}

/* === Dark Mode === */
@media (prefers-color-scheme: dark) {
  .cta-eduki {
    background: #1e1e1e;
    color: #f5f5f5;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.06);
  }
  .cta-eduki .highlight { background: #fbc02d; color: #111; }
  .cta-divider { background: #333; }
  .cta-eduki .cta-list li strong { color: #ffeb3b; }
  .cta-eduki-btn {
    background: #ff7961;
    box-shadow: 0 3px 10px rgba(255, 121, 97, 0.3);
  }
  .cta-eduki-btn:hover { background: #ff5a4a; }
  .cta-eduki .subline { color: #ccc; }
}

/* === Mobile Optimierung === */
@media (max-width: 600px) {
  .cta-eduki {
    padding: 1.2rem 1.4rem 1.6rem;
    border-radius: 12px;
  }
  .cta-eduki h2 {
    font-size: 1.35rem;
    line-height: 1.25;
  }
  .cta-eduki .intro {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }
  .cta-eduki-btn {
    font-size: 0.95rem;
    padding: 0.7rem 1.4rem;
    margin-bottom: 1.2rem;
  }
  .cta-eduki .cta-list li {
    font-size: 0.95rem;
    line-height: 1.4;
  }
  .cta-eduki .subline {
    font-size: 0.9rem;
    line-height: 1.4;
  }
}
