/* ============================================
   QUIZ PAGE STYLES
   ============================================ */

/* ---- Quiz Hero ---- */
.quiz-hero {
  padding: 160px 0 60px;
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
/* Same hero glow language as the homepage: cyan + violet ellipses (static, no animation) */
.quiz-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 72% 25%, rgba(0,200,255,0.2), transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 75%, rgba(140,80,220,0.16), transparent 50%),
    radial-gradient(ellipse 40% 40% at 70% 70%, rgba(0,200,255,0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.quiz-hero .wrap {
  position: relative;
  z-index: 1;
}
.quiz-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--ink);
}
.quiz-hero h1 em {
  font-style: italic;
  color: var(--cyan-soft);
}
.quiz-hero .quiz-subtitle {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.quiz-hero .btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: var(--cyan);
  color: var(--ink-bg);
  padding: 14px 36px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font);
  box-shadow: 0 2px 10px rgba(34,184,207,0.15);
}
.quiz-hero .btn-start:hover {
  background: #2cc5d6;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,184,207,0.25);
}
.quiz-hero .btn-start:active {
  transform: translateY(0);
  box-shadow: 0 3px 12px rgba(34,184,207,0.18);
}
.quiz-hero .quiz-hint {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---- Quiz Container ---- */
.quiz-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  z-index: 1;
}

/* ---- Progress Bar ---- */
.quiz-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  margin-bottom: 40px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.quiz-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, #ef4444, #e8a530, #eab308, #3ddc84);
  background-size: 1000% 100%;
}
.quiz-progress-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 8px;
  text-align: right;
}

/* ---- Question Card ---- */
.quiz-question {
  display: none;
  animation: quizFadeIn 0.35s ease forwards;
}
.quiz-question.active {
  display: block;
}
.quiz-question.fade-out {
  animation: quizFadeOut 0.25s ease forwards;
}

@keyframes quizFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes quizFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-16px); }
}

.quiz-question h2 {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}
.quiz-question .q-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  margin-bottom: 6px;
  display: block;
}

/* ---- Answer Options ---- */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.quiz-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-family: var(--font);
  text-align: left;
  line-height: 1.5;
}
.quiz-option:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: rgba(34,184,207,0.4);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34,184,207,0.12);
}
.quiz-option:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.quiz-option.selected {
  background: var(--cyan-glow);
  border-color: var(--cyan);
  color: var(--ink);
}
/* Correct answer - always green */
.quiz-option.option-correct {
  background: rgba(61,220,132,0.12);
  border-color: #3ddc84;
  color: #3ddc84;
  cursor: default;
}
/* Wrong answer chosen by user - red */
.quiz-option.option-wrong {
  background: rgba(220,38,38,0.12);
  border-color: #dc2626;
  color: #dc2626;
  cursor: default;
}
.quiz-option:disabled {
  cursor: default;
  transform: none;
}

/* ---- Reveal Card (knowledge payload) ---- */
/* Neutral signal tint: the card itself carries no correct/incorrect state */
.reveal-card {
  margin-top: 20px;
  background: rgba(34,184,207,0.06);
  border: 1px solid rgba(34,184,207,0.28);
  border-radius: 10px;
  padding: 22px 26px;
  animation: quizFadeIn 0.35s ease forwards;
}
.reveal-truth {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 12px;
}
.reveal-truth:last-child {
  margin-bottom: 0;
}

/* ---- Chapter Chip (links the answer to the graded platform breakdown) ---- */
.reveal-chapter-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid rgba(34,184,207,0.35);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  text-decoration: none;
  transition: all 0.18s ease;
}
.reveal-chapter-chip:hover {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--ink-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34,184,207,0.25);
}
.reveal-chapter-chip:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ---- Next Button Row ---- */
.quiz-next-row {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}
.btn-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  background: var(--cyan);
  color: var(--ink-bg);
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font);
  box-shadow: 0 2px 10px rgba(34,184,207,0.15);
}
.btn-next:hover {
  background: #2cc5d6;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,184,207,0.25);
}
.btn-next:active {
  transform: translateY(0);
  box-shadow: 0 3px 12px rgba(34,184,207,0.18);
}
.btn-next svg {
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.btn-next:hover svg {
  transform: translateX(2px);
}

/* ---- Navigation Buttons (legacy - kept for CSS stability) ---- */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
}
.quiz-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.quiz-nav-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.quiz-nav-btn.hidden {
  visibility: hidden;
}

