/* ===== Quiz Page Specific Styles ===== */
/* This file provides quiz-specific styling overrides for quiz.html */
/* Complements style.css with additional quiz-page-specific classes */

/* Back Link Navigation */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 0;
  margin-bottom: 12px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Quiz Header: Category/Module + Progress */
.quiz-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 97, 243, 0.08);
  border: 1px solid rgba(47, 97, 243, 0.18);
  color: #244bd3;
  font-weight: 600;
}

/* Progress Bar */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #2f61f3;
  transition: width 0.25s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 90px;
  text-align: right;
}

/* Question Text */
.question-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 14px 0 14px 0;
}

/* Options Form Container */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

/* ===== Option (.opt) Styling ===== */
.opt {
  position: relative;
  cursor: pointer;
}

.opt input[type="radio"],
.opt input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.opt label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid var(--border, #e0e0e0);
  border-radius: 10px;
  background: #fff;
  transition: all 0.2s ease;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
}

/* Letter badge */
.opt .k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  margin-right: 12px;
  background: #2f61f3;
  color: white;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* Answer text */
.opt .ans {
  flex: 1;
}

/* ===== PHASE 1 & 2: Before Submit ===== */

/* Hover effect - light green (only before submit) */
.options:not(.submitted) .opt label:hover {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.12);
  transform: translateX(4px);
}

/* Selected state - darker green (only before submit) */
.options:not(.submitted) .opt input:checked + label {
  background: rgba(76, 175, 80, 0.25);
  border-color: #4caf50;
}

/* Single-select: Disable hover on OTHER options after selection */
.options.has-selection:not(.is-multi-select):not(.submitted) .opt input:not(:checked) + label:hover {
  border-color: var(--border, #e0e0e0);
  background: #fff;
  transform: none;
}

/* Single-select: Keep selected styling, no hover transform */
.options.has-selection:not(.is-multi-select):not(.submitted) .opt input:checked + label:hover {
  transform: none;
}

/* Multi-select: Keep hover on unselected options even after selection */
.options.is-multi-select.has-selection:not(.submitted) .opt input:not(:checked) + label:hover {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.12);
  transform: translateX(4px);
}

/* ===== PHASE 3: After Submit ===== */

/* Remove ALL highlighting after submit - neutral white background */
.options.submitted .opt label {
  background: #fff !important;
  border-color: var(--border, #e0e0e0) !important;
  cursor: default;
  transform: none !important;
}

/* Disable hover after submit */
.options.submitted .opt label:hover {
  background: #fff !important;
  border-color: var(--border, #e0e0e0) !important;
  transform: none !important;
}

/* ===== Result Icons (Checkmarks and X marks) ===== */

/* Container for result icon - appears before the letter badge */
.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-right: 8px;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Green checkmark for correct answers */
.result-icon.correct {
  color: #4caf50;
}

/* Red X for wrong selections */
.result-icon.wrong {
  color: #f44336;
}

/* Submit/Next Button - Target .btn.primary from base styles */
.btn.primary {
  display: block;
  width: 100%;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 800;
}

/* Feedback (Correct/Incorrect) - Small pill, left-aligned */
.feedback {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  border: 1px solid transparent;
}

.feedback.ok {
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.35);
  color: #2e7d32;
}

.feedback.bad {
  background: rgba(244, 67, 54, 0.12);
  border-color: rgba(244, 67, 54, 0.35);
  color: #b71c1c;
}

.hidden {
  display: none !important;
}

/* Correct Answer Line + Rationale */
#answerLine {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(47, 97, 243, 0.08);
  border: 1px solid rgba(47, 97, 243, 0.20);
  color: #1e3fb3;
  font-size: 14px;
  line-height: 1.4;
}

#rationale {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Summary page tweaks */
#summaryBody p {
  margin: 6px 0;
}

#summaryBody strong {
  color: var(--text);
}
