/* ======================================================================
   CBT SMK PRO - Mobile First, Exambro & Print Optimized CSS
   ====================================================================== */

:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg-app: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --font-base: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: var(--font-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Font Sizing Controls */
body.font-sm { --font-base: 14px; }
body.font-md { --font-base: 16px; }
body.font-lg { --font-base: 19px; }

/* Option Cards for Question Options */
.option-item {
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}
.option-item:active {
  transform: scale(0.99);
}

/* Navigasi Nomor Soal Grid Items */
.q-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}
.q-btn.unanswered {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.q-btn.answered {
  background-color: #16a34a;
  color: #ffffff;
}
.q-btn.doubt {
  background-color: #f59e0b;
  color: #ffffff;
}
.q-btn.active {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}

/* Floating Drawer Backdrop */
.drawer-backdrop {
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

/* Pulse animation for low timer */
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.timer-warning {
  color: #dc2626 !important;
  animation: timerPulse 1s infinite;
}

/* ======================================================================
   PRINT STYLES (@media print) - Untuk Kartu Ujian, Absensi, & Berita Acara
   ====================================================================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }

  header, nav, footer, .no-print, button, .admin-tab-btn {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .page-break {
    page-break-after: always;
    break-after: page;
  }

  /* Grid Kartu Peserta (8 Kartu per Lembar A4) */
  .kartu-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 0 !important;
  }

  .kartu-card {
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    page-break-inside: avoid;
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Tabel Resmi Cetak (Daftar Hadir & Berita Acara) */
  .table-official {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
  }
  .table-official th, .table-official td {
    border: 1px solid #000000 !important;
    padding: 6px 8px !important;
    font-size: 10pt !important;
  }
  .table-official th {
    background-color: #f1f5f9 !important;
    font-weight: bold !important;
  }
}