/* ---- Results Section ---- */
.quiz-results {
  display: none;
  text-align: center;
  animation: quizFadeIn 0.5s ease forwards;
  position: relative;
  overflow: hidden;
  padding: 72px 0 48px;
}
.quiz-results.active {
  display: block;
}
/* Score reveal gets the hero glow so results land like a hero moment */
.quiz-results::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,200,255,0.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 78% 72%, rgba(140,80,220,0.14), transparent 50%),
    radial-gradient(ellipse 45% 40% at 18% 60%, rgba(0,200,255,0.07), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.quiz-results > * {
  position: relative;
  z-index: 1;
}

/* Grade Badge */
.grade-badge {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  color: #fff;
  animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
}
.grade-badge::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid;
  border-color: inherit;
  opacity: 0.3;
  animation: badgeRing 1.2s ease-out forwards;
}

@keyframes badgePop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes badgeRing {
  0%   { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(1.3); opacity: 0; }
}

.grade-a  { background: #16a34a; border-color: #16a34a; }
.grade-b  { background: #2563eb; border-color: #2563eb; }
.grade-c  { background: #d97706; border-color: #d97706; }
.grade-d  { background: #ea580c; border-color: #ea580c; }
.grade-f  { background: #dc2626; border-color: #dc2626; }

.result-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.result-score {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
}
.result-message {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ---- Recommendations ---- */
.recs-heading {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.recs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 40px;
  text-align: left;
}
.rec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.rec-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.rec-card p {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ---- Result CTAs ---- */
.result-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.result-ctas .btn-primary,
.result-newsletter .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: var(--cyan);
  color: var(--ink-bg);
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  font-family: var(--font);
  box-shadow: 0 2px 10px rgba(34,184,207,0.15);
}
.result-ctas .btn-primary:hover,
.result-newsletter .btn-primary:hover {
  background: #2cc5d6;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,184,207,0.25);
}
.result-ctas .btn-primary:active,
.result-newsletter .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 12px rgba(34,184,207,0.18);
}
.result-ctas .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: rgba(255,255,255,0.03);
  color: var(--ink-soft);
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  font-family: var(--font);
}
.result-ctas .btn-secondary:hover {
  background: rgba(34,184,207,0.06);
  border-color: rgba(34,184,207,0.45);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,184,207,0.12);
}
.result-ctas .btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

.share-feedback {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 8px;
}
.share-feedback.visible {
  opacity: 1;
}

.restart-link {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
  background: none;
  border: none;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255,255,255,0.25);
}
.restart-link:hover {
  color: var(--cyan-soft);
  text-decoration-color: var(--cyan-soft);
}

/* ---- Keyboard Focus Visibility (a11y) ---- */
.btn-start:focus-visible,
.quiz-option:focus-visible,
.btn-next:focus-visible,
.reveal-chapter-chip:focus-visible,
.result-ctas .btn-primary:focus-visible,
.result-ctas .btn-secondary:focus-visible,
.result-newsletter .btn-primary:focus-visible,
.newsletter-email:focus-visible,
.restart-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---- Data Ticker Bar ---- */
.ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(8,9,14,0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  overflow: hidden;
}
.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 32px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
}
.ticker-item .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.6;
}

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
  .quiz-hero {
    height: 100dvh;
    min-height: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding-top: 53px;
    padding-bottom: 40px;
  }
  .quiz-hero .wrap {
    padding-top: 0;
    padding-bottom: 0;
  }
  .quiz-hero h1 {
    font-size: 1.8rem;
  }
  .grade-badge {
    width: 110px;
    height: 110px;
    font-size: 3rem;
  }
  .result-title {
    font-size: 1.4rem;
  }
  .result-ctas {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  /* Softer glow on small screens; sections keep overflow hidden so nothing bleeds sideways */
  .quiz-hero::before {
    background:
      radial-gradient(ellipse 90% 60% at 65% 20%, rgba(0,200,255,0.14), transparent 60%),
      radial-gradient(ellipse 70% 50% at 25% 80%, rgba(140,80,220,0.11), transparent 50%);
  }
  .quiz-results {
    padding: 56px 0 40px;
  }
  .quiz-results::before {
    background:
      radial-gradient(ellipse 90% 55% at 50% 0%, rgba(0,200,255,0.11), transparent 60%),
      radial-gradient(ellipse 70% 50% at 75% 75%, rgba(140,80,220,0.1), transparent 50%);
  }
}

@media (max-width: 480px) {
  .quiz-wrap {
    padding: 0 16px 80px;
  }
  .quiz-option {
    padding: 14px 16px;
    font-size: 0.9rem;
  }
}
