/* ============================================================
   SISTEM UJIAN ONLINE - GLOBAL STYLESHEET
   Theme: Modern Blue - Islamic Educational
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Primary Blue Palette */
  --blue-950: #0a1628;
  --blue-900: #0f2448;
  --blue-800: #1a3a6e;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-300: #93c5fd;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  /* Gold Accent */
  --gold-600: #b45309;
  --gold-500: #d97706;
  --gold-400: #f59e0b;
  --gold-300: #fcd34d;
  --gold-100: #fef3c7;

  /* Neutrals */
  --gray-950: #0a0a0f;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* Semantic Colors */
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;

  /* Typography */
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-arabic: 'Amiri', serif;

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
  --shadow-blue: 0 4px 20px rgba(37,99,235,0.25);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--blue-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
  box-shadow: var(--shadow-blue);
}

.sidebar-logo .logo-text {
  font-size: 13px; font-weight: 700;
  color: var(--white); letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-logo .logo-sub {
  font-size: 11px; color: var(--blue-300);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--blue-400); opacity: 0.7;
  padding: 8px 8px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.nav-item.active {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.nav-item .nav-icon {
  width: 20px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--gold-400);
  color: var(--gray-900);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Main Content */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.top-bar-title {
  font-size: 17px; font-weight: 700;
  color: var(--gray-900);
  flex: 1;
}

.page-content {
  flex: 1;
  padding: 28px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--gray-900);
}

.card-body { padding: 24px; }

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.stat-icon.blue  { background: var(--blue-100); }
.stat-icon.gold  { background: var(--gold-100); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.red   { background: var(--danger-light); }

.stat-value {
  font-size: 26px; font-weight: 800;
  color: var(--gray-900); line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px; color: var(--gray-500); font-weight: 500;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.btn-primary:hover { background: var(--blue-700); transform: translateY(-1px); box-shadow: var(--shadow-blue); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { filter: brightness(0.92); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { filter: brightness(0.92); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--gray-900);
}
.btn-gold:hover { filter: brightness(0.95); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--blue-600);
  color: var(--blue-600);
}
.btn-outline:hover { background: var(--blue-50); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-xl { padding: 16px 36px; font-size: 17px; font-weight: 700; border-radius: var(--radius-lg); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* Icon buttons */
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--gray-700); margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 3px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px; color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-control:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
}

select.form-control { cursor: pointer; }

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 12px; color: var(--gray-500);
  margin-top: 5px;
}

.form-error {
  font-size: 12px; color: var(--danger);
  margin-top: 5px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 12px 16px;
  background: var(--gray-50);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--blue-50); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-blue   { background: var(--blue-100);   color: var(--blue-700); }
.badge-green  { background: var(--success-light); color: var(--success); }
.badge-red    { background: var(--danger-light);  color: var(--danger); }
.badge-gold   { background: var(--gold-100);   color: var(--gold-600); }
.badge-gray   { background: var(--gray-100);   color: var(--gray-600); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  opacity: 1; pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 12px;
}

.modal-title {
  font-size: 16px; font-weight: 700;
  color: var(--gray-900); flex: 1;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); font-size: 18px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex; align-items: center;
  justify-content: flex-end; gap: 12px;
}

/* ============================================================
   ALERTS & TOASTS
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: var(--info-light);    color: var(--info); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-danger  { background: var(--danger-light);  color: var(--danger); }

/* Toast Container */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
  animation: toastIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--gray-900); }

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

/* ============================================================
   LOADING STATES
   ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner-blue {
  border-color: var(--blue-200);
  border-top-color: var(--blue-600);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-blue   { color: var(--blue-600); }
.text-gray   { color: var(--gray-500); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-gold   { color: var(--gold-500); }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.hidden { display: none !important; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.login-left {
  background: linear-gradient(145deg, var(--blue-900) 0%, var(--blue-800) 50%, var(--blue-700) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
  position: relative; overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.3), transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(245,158,11,0.15), transparent 70%);
  bottom: -80px; left: -60px;
  border-radius: 50%;
}

.login-brand {
  text-align: center; position: relative; z-index: 1;
}

.login-brand-icon {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin: 0 auto 24px;
  backdrop-filter: blur(8px);
}

.login-brand h1 {
  font-size: 28px; font-weight: 800;
  color: var(--white); letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.login-brand p {
  color: var(--blue-200); font-size: 14px;
  max-width: 320px; line-height: 1.7;
}

.login-features {
  margin-top: 40px; position: relative; z-index: 1;
  width: 100%;
}

.login-feature-item {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 14px 18px; margin-bottom: 10px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  backdrop-filter: blur(4px);
}

.login-feature-item .feat-icon {
  font-size: 20px; width: 32px;
  text-align: center;
}

.login-right {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 48px;
  background: var(--white);
}

.login-form-box {
  width: 100%; max-width: 400px;
}

.login-form-box h2 {
  font-size: 26px; font-weight: 800;
  color: var(--gray-900); margin-bottom: 6px;
}

.login-form-box p {
  color: var(--gray-500); font-size: 14px;
  margin-bottom: 32px;
}

/* ============================================================
   EXAM PAGE (FULLSCREEN MODE)
   ============================================================ */
