/* =====================================================
   DESIGN SYSTEM — TOKENS
===================================================== */
:root {
  /* Brand */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-text: #ffffff;

  /* Status */
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Surface */
  --bg: #fdfdfd;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --hover-bg: #f3f4f6;

  /* Text */
  --text: #111827;
  --text-secondary: #6b7280;

  /* Radius */
  --radius-sm: 0.6rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.2rem;
  --radius-xl: 1.6rem;

  /* Shadows */
  --shadow-sm: 0 4px 10px rgba(0,0,0,.05);
  --shadow-md: 0 12px 30px rgba(0,0,0,.08);
  --shadow-lg: 0 25px 60px rgba(0,0,0,.12);

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
}

/* =====================================================
   DARK / DIM THEMES
===================================================== */
body.dim {
  --bg: #111827;
  --card-bg: #1f2937;
  --border: #374151;
  --hover-bg: #2a3441;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
}

body.dark {
  --bg: #020617;
  --card-bg: #020617;
  --border: #1f2937;
  --hover-bg: #0b1220;
  --text: #f9fafb;
  --text-secondary: #9ca3af;
}

/* =====================================================
   RESET
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background .3s var(--ease), color .3s var(--ease);
}

/* =====================================================
   HEADER — APPLE NAV
===================================================== */
.quiz-header {
  position: sticky;
  top: 0;
  z-index: 50;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 1.2rem 1.4rem;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(16px);

  border-bottom: 1px solid var(--border);
}

body.dark .quiz-header,
body.dim .quiz-header {
  background: rgba(2,6,23,.75);
}

.quiz-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.quiz-meta {
  font-size: .8rem;
  color: var(--text-secondary);
}

.dot {
  margin: 0 .35rem;
}

.icon-button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
}

/* =====================================================
   LAYOUT
===================================================== */
.quiz-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem 8rem;
}

/* =====================================================
   TOP BAR
===================================================== */
.quiz-top-bar {
  margin-top: 1rem;
  text-align: right;
}

.quiz-timer {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* =====================================================
   PROGRESS BAR
===================================================== */
.quiz-progress {
  height: 8px;
  margin-top: .6rem;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  transition: width .35s var(--ease);
}

/* =====================================================
   QUIZ CARD
===================================================== */
.quiz-card {
  margin-top: 1.8rem;
  padding: 2rem 1.6rem;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  animation: fadeUp .45s var(--ease);
}

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

.quiz-question-meta {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: .8rem;
}

.quiz-question {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
}

/* =====================================================
   OPTIONS — DUOLINGO STYLE
===================================================== */
.quiz-options {
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--card-bg);

  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;

  transition:
    background .25s var(--ease),
    border-color .25s var(--ease),
    transform .15s var(--ease),
    box-shadow .2s var(--ease);
}

.option:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.option:active {
  transform: translateY(0);
}

.option.correct {
  background: rgba(34,197,94,.15);
  border-color: var(--success);
  color: var(--success);
}

.option.wrong {
  background: rgba(239,68,68,.15);
  border-color: var(--error);
  color: var(--error);
}

.option.correct,
.option.wrong {
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Emoji + text */
.option-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.option-text {
  font-size: 1.05rem;
}

/* =====================================================
   CTA — DUOLINGO BOTTOM BUTTON
===================================================== */
.quiz-cta-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 1.2rem;
  background: linear-gradient(
    to top,
    var(--bg) 45%,
    transparent
  );
}

.quiz-next-btn {
  width: 100%;
  padding: 1rem;

  border-radius: var(--radius-lg);
  border: none;

  background: var(--primary);
  color: var(--primary-text);

  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;

  box-shadow: 0 14px 30px rgba(37,99,235,.35);
  transition:
    background .25s var(--ease),
    transform .15s var(--ease),
    box-shadow .2s var(--ease);
}

.quiz-next-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.quiz-next-btn:active {
  transform: translateY(0);
}

.hidden {
  display: none;
}

/* =====================================================
   EMOJI FEEDBACK
===================================================== */
.emoji-feedback {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.6rem;
  pointer-events: none;
  opacity: 0;
}

.emoji-bounce {
  animation: emojiPop .9s var(--ease);
}

@keyframes emojiPop {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.85); }
  40%  { opacity: 1; transform: translate(-50%, -8px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1); }
}

/* =====================================================
   END / EMPTY STATES
===================================================== */
.end-card {
  text-align: center;
}

.end-card h2 {
  font-size: 1.9rem;
  font-weight: 700;
}

.end-card p {
  margin: .35rem 0;
  font-weight: 500;
}

.end-card .actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.end-card a,
.end-card button {
  padding: .7rem 1.3rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--hover-bg);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

/* =====================================================
   ACCESSIBILITY & MOTION SAFETY
===================================================== */
.option:focus-visible,
.quiz-next-btn:focus-visible {
  outline: 3px solid rgba(37,99,235,.6);
  outline-offset: 2px;
}




/* =====================================================
   CTA BUTTON (BOTTOM — DUOLINGO)
===================================================== */
button {
  width: 100%;
  padding: 1rem 1.25rem;

  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);

  background: var(--primary-color);
  color: var(--primary-text);
  border: none;
  cursor: pointer;

  box-shadow: 0 10px 25px rgba(37,99,235,0.35);

  transition:
    background 0.25s var(--ease-smooth),
    transform 0.15s var(--ease-smooth),
    box-shadow 0.2s var(--ease-smooth);
}

button:hover {
  
/* =====================================================
   CTA BUTTON (BOTTOM — DUOLINGO)
===================================================== */
button {
  width: 100%;
  padding: 1rem 1.25rem;

  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);

  background: var(--primary-color);
  color: var(--primary-text);
  border: none;
  cursor: pointer;

  box-shadow: 0 10px 25px rgba(37,99,235,0.35);

  transition:
    background 0.25s var(--ease-smooth),
    transform 0.15s var(--ease-smooth),
    box-shadow 0.2s var(--ease-smooth);
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37,99,235,0.25);
}

button.hidden {
  display: none;
}

  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37,99,235,0.25);
}

button.hidden {
  display: none;
}


@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
