/* ==========================================================================
   assets/css/quiz.css
   ========================================================================== */

.quiz-engine-wrapper, .result-wrapper { padding: 3rem 0 5rem; }

.quiz-intro h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.75rem; }
.quiz-meta { display: flex; justify-content: center; align-items: center; gap: 1.5rem; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }

/* --- Premium App Container --- */
#quiz-app {
  margin-top: 3rem; position: relative;
  overflow: hidden; /* Contains progress bar */
  background: var(--bg-surface);
}

/* --- Glowing Progress Bar --- */
.quiz-progress-bar { width: 100%; height: 6px; background: var(--bg-input); position: relative; }
.progress-fill {
  height: 100%; background: var(--primary-gradient); width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
/* Progress Glow tip */
.progress-fill::after {
  content: ''; position: absolute; right: 0; top: 0; height: 100%; width: 20px;
  background: rgba(255,255,255,0.5); filter: blur(4px);
}

.quiz-inner-padding { padding: 2rem 1.5rem; }
#question-text { font-size: var(--text-2xl); line-height: 1.4; color: var(--text-main); margin-bottom: 2.5rem; }

/* --- Tactile Answers Grid --- */
.answers-grid { display: flex; flex-direction: column; gap: 1rem; }
.answer-btn {
  width: 100%; text-align: left; justify-content: flex-start; padding: 1.25rem 1.5rem;
  background: var(--bg-page); border: 2px solid var(--border-color); border-radius: var(--radius-md);
  color: var(--text-main); font-size: var(--text-lg); font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--primary); background: var(--bg-surface);
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}

/* Elite Feedback States */
.answer-btn.selected { background: rgba(99, 102, 241, 0.05); border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.answer-btn.correct { background: rgba(16, 185, 129, 0.05); border-color: var(--success); color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.answer-btn.wrong { background: rgba(239, 68, 68, 0.05); border-color: var(--error); color: var(--error); text-decoration: line-through; opacity: 0.7; }

/* --- JS Animations --- */
.slide-out-left { animation: slideOutLeft 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1); }
.slide-in-right { animation: slideInRight 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1); }

@keyframes slideOutLeft { to { transform: translateX(-40px); opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Results Page Premium Layout --- */
.result-card { padding: 4rem 2rem; text-align: center; }
.visual-score-container { width: 180px; height: 180px; margin: 2rem auto; position: relative; }

.circular-chart { display: block; margin: 0 auto; max-width: 100%; max-height: 250px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.circle-bg { fill: none; stroke: var(--bg-input); stroke-width: 2.5; }
.circle-progress { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dasharray 1.5s ease-out; }
.score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: var(--text-4xl); color: var(--text-main); font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; }

/* --- Review Accordion --- */
.review-accordion { margin-top: 3rem; }
.review-accordion summary {
  padding: 1.5rem 2rem; font-weight: 700; cursor: pointer; list-style: none;
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: var(--text-xl);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-surface); border-radius: var(--radius-md); border: 1px solid var(--border-color);
}
.review-accordion summary::-webkit-details-marker { display: none; }
.review-accordion summary::after { content: '▾'; color: var(--primary); font-size: 1.5rem; transition: transform 0.2s; }
.review-accordion[open] summary::after { transform: rotate(180deg); }
.review-content { padding: 1.5rem 2rem; border-top: 1px solid var(--border-color); text-align: left; background: var(--bg-surface); border-radius: 0 0 var(--radius-md) var(--radius-md); border: 1px solid var(--border-color); border-top: none; }
.review-item { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.review-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.review-q { font-weight: 700; margin-bottom: 0.5rem; color: var(--text-main); font-size: var(--text-lg); }
.review-a { display: flex; gap: 0.5rem; align-items: flex-start; font-size: var(--text-base); margin-top: 0.5rem; }
.review-a strong { min-width: 130px; color: var(--text-muted); }
.review-a span.correct { color: var(--success); font-weight: 600; }
.review-a span.wrong { color: var(--error); text-decoration: line-through; }

/* Desktop Overrides */
@media (min-width: 768px) {
  .quiz-inner-padding { padding: 4rem; }
  #question-text { font-size: var(--text-3xl); }
  .answers-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}