/**
 * mcq-runner.css — Light theme for MCQ start screen + exam runner.
 *
 * ROOT CAUSE of "raw HTML" look: exam.css never defined .mcq-start-* rules,
 * and the runner shell used a dark palette (#0d1117) that fights the platform
 * light-theme standard. This file is loaded AFTER exam.css and overrides MCQ-
 * specific surfaces to a professional light SaaS look without rewriting coding
 * runner dark chrome shared in exam.css.
 */

/* ── Body / root shell ───────────────────────────────────────── */
body:has(#runner-root) {
  margin: 0;
  background: #f5f3ff;
  color: #1e1b4b;
  font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
}

#runner-root {
  min-height: 100dvh;
  background: #f5f3ff;
  font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
}

/* ── Loading / error shells (replace dark inline defaults) ─── */
.mcq-boot-shell,
.mcq-finish-shell,
.mcq-error-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: #f5f3ff;
  color: #1e1b4b;
  font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif;
  direction: rtl;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}
.mcq-boot-shell .exam-spinner {
  border-color: #e9d5ff;
  border-top-color: #7c3aed;
}
.mcq-error-shell { color: #dc2626; }
.mcq-error-shell a { color: #7c3aed; }

/* ══════════════════════════════════════════════════════════════
   START SCREEN — was completely unstyled (no .mcq-start-* rules)
   ══════════════════════════════════════════════════════════════ */
.mcq-start-overlay {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.12), transparent 55%),
    #f5f3ff;
  direction: rtl;
  box-sizing: border-box;
}

.mcq-start-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: #5b21b6;
  font-weight: 800;
  font-size: 0.95rem;
}
.mcq-start-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}
.mcq-start-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.mcq-start-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid #e9d5ff;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(91, 33, 182, 0.08);
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
}

.mcq-start-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.mcq-start-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 900;
  color: #1e1b4b;
  line-height: 1.45;
}

.mcq-start-subtitle {
  margin: 0 0 1.15rem;
  font-size: 0.85rem;
  color: #64748b;
}

.mcq-start-student {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.mcq-start-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c4b5fd;
}
.mcq-start-avatar-fb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ede9fe;
  color: #5b21b6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.mcq-start-student-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e1b4b;
}

.mcq-start-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.mcq-start-meta-item {
  background: #faf8ff;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mcq-start-meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7c3aed;
}
.mcq-start-meta-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e1b4b;
}

.mcq-start-proctor-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 auto 1rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #bbf7d0;
}

.mcq-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.mcq-start-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.35);
}
.mcq-start-btn:active { transform: scale(0.98); }
.mcq-start-btn:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.35);
  outline-offset: 2px;
}

.mcq-start-hint {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.65;
  color: #64748b;
}

.mcq-start-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #64748b;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.mcq-start-back:hover {
  background: #f8fafc;
  border-color: #c4b5fd;
  color: #5b21b6;
}

