/* Duolingo Stijl voor Ade's SingLingo */
:root {
  --color-green: #58cc02;
  --color-green-dark: #46a302;
  --color-blue: #1cb0f6;
  --color-blue-dark: #1899d6;
  --color-orange: #ff9600;
  --color-orange-dark: #cc7800;
  --color-red: #ff4b4b;
  --color-red-dark: #d33131;
  --color-purple: #ce82ff;
  --color-purple-dark: #a559e0;
  --color-yellow: #ffc800;
  --color-yellow-dark: #e5a400;
  --color-gray-light: #f7f7f7;
  --color-gray-border: #e5e5e5;
  --color-text-dark: #3c3c3c;
  --color-text-muted: #777777;
  
  --font-family: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: #ffffff;
  color: var(--color-text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 3D Knoppen (Duolingo Stijl) */
.btn-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  padding: 14px 28px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  text-decoration: none;
}

.btn-3d:active {
  transform: translateY(4px);
}

.btn-3d:disabled {
  background-color: #e5e5e5 !important;
  color: #afafaf !important;
  box-shadow: 0 4px 0 #cfcfcf !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.85;
}

.btn-green {
  background-color: var(--color-green);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--color-green-dark);
}
.btn-green:active {
  box-shadow: 0 0 0 var(--color-green-dark);
}

.btn-blue {
  background-color: var(--color-blue);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--color-blue-dark);
}
.btn-blue:active {
  box-shadow: 0 0 0 var(--color-blue-dark);
}

.btn-orange {
  background-color: var(--color-orange);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--color-orange-dark);
}
.btn-orange:active {
  box-shadow: 0 0 0 var(--color-orange-dark);
}

.btn-purple {
  background-color: var(--color-purple);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--color-purple-dark);
}
.btn-purple:active {
  box-shadow: 0 0 0 var(--color-purple-dark);
}

.btn-red {
  background-color: var(--color-red);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--color-red-dark);
}
.btn-red:active {
  box-shadow: 0 0 0 var(--color-red-dark);
}

.btn-white {
  background-color: #ffffff;
  color: var(--color-text-dark);
  border: 2px solid var(--color-gray-border);
  box-shadow: 0 4px 0 var(--color-gray-border);
}
.btn-white:active {
  box-shadow: 0 0 0 var(--color-gray-border);
}

/* Bovenbalk (Top Nav) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 2px solid var(--color-gray-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-green);
  letter-spacing: -0.5px;
}

.brand-badge {
  background: #ffeaa7;
  color: #d35400;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* Stats Pillen (Streaks, XP, Harten) */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 6px 12px;
  border-radius: 12px;
  background-color: var(--color-gray-light);
  border: 1px solid var(--color-gray-border);
}

