/* ============================================================
   LERNWEG – Styles für Bubbles, Fortschritt & Popups
   Design: modern + Spain-Flair + Micro-Animations
   ============================================================ */

/* ---------- PROGRESS ---------- */
.progress.container {
  margin: 2rem auto 2.5rem;
  text-align: center;
  max-width: 900px;
}

#progress-text {
  font-weight: 500;
  color: var(--text, #222);
  letter-spacing: 0.3px;
}

.progress-bar {
  height: 12px;
  background: #d7d9dc;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow-soft, 0 3px 8px rgba(0,0,0,.15));
  margin-top: .8rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fdd835, #ef5350);
  transition: width 0.5s ease-in-out;
}

/* ---------- BUBBLE GRID ---------- */
.bubble-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  justify-items: center;
  align-items: center;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 20px;
  row-gap: 2.5rem;
}

/* ---------- BUBBLE ---------- */
.bubble {
  position: relative;
  background: var(--surface, #fff);
  border-radius: 50%;
  width: 110px;
  height: 110px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.25s ease-in-out;
  cursor: pointer;
  overflow: visible; /* Text darf raus */
  margin-bottom: 1.6rem;
}

.bubble:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.bubble img {
  width: 66px;
  height: 66px;
  margin-bottom: .4rem;
  transition: filter 0.3s ease;
}

.bubble span {
  position: absolute;
  bottom: -1.4rem;
  width: 100%;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #111;
  line-height: 1.2;
  pointer-events: none;
}

/* ---------- STATES ---------- */
.bubble input[type="checkbox"] {
  display: none;
}

.bubble.completed {
  background: radial-gradient(circle at top left, #fff 40%, #fff8e1);
  border: 2px solid #fdd835;
  box-shadow: 0 0 12px rgba(253,216,53,0.6);
  animation: bubblePulse 0.6s ease-out;
}

.bubble.completed span { color: #000; }

.bubble:not(.completed) img {
  filter: grayscale(1) opacity(0.7);
}

/* ---------- ANIMATIONS ---------- */
@keyframes bubblePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(253,216,53,0); }
  50% { transform: scale(1.1); box-shadow: 0 0 25px rgba(253,216,53,0.5); }
  100% { transform: scale(1); box-shadow: 0 0 12px rgba(253,216,53,0.3); }
}

/* ---------- POPUP ---------- */
.reward-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--surface, #fff);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow, 0 12px 28px rgba(0,0,0,0.25));
  display: none;
  align-items: center;
  flex-direction: column;
  text-align: center;
  z-index: 2000;
  animation: popupIn 0.4s ease-out;
}

.reward-popup.active {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
}

.reward-popup img {
  width: 64px;
  margin-bottom: .6rem;
}

.reward-popup p {
  font-weight: 600;
  color: var(--text, #222);
  font-size: 1rem;
}

@keyframes popupIn {
  0% { opacity: 0; transform: translate(-50%, -55%) scale(0.9); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .bubble-grid { row-gap: 2.8rem; }
  .bubble { width: 95px; height: 95px; }
}

@media (max-width: 768px) {
  .bubble-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.6rem 1.2rem;
    padding: 0 20px;
  }

  .bubble {
    width: 92px;
    height: 92px;
    margin-bottom: 1.8rem;
  }

  .bubble span {
    bottom: -1.3rem;
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .progress-bar { height: 14px; }
}

@media (max-width: 480px) {
  .bubble-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 1rem;
  }

  .bubble {
    width: 100px;
    height: 100px;
    margin-bottom: 2rem;
  }

  .bubble span {
    bottom: -1.5rem;
    font-size: 0.85rem;
  }
}

/* ---------- DARK MODE ---------- */
@media (prefers-color-scheme: dark) {
  .progress-bar { background: var(--surface-2, #161a1e); }
  .progress-fill { background: linear-gradient(90deg, #90caf9, #ffdb4d); }

  .bubble {
    background: var(--surface, #1b1f24);
    box-shadow: 0 6px 14px rgba(0,0,0,0.6);
  }

  .bubble.completed {
    border: 2px solid var(--accent, #ffdb4d);
    background: radial-gradient(circle at top left, #1b1f24 40%, rgba(255,219,77,0.08));
    box-shadow: 0 0 18px rgba(255,219,77,0.4);
  }

  .reward-popup {
    background: var(--surface, #1b1f24);
    color: var(--text, #e9e9e9);
    box-shadow: 0 12px 28px rgba(0,0,0,0.7);
  }

  .reward-popup p { color: var(--text, #e9e9e9); }
}

/* ============================================================
   FIX – Positionierung der Progress-Bar im Lernweg-Bereich
   ============================================================ */

/* Fortschrittsbereich unabhängig zentrieren */
.lernweg-section {
  display: block; /* statt flex → verhindert vertikale Verschiebung */
  text-align: center;
  width: 100vw;
  background: #f3f4f6;
  padding: 4rem 0 5rem 0;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

/* Container-Inhalt (Progress + Bubbles) zentriert, aber nicht zusammengedrückt */
.lernweg-section .container {
  max-width: 1000px;
  margin: 0 auto;
  width: 90%;
}

/* Fortschrittsbereich leicht nach unten rücken */
.lernweg-section .progress.container {
  margin-top: 0;
  margin-bottom: 2.5rem;
}

/* ---------- DARK MODE ---------- */
@media (prefers-color-scheme: dark) {
  .lernweg-section {
    background: #161a1e;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
  }
}
.back-button-wrap {
  margin-top: 3rem; /* vorher war es vermutlich 1rem */
  text-align: center;
 
}
/* ============================================================
   POPUP – STABIL FIXIERT UND ZENTRIERT
   ============================================================ */

/* universeller Fix: Popup vom Layout-Kontext trennen */
.reward-popup {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999999; /* sehr hoch, über allem */
  margin: 0;
  padding: 0;
  overflow: hidden;
  transform: none !important;
}

/* Inhalt im Zentrum halten */
.reward-content {
  background: var(--surface, #fff);
  border-radius: 1rem;
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  position: relative;
  max-width: 400px;
  width: 90%;
  animation: popupIn 0.3s ease-out forwards;
}

/* Bildgröße fixieren */
.reward-content img {
  width: 80px;
  height: auto;
  margin: 0 auto 1rem auto;
  object-fit: contain;
}

/* Close-Button */
.popup-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.popup-close:hover {
  color: #d64a4a;
}

/* Einfache Einblendanimation */
@keyframes popupIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

/* DARK MODE */
@media (prefers-color-scheme: dark) {
  .reward-content {
    background: #1b1f24;
    color: #e9e9e9;
  }
  .popup-close { color: #aaa; }
  .popup-close:hover { color: #ffdb4d; }
}

/* ============================================================
   DARK MODE – Feinschliff für Lesbarkeit & Kontrast
   ============================================================ */
@media (prefers-color-scheme: dark) {
  /* Fortschrittsbalken: heller Hintergrund */
  .progress-bar {
    background: #2a2e33; /* heller als vorher (#161a1e) */
  }

  /* Fortschrittsbalken-Füllung: bleibt leuchtend */
  .progress-fill {
    background: linear-gradient(90deg, #90caf9, #ffdb4d);
  }


  /* Text unter den Bubbles: heller & besser lesbar */
  .bubble span {
    color: #f0f0f0; /* helles Weißgrau */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  }

  .bubble.completed span {
    color: #fff8dc; /* leicht warmes Weiß (harmoniert mit Gelb) */
  }


}