@media (max-width: 480px) {
  .mcq-start-card { padding: 1.35rem 1.1rem 1.2rem; border-radius: 14px; }
  .mcq-start-title { font-size: 1.1rem; }
  .mcq-start-meta { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   EXAM RUNNER — light overrides (scoped via .mcq-light)
   ══════════════════════════════════════════════════════════════ */
.mcq-light.exam-runner-container,
.exam-runner-container.mcq-light {
  background: #f5f3ff !important;
  color: #1e1b4b !important;
}

.mcq-light .exam-header-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e9d5ff !important;
  box-shadow: 0 1px 0 rgba(91, 33, 182, 0.04);
}
.mcq-light .exam-header-webcam {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}
.mcq-light .exam-header-title { color: #1e1b4b !important; }
.mcq-light .exam-info-type {
  background: #ede9fe !important;
  color: #5b21b6 !important;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
}
.mcq-light .exam-info-label { color: #64748b !important; font-size: 0.75rem; }
.mcq-light .exam-student-name { color: #1e1b4b !important; font-weight: 700; }

.mcq-light .proctor-live-badge {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.mcq-light .exam-timer {
  color: #5b21b6 !important;
  background: #ede9fe !important;
  border-color: #c4b5fd !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.mcq-light .exam-timer.warning {
  color: #b45309 !important;
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
}
.mcq-light .exam-timer.danger {
  color: #b91c1c !important;
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}
.mcq-light .timer-ring-bg { stroke: #e9d5ff !important; }
.mcq-light .timer-ring-fill { stroke: #7c3aed !important; }

.mcq-light .exam-bottom-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e9d5ff !important;
  border-top: none;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mcq-light .exam-nav-btn {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #334155 !important;
  border-radius: 10px !important;
  min-width: 2.25rem;
  min-height: 2.25rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.mcq-light .exam-nav-btn:hover:not(:disabled) {
  border-color: #c4b5fd !important;
  background: #faf5ff !important;
  color: #5b21b6 !important;
}
.mcq-light .exam-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mcq-light .exam-nav-btn.current {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}
.mcq-light .exam-nav-btn.answered:not(.current) {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}
.mcq-light .exam-nav-btn.flagged:not(.current) {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
}
.mcq-light .exam-btn-flag {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}
.mcq-light .exam-btn-flag.flagged {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
}
.mcq-light .exam-btn-end {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  border-color: #b91c1c !important;
  color: #fff !important;
  font-weight: 800 !important;
}

.mcq-light .exam-question-box {
  background: #ffffff !important;
  border-bottom: 1px solid #e9d5ff !important;
  color: #1e1b4b !important;
}
.mcq-light .exam-question-box-header { color: #64748b !important; }
.mcq-light .exam-question-counter {
  color: #5b21b6 !important;
  font-weight: 800;
}
.mcq-light #questionHTML {
  color: #1e293b !important;
  font-size: 1.02rem !important;
  line-height: 1.75 !important;
}
.mcq-light #questionHTML p,
.mcq-light #questionHTML li { color: inherit; }
.mcq-light #saveStatus { color: #94a3b8 !important; }

.mcq-light .exam-zoom-btn {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  border-radius: 8px;
  cursor: pointer;
}
.mcq-light .exam-zoom-btn:hover {
  border-color: #c4b5fd !important;
  color: #5b21b6 !important;
}

.mcq-light .mcq-splitter {
  background: #e9d5ff !important;
}
.mcq-light .mcq-splitter:hover { background: #c4b5fd !important; }
.mcq-light .mcq-splitter::after { background: #a78bfa !important; }

.mcq-light .mcq-options-panel {
  background: #f5f3ff !important;
  gap: 0.6rem;
  padding: 0.85rem 1rem 1.1rem;
}

.mcq-light .mcq-option-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  color: #1e293b !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 0.85rem 1rem !important;
}
.mcq-light .mcq-option-card:hover {
  border-color: #c4b5fd !important;
  background: #faf5ff !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}
.mcq-light .mcq-option-card:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.3);
  outline-offset: 1px;
}
.mcq-light .mcq-option-card.selected {
  border: 2px solid #7c3aed !important;
  background: #f5f3ff !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
  color: #1e1b4b !important;
}
.mcq-light .mcq-option-badge {
  background: #f1f5f9 !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #64748b !important;
}
.mcq-light .mcq-option-card.selected .mcq-option-badge {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #fff !important;
}
.mcq-light .mcq-option-text { color: inherit !important; }

/* Zoom / confirm / violation light cards */
.mcq-light .zoom-modal-overlay,
.mcq-light .modal-overlay,
.mcq-light .violation-overlay,
.mcq-light .time-expired-overlay {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(3px);
}
.mcq-light .zoom-modal-card,
.mcq-light .modal-card,
.mcq-light .time-expired-card {
  background: #ffffff !important;
  color: #1e1b4b !important;
  border: 1px solid #e9d5ff !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15) !important;
}
.mcq-light .zoom-modal-body,
.mcq-light .zoom-modal-body * {
  color: #1e293b !important;
}

/* Sticky bottom nav on small screens */
@media (max-width: 768px) {
  .mcq-light .exam-bottom-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.45rem 0.65rem !important;
  }
  .mcq-light .exam-nav-btn {
    min-width: 2.1rem;
    min-height: 2.1rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .mcq-light .exam-question-box {
    max-height: 32dvh !important;
  }
  .mcq-light .mcq-option-card {
    padding: 0.75rem 0.85rem !important;
  }
}

@media print {
  .mcq-start-overlay,
  .mcq-light .exam-bottom-bar,
  .mcq-light .exam-header-webcam,
  .mcq-light .exam-zoom-btn { display: none !important; }
}
