/* =============================================
   ONLINE DISPATCHER COURSE — QUIZ STYLESHEET
   ============================================= */

.quiz-page { background: var(--bg-light); }

/* ===== QUIZ HERO ===== */
.quiz-hero {
  background: linear-gradient(135deg, #0f2540 0%, #1a3a5c 50%, #1e4976 100%);
  padding: 120px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.quiz-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

.quiz-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: var(--transition);
}
.back-link:hover { color: var(--accent); }

.quiz-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 30px rgba(245,158,11,0.3);
}
.quiz-hero-icon i { font-size: 2.2rem; color: var(--white); }

.quiz-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 16px;
}
.quiz-hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin-bottom: 28px;
}

.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.quiz-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
}
.quiz-meta i { color: var(--accent); }

/* ===== QUIZ MAIN ===== */
.quiz-main {
  padding: 48px 0 80px;
}

.hidden { display: none !important; }

/* ===== START SCREEN ===== */
.quiz-start-screen {
  max-width: 800px;
  margin: 0 auto;
}

.start-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.start-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}
.start-card > p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.start-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.start-module-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid #fde68a;
}

.start-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}
.rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
}
.rule-item i { color: var(--primary); font-size: 0.9rem; }

.btn-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 18px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(26,58,92,0.3);
}
.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(26,58,92,0.4);
}

/* ===== QUIZ INTERFACE ===== */
.quiz-interface {
  max-width: 800px;
  margin: 0 auto;
}

/* Progress */
.quiz-progress-bar {
  margin-bottom: 28px;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.progress-info span:first-child {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.module-tag-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 3px 12px;
  border-radius: 50px;
}
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 50px;
  transition: width 0.4s ease;
}

.progress-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}
.dot.answered { background: var(--success); }
.dot.current { background: var(--primary); transform: scale(1.3); }
.dot.wrong { background: var(--danger); }

/* Question Card */
.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px 44px 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-module {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 4px 14px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 14px;
}
.question-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 32px;
}

/* Options */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: inherit;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f0f7ff;
}
.option-letter {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.option-text {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

/* Selected state */
.option-btn.selected {
  border-color: var(--primary);
  background: #eef7ff;
}
.option-btn.selected .option-letter {
  background: var(--primary);
  color: var(--white);
}

/* Correct/Wrong states */
.option-btn.correct {
  border-color: var(--success);
  background: #f0fdf4;
}
.option-btn.correct .option-letter {
  background: var(--success);
  color: var(--white);
}
.option-btn.wrong {
  border-color: var(--danger);
  background: #fef2f2;
}
.option-btn.wrong .option-letter {
  background: var(--danger);
  color: var(--white);
}
.option-btn:disabled { cursor: not-allowed; }

/* Explanation */
.explanation-box {
  background: var(--bg-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding: 16px 18px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.explanation-box .exp-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 6px;
}
.explanation-box p {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}

/* Navigation */
.question-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.btn-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-nav:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-nav:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-next:hover:not(:disabled) { background: var(--primary-dark); transform: translateX(2px); }
.btn-next:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-next.btn-finish { background: var(--success); }
.btn-next.btn-finish:hover { background: #059669; }

/* ===== RESULTS ===== */
.quiz-results { max-width: 800px; margin: 0 auto; }

.results-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.results-header {
  padding: 48px 40px 32px;
  text-align: center;
  background: linear-gradient(135deg, #0f2540, #1a3a5c);
}
.results-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.results-icon.pass { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.results-icon.fail { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.results-header h2 { font-size: 2rem; font-weight: 800; color: var(--white); margin-bottom: 8px; }
.results-header p { font-size: 1rem; color: rgba(255,255,255,0.75); }

.results-score-wrap { padding: 36px 40px; border-bottom: 1px solid var(--border); }
.results-score {
  display: flex;
  align-items: center;
  gap: 40px;
  justify-content: center;
}
.score-circle {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}
.score-circle svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#scoreArc { stroke: var(--success); transition: stroke-dashoffset 1.5s ease; }
#scoreArc.fail-arc { stroke: var(--accent); }
.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-center span:first-child { font-size: 2rem; font-weight: 900; color: var(--primary); }
.score-center span:last-child { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

.score-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.score-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}
.score-stat i { font-size: 1.3rem; }
.score-stat span { font-size: 1.5rem; font-weight: 800; color: var(--primary); min-width: 40px; }
.score-stat small { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* Module Performance */
.module-performance {
  padding: 32px 40px;
  border-bottom: 1px solid var(--border);
}
.module-performance h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.module-performance h3 i { color: var(--secondary); }
#modulePerformanceGrid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.perf-item {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  align-items: center;
  gap: 14px;
}
.perf-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.perf-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.perf-bar-fill {
  height: 100%;
  border-radius: 50px;
  background: var(--success);
  transition: width 0.8s ease;
}
.perf-bar-fill.partial { background: var(--accent); }
.perf-bar-fill.poor { background: var(--danger); }
.perf-score { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-align: right; }

/* Certificate */
.certificate-section {
  padding: 32px 40px;
  border-bottom: 1px solid var(--border);
}
.certificate-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}
.certificate {
  border: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  background: linear-gradient(135deg, #fffbeb, #ffffff);
  position: relative;
  overflow: hidden;
}
.certificate::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  opacity: 0.3;
  pointer-events: none;
}
.cert-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cert-header i { font-size: 1.5rem; color: var(--accent-dark); }
.cert-header span { font-size: 1rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }
.cert-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 24px;
  font-family: 'Inter', serif;
}
.cert-body { margin-bottom: 24px; }
.cert-body p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.cert-name {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 4px;
  margin: 8px 0 16px;
}
.cert-course {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}
.cert-score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--success);
  margin-top: 10px;
}
.cert-date { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.cert-footer {
  border-top: 1px solid #fde68a;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.cert-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-seal i { font-size: 1.3rem; color: var(--white); }
.cert-footer p { font-size: 0.75rem; color: var(--text-muted); }

/* Review */
.review-section {
  padding: 32px 40px;
  border-bottom: 1px solid var(--border);
}
.review-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.review-section h3 i { color: var(--secondary); }
.review-item {
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.review-item.review-correct { background: #f0fdf4; border-color: #86efac; }
.review-item.review-wrong { background: #fef2f2; border-color: #fca5a5; }
.review-q {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
}
.review-q .review-icon { flex-shrink: 0; }
.review-a { font-size: 0.8rem; color: var(--text-muted); }
.review-a strong { color: var(--text); }
.review-exp { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* Results Actions */
.results-actions {
  padding: 32px 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-retake {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-retake:hover { border-color: var(--primary); background: var(--white); }

.btn-enroll-quiz {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 50px;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.btn-enroll-quiz:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .start-card { padding: 28px 24px; }
  .start-rules { grid-template-columns: 1fr; }
  .question-card { padding: 28px 24px 24px; }
  .results-score { flex-direction: column; }
  .results-header { padding: 36px 24px 28px; }
  .results-score-wrap, .module-performance, .certificate-section, .review-section, .results-actions {
    padding: 24px;
  }
  .perf-item { grid-template-columns: 120px 1fr 50px; }
  .results-actions { flex-direction: column; }
  .btn-retake, .btn-enroll-quiz { justify-content: center; }
}