.stat-streak { color: #ff9600; }
.stat-xp { color: #ffc800; }
.stat-gems { color: #1cb0f6; }
.stat-hearts { color: #ff4b4b; cursor: pointer; }

/* Navigatie Tabs onderaan of boven */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  padding: 10px 16px;
  border-bottom: 2px solid var(--color-gray-border);
}

.nav-tab-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  border-radius: 14px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.nav-tab-btn:hover {
  background-color: var(--color-gray-light);
}

.nav-tab-btn.active {
  background-color: #ddf4ff;
  color: var(--color-blue-dark);
  box-shadow: 0 3px 0 #b3e3fc;
}

/* Hoofdcontainer */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 80px 16px;
}

/* Unit Banner */
.unit-card {
  margin-bottom: 36px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.unit-header {
  padding: 20px 24px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unit-info h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.unit-info p {
  font-size: 0.95rem;
  opacity: 0.9;
  font-weight: 600;
}

.unit-icon {
  font-size: 2.8rem;
  background: rgba(255,255,255,0.2);
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Het slingerende Leerpad (Path of Nodes) */
.learning-path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 30px 0;
  position: relative;
}

.path-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.2s;
}

/* Slingerbeweging links/rechts zoals Duolingo */
.path-node-wrapper:nth-child(4n+1) { transform: translateX(0); }
.path-node-wrapper:nth-child(4n+2) { transform: translateX(-40px); }
.path-node-wrapper:nth-child(4n+3) { transform: translateX(0); }
.path-node-wrapper:nth-child(4n+4) { transform: translateX(40px); }

.node-btn {
  width: 80px;
  height: 76px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  transition: transform 0.1s;
}

.node-btn:active {
  transform: translateY(4px);
}

.node-unlocked {
  background-color: var(--color-green);
  box-shadow: 0 8px 0 var(--color-green-dark);
}
.node-unlocked:active {
  box-shadow: 0 2px 0 var(--color-green-dark);
}

.node-completed {
  background-color: var(--color-yellow);
  box-shadow: 0 8px 0 var(--color-yellow-dark);
}
.node-completed:active {
  box-shadow: 0 2px 0 var(--color-yellow-dark);
}

.node-locked {
  background-color: #e5e5e5;
  box-shadow: 0 8px 0 #afafaf;
  cursor: not-allowed;
  opacity: 0.8;
}

.node-label {
  margin-top: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  color: var(--color-text-dark);
  max-width: 140px;
}

.node-crown {
  position: absolute;
  top: -12px;
  right: -6px;
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Mascot Pip Animatie */
.pip-mascot {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
}

.pip-bounce {
  animation: pipBounce 2.5s infinite ease-in-out;
  transform-origin: bottom center;
}

@keyframes pipBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.pip-sing {
  animation: pipSing 1.8s infinite ease-in-out;
  transform-origin: center center;
}

@keyframes pipSing {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-4deg) scale(1.03); }
  75% { transform: rotate(4deg) scale(1.03); }
}

.pip-dance {
  animation: pipDance 0.8s infinite alternate ease-in-out;
}

@keyframes pipDance {
  0% { transform: translateY(0) rotate(-6deg); }
  100% { transform: translateY(-12px) rotate(6deg); }
}

/* Les Venster (Quiz Modal) */
.quiz-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.quiz-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #afafaf;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.progress-bar-container {
  flex: 1;
  height: 16px;
  background-color: #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-green);
  border-radius: 10px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-body {
  flex: 1;
  max-width: 650px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 140px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.quiz-prompt-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--color-text-dark);
}

/* Kaarten & Opties */
.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.option-card {
  background: #ffffff;
  border: 2px solid var(--color-gray-border);
  box-shadow: 0 4px 0 var(--color-gray-border);
  border-radius: 18px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.option-card:hover {
  background-color: #f7f9fa;
  border-color: #1cb0f6;
}

.option-card.selected {
  background-color: #ddf4ff;
  border-color: #1cb0f6;
  box-shadow: 0 4px 0 #1899d6;
}

.option-emoji {
  font-size: 3.2rem;
}

.option-label {
  font-size: 1.3rem;
  font-weight: 800;
}

.option-sublabel {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Audio Spreek Knop */
.speak-bubble-btn {
  background: var(--color-blue);
  color: white;
  border: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--color-blue-dark);
  transition: transform 0.1s;
}

.speak-bubble-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--color-blue-dark);
}

.speak-bubble-slow {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  background: #00cec9;
  box-shadow: 0 3px 0 #00b894;
}

