/* ============================================
   CUSTOM STYLES — MESIN CBT UTBK SNBT 2027
   v2.0 — Sistem Sekuensial Per-Subtes
   ============================================ */

/* ---------- Scrollbar Kustom ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ---------- Transisi Layar ---------- */
.screen {
  display: none;
  animation: fadeSlideIn 0.3s ease-out;
}
.screen.active {
  display: flex;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Timer Pulse (< 60 detik) ---------- */
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.timer-warning {
  color: #f59e0b !important;
  background-color: #fffbeb !important;
  border-color: #fcd34d !important;
}
.timer-critical {
  animation: timerPulse 0.8s ease-in-out infinite;
  color: #ef4444 !important;
  background-color: #fef2f2 !important;
  border-color: #fca5a5 !important;
}

/* ---------- Mobile Nav Drawer ---------- */
.nav-drawer-overlay {
  position: fixed; inset: 0; z-index: 50; display: none;
}
.nav-drawer-overlay.open { display: block; }
.nav-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  transition: opacity 0.3s ease;
}
.nav-drawer-panel {
  position: absolute; right: 0; top: 0;
  height: 100%; width: 320px; max-width: 85vw;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.nav-drawer-overlay.open .nav-drawer-panel {
  transform: translateX(0);
}

/* ---------- Opsi Jawaban ---------- */
.option-btn {
  transition: all 0.15s ease;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  text-align: left;
  width: 100%;
}
.option-btn:hover { border-color: #818cf8; background: #eef2ff; }
.option-btn.selected {
  border-color: #6366f1; background: #eef2ff;
  box-shadow: 0 0 0 1px #6366f1;
}
.option-btn .option-letter {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  background: #f1f5f9; color: #475569;
  transition: all 0.15s ease;
}
.option-btn.selected .option-letter {
  background: #6366f1; color: #fff;
}
.option-btn .option-text { flex: 1; padding-top: 4px; line-height: 1.5; }

/* ---------- Opsi Review (Benar/Salah) ---------- */
.option-correct { border-color: #22c55e !important; background: #f0fdf4 !important; }
.option-correct .option-letter { background: #22c55e !important; color: #fff !important; }
.option-wrong { border-color: #ef4444 !important; background: #fef2f2 !important; }
.option-wrong .option-letter { background: #ef4444 !important; color: #fff !important; }

/* ---------- Tombol Navigasi Soal ---------- */
.nav-num-btn {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.15s ease;
  border: 2px solid transparent; position: relative;
}
.nav-num-btn:hover { transform: scale(1.08); }
.nav-num-btn.unanswered { background: #f1f5f9; color: #64748b; }
.nav-num-btn.answered { background: #22c55e; color: #fff; }
.nav-num-btn.flagged { background: #f59e0b; color: #fff; }
.nav-num-btn.current { border-color: #6366f1; box-shadow: 0 0 0 2px #c7d2fe; }

/* ---------- Progress bar ---------- */
.progress-bar {
  height: 8px; border-radius: 999px;
  background: #e2e8f0; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- Subtes Step Indicator ---------- */
.step-indicator {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.step-indicator::-webkit-scrollbar { display: none; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
  transition: all 0.2s ease;
}
.step-dot.completed { background: #22c55e; color: #fff; }
.step-dot.active { background: #6366f1; color: #fff; box-shadow: 0 0 0 3px #c7d2fe; }
.step-dot.pending { background: #e2e8f0; color: #94a3b8; }
.step-line {
  width: 24px; height: 3px; flex-shrink: 0;
  border-radius: 999px; transition: background 0.2s ease;
}
.step-line.done { background: #22c55e; }
.step-line.upcoming { background: #e2e8f0; }

/* ---------- Gambar Soal ---------- */
.question-image-container {
  margin: 12px 0 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
.question-image-container img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  margin: 0 auto;
  object-fit: contain;
}

/* ---------- Card pembahasan ---------- */
.review-card {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.review-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.06); }

/* ---------- Callout boxes ---------- */
.callout-trick {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left: 4px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
}
.callout-explain {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left: 4px solid #3b82f6;
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
}

/* ---------- Stat card ---------- */
.stat-card {
  border-radius: 14px; padding: 20px;
  text-align: center; border: 1px solid #e2e8f0;
}

/* ---------- Skor Donut ---------- */
.score-ring { transform: rotate(-90deg); }
.score-ring-bg { stroke: #e2e8f0; }
.score-ring-fill {
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 20px; padding: 32px;
  max-width: 480px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalPop 0.25s ease-out;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Subtes Intro Card ---------- */
.subtes-intro-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  overflow: hidden;
  max-width: 520px;
  width: 100%;
}
.subtes-intro-header {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  padding: 40px 32px;
  text-align: center;
  color: #fff;
}
@keyframes countPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.count-animate { animation: countPop 0.4s ease-out; }

/* ---------- IRT Score Bar ---------- */
.irt-score-bar {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}
.irt-score-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease-out;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}
.irt-score-marker {
  position: absolute; top: -6px;
  width: 2px; height: 24px;
  background: #1e1b4b;
  border-radius: 1px;
}

/* ---------- Print ---------- */
@media print {
  .no-print { display: none !important; }
  body { font-size: 12pt; }
  .review-card { break-inside: avoid; page-break-inside: avoid; }
}
