/* =============================================
   UJIAN CBT - PREMIUM LIGHT DESIGN SYSTEM
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --secondary: #64748b;
  --accent-indigo: #4f46e5;
  --accent-cyan: #0891b2;
  --accent-emerald: #059669;
  --accent-rose: #e11d48;
  --accent-amber: #d97706;
  
  --bg-body: #f8fafc; 
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Background Decoration */
.bg-mesh {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(8, 145, 178, 0.05) 0px, transparent 50%);
}

/* Layout Containers */
.main-container { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; position: relative; }
.main-container.wide { max-width: 1500px; padding: 2rem 1.5rem; overflow: hidden; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1300px; margin: 0 auto;
  height: 80px; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-text h1 { font-size: 1.35rem; color: #1e3a8a; line-height: 1; }
.logo-text span { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.8rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  transition: var(--transition); border: none; gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-indigo));
  color: white; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }

.btn-outline { background: white; border: 1px solid #cbd5e1; color: #475569; }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

.btn-lg { padding: 1.1rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius); }

/* Hero Section */
.hero { margin-bottom: 4rem; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-illu img { width: 100%; max-width: 500px; height: auto; animation: float 6s ease-in-out infinite; }

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.hero h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; color: #0f172a; }
.hero p { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 2.5rem; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Stepper */
.step-indicator { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 3rem; }
.step { display: flex; align-items: center; gap: 0.75rem; opacity: 0.5; }
.step.active, .step.done { opacity: 1; }
.step-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #64748b;
  font-size: 1rem; line-height: 1; padding: 0;
  flex-shrink: 0; text-align: center;
}
.step.active .step-circle { background: var(--primary); color: white; box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1); }
.step.done .step-circle {
  background: #22c55e; color: white;
  font-size: 1.15rem;
  padding-bottom: 1px;
}
.step-line { width: 60px; height: 2px; background: #e2e8f0; }
.step-line.done { background: #22c55e; }

/* Form Elements */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.9rem; font-weight: 700; color: #475569; margin-bottom: 8px; }
.form-input, .form-select {
  width: 100%; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1; background: #ffffff; font-size: 1rem;
  transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }

/* Exam UI */
.exam-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 260px;
  gap: 1.25rem;
  align-items: start;
}

.exam-sidebar-left {
  position: sticky;
  top: 90px;
}

.exam-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0; /* Critical: allows grid child to shrink */
  overflow: hidden;
}

.exam-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 90px;
  min-width: 0;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 1.25rem 0 2rem;
  line-height: 1.7;
  color: #1e293b;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.option-item {
  display: flex;
  align-items: flex-start; /* Changed from center to start for long options */
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.option-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #334155;
  padding-top: 4px; /* Align with letter circle */
}

/* Question Actions */
.q-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}