/* Flashcard Intro Type */
.intro-flashcard {
  background: #ffffff;
  border: 3px solid var(--color-gray-border);
  box-shadow: 0 8px 0 var(--color-gray-border);
  border-radius: 24px;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.intro-emoji {
  font-size: 5rem;
  animation: floatEmoji 3s ease-in-out infinite;
}

@keyframes floatEmoji {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.intro-word {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-blue-dark);
}

.intro-phonetic {
  background: #f1f2f6;
  color: #747d8c;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
}

.intro-translation {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2ed573;
}

/* Zin Bouwer & Luister-Zinnen */
.sentence-prompt-card {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.sentence-prompt-content {
  flex: 1;
}

.sentence-prompt-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #3b82f6;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sentence-prompt-words {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Duolingo Stijl Stippellijntjes (Tik voor hint) */
.hint-word {
  border-bottom: 2px dashed #64748b;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  padding: 0 2px;
  border-radius: 4px;
}

.hint-word:hover, .hint-word:active {
  background-color: #dbeafe;
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

/* Hint Tooltip Bubble */
.hint-bubble {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: hintPop 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hint-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

@keyframes hintPop {
  0% { transform: translateX(-50%) scale(0.8); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.sentence-audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Zin Bouwer (Word Chips) */
.sentence-slots {
  min-height: 60px;
  border-bottom: 2px dashed #afafaf;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 24px;
}

.word-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.word-chip {
  background: #ffffff;
  border: 2px solid var(--color-gray-border);
  box-shadow: 0 4px 0 var(--color-gray-border);
  border-radius: 14px;
  padding: 12px 20px;
  font-weight: 800;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.1s;
}

.word-chip:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-gray-border);
}

.word-chip.used {
  background: #f1f2f6;
  color: #a4b0be;
  border-color: #dcdde1;
  box-shadow: none;
  cursor: default;
}

/* Paren Zoeken (Matching Pairs) */
.pairs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pair-card {
  padding: 18px 12px;
  border: 2px solid var(--color-gray-border);
  box-shadow: 0 4px 0 var(--color-gray-border);
  border-radius: 14px;
  font-weight: 800;
  font-size: 1.15rem;
  text-align: center;
  cursor: pointer;
  background: white;
  transition: all 0.1s;
}

.pair-card.matched {
  background: #d7ffb8;
  border-color: #58cc02;
  box-shadow: none;
  opacity: 0.6;
  cursor: default;
}

/* Onderste Feedback Balk (Duolingo Stijl) */
.quiz-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 2px solid var(--color-gray-border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1050;
  transition: background 0.2s;
}

.quiz-footer.state-correct {
  background-color: #d7ffb8;
  border-color: #a5f36e;
}

.quiz-footer.state-wrong {
  background-color: #ffdfe0;
  border-color: #ff9999;
}

.footer-feedback-message {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feedback-icon {
  font-size: 2.2rem;
}

.feedback-text h3 {
  font-size: 1.35rem;
  font-weight: 800;
}

.feedback-text p {
  font-size: 1rem;
  font-weight: 600;
}

.state-correct .feedback-text h3 { color: #58a700; }
.state-wrong .feedback-text h3 { color: #ea2b2b; }

/* Les Voltooid Scherm */
.completion-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
}

.completion-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--color-yellow-dark);
}

.completion-stats {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.completion-stat-card {
  background: #ffffff;
  border: 2px solid var(--color-gray-border);
  border-radius: 18px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.completion-stat-card .val {
  font-size: 1.8rem;
  font-weight: 800;
}

.completion-stat-card .lbl {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

/* Soundboard / Woordenbank */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.soundboard-card {
  background: #ffffff;
  border: 2px solid var(--color-gray-border);
  box-shadow: 0 4px 0 var(--color-gray-border);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.soundboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--color-blue);
  border-color: var(--color-blue);
}

.soundboard-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-blue);
}

.soundboard-emoji {
  font-size: 2.4rem;
}

.soundboard-en {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text-dark);
}

.soundboard-nl {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.soundboard-badge {
  font-size: 0.75rem;
  background: #eef2f5;
  color: #576574;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

/* Sticker Boek */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.sticker-item {
  background: #ffffff;
  border: 2px solid var(--color-gray-border);
  border-radius: 18px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
}

.sticker-item.unlocked {
  border-color: #ffd32a;
  box-shadow: 0 4px 12px rgba(255, 211, 42, 0.25);
  background: linear-gradient(180deg, #fffcf0 0%, #ffffff 100%);
}

.sticker-item.locked {
  opacity: 0.45;
  filter: grayscale(1);
}

.sticker-icon {
  font-size: 3.4rem;
}

.sticker-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.sticker-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2000;
}

/* Responsiveness voor telefoons en tablets */
@media (max-width: 600px) {
  .app-header {
    padding: 10px 14px;
  }
  .brand-title {
    font-size: 1.2rem;
  }
  .stat-pill {
    padding: 4px 8px;
    font-size: 0.9rem;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .node-btn {
    width: 68px;
    height: 64px;
    font-size: 1.6rem;
  }
}