.exam-wrapper {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--gray-50);
  user-select: none;
}

.exam-topbar {
  background: var(--blue-900);
  color: var(--white);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center;
  gap: 16px; position: sticky; top: 0; z-index: 50;
}

.exam-topbar-title {
  flex: 1;
  font-size: 15px; font-weight: 700;
}

.exam-timer {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 20px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 100px; text-align: center;
}

.exam-timer.warning { background: rgba(245,158,11,0.2); border-color: var(--gold-400); color: var(--gold-300); }
.exam-timer.danger  { background: rgba(220,38,38,0.2);  border-color: var(--danger); color: #fca5a5; animation: pulse 1s infinite; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.exam-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
}

.exam-question-area {
  padding: 28px;
  overflow-y: auto;
}

.exam-question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.question-number {
  display: inline-flex; align-items: center;
  background: var(--blue-100); color: var(--blue-700);
  border-radius: var(--radius-full);
  padding: 4px 14px; font-size: 12px; font-weight: 700;
  margin-bottom: 16px;
}

.question-text {
  font-size: 16px; font-weight: 500;
  color: var(--gray-900); line-height: 1.7;
  margin-bottom: 24px;
}

.option-list { display: flex; flex-direction: column; gap: 10px; }

.option-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}

.option-item:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}

.option-item.selected {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.option-item.selected .option-letter {
  background: var(--blue-600);
  color: var(--white);
}

.option-letter {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--gray-100); color: var(--gray-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0; transition: all var(--transition);
}

.option-text {
  font-size: 14px; color: var(--gray-800);
  line-height: 1.5; padding-top: 4px;
}

/* Question Navigation Panel */
.exam-nav-panel {
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  padding: 20px;
  overflow-y: auto;
}

.exam-nav-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--gray-500); margin-bottom: 14px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

.q-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
  background: var(--white);
  transition: all var(--transition);
  cursor: pointer;
}

.q-btn:hover { border-color: var(--blue-400); color: var(--blue-700); }
.q-btn.answered { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); }
.q-btn.current  { border-color: var(--blue-600); color: var(--blue-700); box-shadow: 0 0 0 2px var(--blue-200); }
.q-btn.flagged  { background: var(--gold-100); border-color: var(--gold-400); color: var(--gold-600); }

.nav-legend { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gray-600); }
.legend-dot  { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

/* Exam Question Navigation */
.exam-nav-btns {
  display: flex; gap: 10px;
  margin-top: 24px;
  border-top: 1px solid var(--gray-100);
  padding-top: 20px;
}

/* ============================================================
   ANTI-CHEAT OVERLAY
   ============================================================ */
.cheat-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9998;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--white); text-align: center;
  padding: 40px;
}

.cheat-overlay h2 {
  font-size: 24px; font-weight: 800;
  color: #fca5a5; margin-bottom: 12px;
}

.cheat-overlay p {
  color: rgba(255,255,255,0.7);
  max-width: 400px; line-height: 1.7;
  margin-bottom: 24px;
}

/* ============================================================
   POPUP ATURAN UJIAN
   ============================================================ */
.exam-rules-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.exam-rules-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  overflow: hidden;
}

.exam-rules-header {
  background: var(--blue-900);
  padding: 24px;
  text-align: center;
  color: var(--white);
}

.exam-rules-header h2 {
  font-size: 20px; font-weight: 800; margin-bottom: 4px;
}

.exam-rules-body {
  padding: 24px;
}

.rules-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px; color: var(--gray-700);
  line-height: 1.5;
}

.rules-list li:last-child { border-bottom: none; }
.rules-list .rule-num {
  width: 24px; height: 24px;
  background: var(--blue-600); color: var(--white);
  border-radius: 50%; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

.exam-rules-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
}

.rules-checkbox {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--gray-700);
  margin-bottom: 16px; cursor: pointer;
}

/* ============================================================
   TABS
   ============================================================ */
.tab-list {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  color: var(--gray-500); border: none;
  background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--blue-600); }
.tab-btn.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 40px;
}

.search-box .search-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400); font-size: 16px;
  pointer-events: none;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--gray-400);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; max-width: 280px; margin: 0 auto 20px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .exam-body { grid-template-columns: 1fr; }
  .exam-nav-panel { border-left: none; border-top: 1px solid var(--gray-200); }
}

@media (max-width: 768px) {
  .login-wrapper { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 40px 24px; }
  .page-content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .top-bar { padding: 0 16px; }
  .modal { max-width: 100%; margin: 12px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .exam-topbar { padding: 0 12px; }
  .exam-question-area { padding: 16px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .top-bar, .btn { display: none !important; }
  .main-content { margin-left: 0; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