.btn-flag {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid #cbd5e1;
  background: white;
  color: #64748b;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.btn-flag.flagged {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}

.q-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.q-btn {
  height: 48px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: var(--radius-sm);
  color: #475569; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.q-btn.current { background: var(--primary); color: white; }
.q-btn.answered { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.q-btn.flagged { background: #fffbeb; border-color: #f59e0b; color: #92400e; }

.timer-box { padding: 10px 20px; background: #fef2f2; border: 1px solid #fee2e2; border-radius: var(--radius-sm); text-align: center; }
.timer-display { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.5rem; color: #b91c1c; }

.session-tabs { display: flex; flex-direction: column; gap: 10px; }
.session-tab {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-sm); background: #f8fafc; border: 1px solid #e2e8f0;
}
.session-tab.active { background: #eff6ff; border-color: var(--primary); }
.session-tab-num { width: 28px; height: 28px; border-radius: 50%; background: #cbd5e1; color: white; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; }
.session-tab.active .session-tab-num { background: var(--primary); }

.question-card { background: white; padding: 2.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-md); }

.option-item:hover { background: #f8fafc; }
.option-item.selected { background: #eff6ff; border-color: var(--primary); }
.option-letter { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #e2e8f0; display: flex; align-items: center; justify-content: center; font-weight: 800; margin-right: 1.25rem; flex-shrink: 0; }
.option-item.selected .option-letter { background: var(--primary); color: white; border-color: var(--primary); }
.submit-stats { display: grid; gap: 10px; }
.submit-stat { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); }
.submit-stat .val { font-weight: 800; font-size: 1.1rem; }
.val-answered { color: #166534; }
.val-flagged { color: #92400e; }

/* Admin Panel Layout */
.admin-layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.admin-sidebar { background: white; border-right: 1px solid var(--border); padding: 2rem 1.5rem; display: flex; flex-direction: column; gap: 2rem; }
.admin-nav { display: flex; flex-direction: column; gap: 8px; }
.admin-nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); color: #64748b; font-weight: 600; text-decoration: none; transition: var(--transition); }
.admin-nav-item:hover, .admin-nav-item.active { background: #eff6ff; color: var(--primary); }
.admin-main { padding: 2.5rem 3rem; background: #f8fafc; }

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2.5rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat-card h4 { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .val { font-size: 2rem; font-weight: 800; }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 1.5rem; }
.filter-tab { padding: 8px 18px; border-radius: var(--radius-full); background: #f1f5f9; border: 1px solid #e2e8f0; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: #64748b; transition: var(--transition); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.admin-table { width: 100%; border-collapse: collapse; background: white; }
.admin-table th, .admin-table td { padding: 1.25rem 1rem; text-align: left; border-bottom: 1px solid #e2e8f0; }
.admin-table th { background: #f8fafc; font-weight: 700; color: #475569; font-size: 0.85rem; }
.admin-table tr:hover { background: #f1f5f9; }

.badge { padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-purple { background: #f5f3ff; color: #7c3aed; }

.btn-delete { padding: 6px 12px; background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2; border-radius: 6px; cursor: pointer; font-size: 0.75rem; font-weight: 700; }
.btn-delete:hover { background: #fee2e2; }

/* Toast */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; }
.toast { padding: 1rem 1.5rem; background: #1e293b; color: white; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); margin-top: 10px; transform: translateX(150%); transition: transform 0.3s ease; display: flex; align-items: center; gap: 12px; }
.toast.show { transform: translateX(0); }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: white; border-radius: var(--radius-lg); width: 90%; max-width: 800px; box-shadow: var(--shadow-xl); overflow: hidden; }

/* --- MODAL IMPROVEMENTS --- */
.form-grid-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group.full { grid-column: span 2; }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.options-grid .form-group { margin-bottom: 0; }

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 120px;
  border: 2px dashed #cbd5e1;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: #f8fafc;
}

.upload-box:hover { border-color: var(--primary); background: #eff6ff; }
.upload-box input { display: none; }
.upload-label { font-size: 0.9rem; color: #64748b; font-weight: 600; }

.img-preview-container {
  margin-top: 1rem;
  display: none;
  position: relative;
  width: fit-content;
}

.img-preview {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-remove-img {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #e11d48;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Question Image in Exam */
.question-image {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-sm);
  margin: 1rem 0 2rem;
  border: 1px solid var(--border);
  display: none;
}


/* Modal for Exam */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; z-index: 2000;
  opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal-box {
  background: white; padding: 3rem; border-radius: var(--radius-lg);
  max-width: 550px; width: 90%; box-shadow: var(--shadow-xl);
  text-align: center; transform: translateY(20px); transition: transform 0.3s ease;
}
.modal-overlay.show .modal-box { transform: translateY(0); }
.modal-title { font-size: 1.75rem; margin-bottom: 1rem; color: #1e293b; }
.modal-text { font-size: 1.1rem; color: #64748b; margin-bottom: 2.5rem; line-height: 1.6; }
.modal-actions { display: flex; gap: 1rem; justify-content: center; }

@media (max-width: 1400px) {
  .exam-layout { grid-template-columns: 200px minmax(0, 1fr) 240px; gap: 1rem; }
}

@media (max-width: 1100px) {
  .exam-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .exam-sidebar-right { display: none; }
}




/* =============================================
   RESPONSIVE BREAKPOINTS – MOBILE FIRST
   ============================================= */

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .main-container { padding: 2rem 1rem; }

  /* Header */
  .header-inner { height: 64px; padding: 0 1rem; }
  .logo-text h1 { font-size: 1.1rem; }

  /* Admin */
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-main { padding: 1.5rem 1rem; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .main-container { padding: 1.5rem 1rem; }
  .main-container.wide { padding: 1rem 0.75rem; }

  /* Header */
  .header-inner { height: 58px; padding: 0 0.875rem; gap: 0.5rem; }
  .logo-text h1 { font-size: 0.95rem; }
  .logo-text span { font-size: 0.68rem; }
  .btn.btn-outline { padding: 0.5rem 0.9rem; font-size: 0.75rem; }

  /* Stepper – compact */
  .step-indicator { gap: 0.4rem; margin-bottom: 1.5rem; flex-wrap: nowrap; }
  .step { gap: 0.4rem; }
  .step-label { font-size: 0.72rem; }
  .step-circle { width: 32px; height: 32px; font-size: 0.8rem; line-height: 1; padding: 0; }
  .step.done .step-circle { font-size: 0.95rem; padding-bottom: 1px; }
  .step-line { width: 30px; }

  /* Exam Header Bar */
  .exam-header-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .exam-header-bar > div:first-child { flex: 1 1 100%; }
  .progress-bar-wrap { flex: 1 1 calc(100% - 130px); max-width: 100%; }
  .timer-box { flex-shrink: 0; padding: 8px 14px; }
  .timer-display { font-size: 1.25rem; }
  .session-info-title { font-size: 0.95rem; }

  /* Exam layout – single column, show mobile nav bottom bar */
  .exam-layout { grid-template-columns: 1fr; gap: 1rem; }
  .exam-sidebar-left { display: none; }
  .exam-sidebar-right { display: none; }

  /* Question card */
  .question-card { padding: 1.25rem 1rem; }
  .question-text { font-size: 1rem; margin: 1rem 0 1.5rem; }
  .option-item { padding: 1rem; }
  .option-letter { width: 30px; height: 30px; margin-right: 0.75rem; font-size: 0.9rem; }
  .option-text { font-size: 0.9rem; }

  /* Q-Actions – Professional Mobile Layout */
  .q-actions {
    padding: 0.875rem 1rem;
    flex-direction: column-reverse;
    gap: 0.6rem;
    border-radius: 14px;
  }
  .q-nav-btns {
    display: flex;
    gap: 0.6rem;
    width: 100%;
  }
  .q-nav-btns .btn {
    flex: 1;
    justify-content: center;
    padding: 0.85rem 0.5rem;
    font-size: 0.88rem;
    border-radius: 10px;
  }
  .btn-flag {
    align-self: flex-start;
    padding: 0.55rem 1.1rem;
    font-size: 0.8rem;
    border-radius: 8px;
    border-width: 1.5px;
  }

  /* Modal */
  .modal-box { padding: 2rem 1.25rem; }
  .modal-title { font-size: 1.35rem; }
  .modal-text { font-size: 0.95rem; margin-bottom: 1.75rem; }
  .modal-actions { flex-direction: column; gap: 0.6rem; }
  .modal-actions .btn { width: 100%; justify-content: center; }

  /* Admin */
  .admin-stats { grid-template-columns: 1fr; }
  .admin-table { font-size: 0.82rem; }
  .admin-table th, .admin-table td { padding: 0.85rem 0.6rem; }
}

/* ── Small Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .main-container { padding: 1rem 0.75rem; }
  .main-container.wide { padding: 0.75rem 0.5rem; }

  /* Header */
  .header-inner { height: 54px; padding: 0 0.75rem; }
  .logo-text h1 { font-size: 0.85rem; }
  .logo-text span { display: none; }

  /* Stepper */
  .step-indicator { gap: 0.25rem; }
  .step-circle { width: 28px; height: 28px; font-size: 0.75rem; line-height: 1; padding: 0; }
  .step.done .step-circle { font-size: 0.9rem; padding-bottom: 1px; }
  .step-label { font-size: 0.65rem; }
  .step-line { width: 20px; }

  /* Question card */
  .question-card { padding: 1rem 0.875rem; border-radius: 12px; }
  .question-text { font-size: 0.95rem; }

  .q-actions { padding: 0.75rem 0.875rem; gap: 0.5rem; }
  .btn-flag { padding: 0.5rem 0.875rem; font-size: 0.78rem; }
  .q-nav-btns .btn { padding: 0.75rem 0.25rem; font-size: 0.82rem; }
}


/* Exam Header Bar - Full Width (outside grid) */
.exam-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.session-info-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.session-info-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; }

.progress-bar-wrap { flex: 1; max-width: 350px; }
.progress-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.progress-bar { height: 8px; background: #e2e8f0; border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent-indigo)); border-radius: var(--radius-full); transition: width 0.4s ease; }

/* Q-grid title */
.q-grid-title { font-size: 0.8rem; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }

/* Q Legend */
.q-legend { display: flex; flex-direction: column; gap: 6px; }
.q-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); }
.q-legend-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex-shrink: 0; }
.dot-current { background: var(--primary); border-color: var(--primary); color: var(--primary); }
.dot-answered { background: #22c55e; border-color: #22c55e; color: #22c55e; }
.dot-flagged { background: #f59e0b; border-color: #f59e0b; color: #f59e0b; }
.dot-empty { background: white; border-color: #cbd5e1; color: #cbd5e1; }

/* Exam header status badge */
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; color: #22c55e; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Question badge and tag */
.q-number-badge { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 4px; }
.q-category-tag { background: #eff6ff; color: var(--primary); padding: 3px 12px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; }

/* Btn Success */
.btn-success { background: linear-gradient(135deg, #22c55e, #059669); color: white; }
.btn-success:hover { transform: translateY(-2px); }

/* Admin header */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h2 { font-size: 1.75rem; color: #1e293b; }


/* Hide radio button on answer options */
.option-item input[type="radio"] { display: none; }

/* ── Multi-Jawab (Checkbox) Styles ── */
.option-item input[type="checkbox"] { display: none; }

/* Multi option base */
.option-item.option-multi {
  border-color: #e2e8f0;
  position: relative;
}

/* Hover untuk multi */
.option-item.option-multi:hover {
  background: #fffbeb;
  border-color: #fde68a;
}

/* State terpilih untuk multi */
.option-item.selected-multi {
  background: #fffbeb;
  border-color: #f59e0b;
}

/* Letter circle untuk multi — warna amber */
.option-letter-multi {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-right: 1.25rem; flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-item.selected-multi .option-letter-multi {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

/* Responsive multi */
@media (max-width: 768px) {
  .option-letter-multi { width: 30px; height: 30px; margin-right: 0.75rem; font-size: 0.9rem; }
}

/* ── Option Images (gambar per pilihan jawaban) ── */
.option-image {
  max-width: 220px;
  max-height: 160px;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: zoom-in;
}
.option-image:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Option text container for mixed text+image */
.option-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* ── KaTeX Math Overrides ── */
.question-text .katex { font-size: 1.15em; }
.option-text .katex { font-size: 1em; }
.katex-display { margin: 0.75em 0; }

/* ── Admin: Option Image Upload Buttons ── */
.opt-img-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.opt-img-row .form-input { flex: 1; }

.opt-img-btn {
  width: 38px;
  height: 38px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.opt-img-btn:hover { border-color: var(--primary); background: #eff6ff; }
.opt-img-btn input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.opt-img-btn.has-image {
  border-style: solid;
  border-color: #22c55e;
  background: #f0fdf4;
}

.opt-img-preview {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}

/* ── Image Lightbox (zoom overlay) ── */
.img-lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  cursor: zoom-out;
  animation: fadeInLightbox 0.2s ease;
}
.img-lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
@keyframes fadeInLightbox {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .option-image { max-width: 160px; max-height: 120px; }
}
@media (max-width: 480px) {
  .option-image { max-width: 120px; max-height: 90px; }
}
