/* AAS Ujian Online - Updated 2026-06-02 */
/* =============================================
   AKADEMI AKUPUNKTUR SURABAYA â€” SISTEM UJIAN
   ============================================= */

:root {
  --green: #1a7a3c;
  --green-dark: #0d5c2a;
  --green-light: #e8f5ed;
  --green-mid: #2d9e55;
  --red: #c0392b;
  --red-light: #fdf2f2;
  --gold: #d4890a;
  --gold-light: #fef9e7;
  --blue: #1a56b0;
  --blue-light: #eaf0fb;
  --surface: #f5f7f6;
  --border: #d4e8da;
  --text: #1a1a1a;
  --text-muted: #666;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
}

/* ===== PAGES ===== */
.page { display: none; min-height: 100vh; overflow: hidden; }
.page.active { display: block !important; overflow: visible; }

/* ===== LOGIN ===== */
.login-bg {
  min-height: 100vh;
  background-color: #021a0d;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}

/* Layer 1: Parallax Wrapper & Moving 3D Background with Breathing & Ken Burns Effect */
.login-bg-parallax-wrapper {
  position: absolute;
  top: -4%;
  left: -4%;
  width: 108%;
  height: 108%;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

.login-bg-animated {
  position: absolute;
  top: -6%;
  left: -6%;
  width: 112%;
  height: 112%;
  background-image: 
    linear-gradient(135deg, rgba(3, 28, 14, 0.4) 0%, rgba(5, 43, 20, 0.15) 100%),
    url('../assets/bg-login-3d.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  will-change: transform;
  animation: loginBgPanZoom 26s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

@keyframes loginBgPanZoom {
  0% {
    transform: scale(1.02) translate3d(0, 0, 0) rotate(0deg);
  }
  33% {
    transform: scale(1.08) translate3d(-20px, -14px, 0) rotate(0.8deg);
  }
  66% {
    transform: scale(1.11) translate3d(16px, -22px, 0) rotate(-0.6deg);
  }
  100% {
    transform: scale(1.05) translate3d(-12px, 16px, 0) rotate(0.5deg);
  }
}

/* Layer 2: Glowing Animated Light Orbs (Energy Qi Flow) */
.login-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.login-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(65px);
  opacity: 0.45;
  will-change: transform, opacity;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.login-glow-orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.55) 0%, rgba(5, 150, 105, 0.15) 70%, transparent 100%);
  top: 8%;
  left: 10%;
  animation-duration: 20s;
}

.login-glow-orb-2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.45) 0%, rgba(16, 185, 129, 0.12) 70%, transparent 100%);
  bottom: 8%;
  right: 10%;
  animation-duration: 24s;
  animation-delay: -6s;
}

.login-glow-orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.3) 0%, rgba(202, 138, 4, 0.08) 70%, transparent 100%);
  top: 48%;
  right: 20%;
  animation-duration: 16s;
  animation-delay: -9s;
}

@keyframes floatOrb {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.35;
  }
  50% {
    transform: translate3d(40px, -45px, 0) scale(1.18);
    opacity: 0.6;
  }
  100% {
    transform: translate3d(-35px, 35px, 0) scale(0.92);
    opacity: 0.4;
  }
}

/* Layer 3: Interactive Qi Energy Particles Canvas */
.login-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.login-card {
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 50px rgba(26, 122, 60, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 10;
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
  display: flex; justify-content: center; margin-bottom: 20px;
}
.login-logo img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }
.logo-fallback {
  width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-dark), var(--green)); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
  box-shadow: 0 8px 16px rgba(26, 122, 60, 0.3);
}

.login-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--green-dark);
  margin-bottom: 5px;
  line-height: 1.15;
}

.login-abbr {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green);
  line-height: 1.45;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
  text-transform: none;
}

.login-sub {
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 22px;
  letter-spacing: 0.2px;
}

.role-tabs, .role-tab {
  display: none !important;
}

/* SVG Eye Icon Animation */
.eye-icon {
  width: 18px; height: 18px; fill: none; stroke: currentColor; 
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.3s, transform 0.3s;
}
.eye-icon-slash {
  stroke-dasharray: 30; stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.3s ease-in-out;
}
.eye-icon.hidden .eye-icon-slash { stroke-dashoffset: 30; }

.login-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 14px; }

/* ===== TOPBAR ===== */
.topbar {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: white; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { height: 45px; width: 45px; object-fit: contain; background: rgba(255, 255, 255, 0.95); padding: 4px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.topbar-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar-sub { font-size: 11px; opacity: 0.8; }

/* Badge Tahun Akademik (CBT Global Header) */
.ta-badge {
  font-size: 11px;
  color: #1a7a3c;
  background: #e8f5ed;
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-weight: 800;
  border: 1.5px solid #2ecc71;
  vertical-align: middle;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  line-height: 1.4;
}
.ta-badge:empty {
  display: none !important;
}

/* ===== CONTENT ===== */
.content-area { padding: 20px 24px; max-width: 1100px; margin: 0 auto; }

.page-header { margin-bottom: 18px; }
.page-header h2 { font-size: 20px; font-weight: 700; color: var(--text); }
.page-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 0.5px solid var(--border); margin-bottom: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  padding: 13px 18px; background: #f3f8f5;
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { font-size: 13px; font-weight: 700; }
.card-body { padding: 16px 18px; }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: white; border-radius: 12px;
  border: 0.5px solid var(--border); padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.gold { color: var(--gold); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left; padding: 9px 14px;
  background: #f3f8f5; font-weight: 600;
  color: #555; font-size: 11px;
  border-bottom: 0.5px solid var(--border);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 0.5px solid #f0f0f0; color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fdfdfd; }
tr:hover td { background: #f0f7f3; }
.empty-row { text-align: center; color: var(--text-muted); padding: 24px; font-size: 12px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: #444; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 12px; font-size: 13px;
  border: 1.5px solid #d0dfd6; border-radius: 7px;
  background: #fafcfb; outline: none; font-family: inherit;
  transition: border-color 0.2s;
  color: var(--text);
}
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green); background: white; box-shadow: 0 0 0 3px rgba(26,122,60,0.1); }
.form-group textarea { resize: vertical; min-height: 72px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toggle-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 0.5px solid #f0f0f0;
}
.toggle-group label:first-child { margin: 0; font-size: 12px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }

/* Toggle Switch */
.toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 22px; transition: 0.3s;
}
.slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 2px; bottom: 2px;
  background: white; border-radius: 50%; transition: 0.3s;
}
input:checked + .slider { background: var(--green); }
input:checked + .slider::before { transform: translateX(16px); }

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 10px 22px; font-size: 13px; font-weight: 700;
  background: var(--green); color: white; border: none;
  border-radius: 8px; cursor: pointer; transition: background 0.2s;
  letter-spacing: 0.2px;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }
.btn-primary.full { width: 100%; padding: 12px; }

.btn-secondary {
  padding: 8px 18px; font-size: 12px; font-weight: 600;
  background: white; color: var(--green); border: 1.5px solid var(--green);
  border-radius: 7px; cursor: pointer; transition: all 0.18s;
}
.btn-secondary:hover { background: var(--green-light); }

.btn-danger:hover { background: rgba(192,57,43,0.1); }

.btn-warning {
  padding: 7px 16px; font-size: 12px; font-weight: 600;
  background: white; color: #f39c12; border: 1.5px solid #f39c12;
  border-radius: 7px; cursor: pointer; transition: all 0.18s;
}
.btn-warning:hover { background: rgba(243, 156, 18, 0.1); }

.btn-danger {
  padding: 7px 16px; font-size: 12px; font-weight: 600;
  background: white; color: var(--red); border: 1.5px solid var(--red);
  border-radius: 7px; cursor: pointer;
}
.btn-logout {
  padding: 7px 16px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.15); color: white;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 7px; cursor: pointer;
  transition: background 0.18s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

.btn-submit-exam {
  width: 100%; padding: 12px; font-size: 13px; font-weight: 800;
  background: var(--red); color: white; border: none;
  border-radius: 8px; cursor: pointer; margin-top: auto;
  transition: background 0.2s;
   position: relative;
   z-index: 10;
  display: block;
}
.btn-submit-exam:hover { background: #a93226; }

/* ===== BADGES ===== */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
}
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-gold { background: var(--gold-light); color: var(--gold); }
.badge-gray { background: #f0f0f0; color: #555; }
.badge-blue { background: var(--blue-light); color: var(--blue); }

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 12px;
}
.alert-danger { background: var(--red-light); border: 1px solid #f5c6cb; color: #721c24; }
.alert-success { background: var(--green-light); border: 1px solid #c3e6cb; color: #155724; }
.alert-info { background: var(--blue-light); border: 1px solid #b8d4f5; color: #0c3a7a; }
.info-box {
  background: var(--gold-light); border-left: 3px solid var(--gold);
  padding: 10px 14px; border-radius: 0 7px 7px 0; font-size: 11px;
  color: #7a5c00; margin-bottom: 14px; line-height: 1.6;
}
.info-box code { background: rgba(0,0,0,0.08); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* ===== TABS ===== */
.tab-nav {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.tab-btn {
  padding: 9px 18px; font-size: 12px; font-weight: 600;
  border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.18s; border-radius: 6px 6px 0 0;
}
.tab-btn:hover { color: var(--green); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); background: var(--green-light); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== UJIAN LIST ===== */
.ujian-list { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.ujian-item {
  background: white; border: 0.5px solid var(--border); border-radius: 12px;
  padding: 16px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
}
.ujian-item.active-exam { border-left: 3px solid var(--green); }
.ujian-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ===== EXAM ===== */
#mhs-exam {
    height: auto !important;
    overflow: visible;
  display: flex;
  flex-direction: column;
}

.exam-header {
  background: var(--green-dark); color: white;
  padding: 12px 24px; display: flex;
  align-items: center; justify-content: space-between;
  flex-shrink: 0; z-index: 50;
  gap: 12px;
}
.exam-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.exam-title-text { font-size: 13px; font-weight: 700; }
.exam-timer-wrap { text-align: right; flex-shrink: 0; }
.timer-label { font-size: 10px; opacity: 0.7; }
.exam-timer { font-size: 22px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.exam-timer.warning { color: #ff6b6b; animation: blink 1s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Real-time Network Status Badge */
.net-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.3s ease;
  vertical-align: middle;
}
.net-status-badge.online {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.6);
  color: #4ade80;
}
.net-status-badge.offline {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(248, 113, 113, 0.8);
  color: #fca5a5;
  animation: pulse-offline 1.5s infinite;
}
.net-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.online .net-status-dot {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}
.offline .net-status-dot {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

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

/* Status Jaringan Pill pada Toolbar Soal */
.net-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  user-select: none;
  transition: all 0.3s ease;
}
.net-status-pill.online {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #81c784;
}
.net-status-pill.offline {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #e57373;
  animation: pulse-offline 1.5s infinite;
}
.net-status-pill .net-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.net-status-pill.online .net-status-dot {
  background: #2e7d32;
  box-shadow: 0 0 5px #2e7d32;
}
.net-status-pill.offline .net-status-dot {
  background: #c62828;
  box-shadow: 0 0 5px #c62828;
}

/* Exam Network Reassurance Banner */
.exam-net-banner {
  padding: 10px 24px;
  font-size: 12px;
  transition: all 0.3s ease;
}
.exam-net-banner.banner-offline {
  background: #fef2f2;
  border-bottom: 2px solid #ef4444;
  color: #991b1b;
}
.exam-net-banner.banner-online {
  background: #f0fdf4;
  border-bottom: 2px solid #22c55e;
  color: #166534;
}
.net-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}
.net-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.net-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.net-banner-text strong {
  font-size: 13px;
  font-weight: 700;
}

.anticheat-banner {
  background: #fff8e1; border-bottom: 1.5px solid #f0c040;
  padding: 9px 24px; font-size: 11px; color: #7a5c00;
  display: flex; align-items: flex-start; gap: 10px;
  flex-shrink: 0;
}
.ac-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

.exam-body {
    display: flex; gap: 0; flex: 1;
    overflow: visible; height: auto; min-height: 0;
}

.soal-sidebar {
      width: 200px; flex-shrink: 0;
      background: white; border-right: 0.5px solid var(--border);
      padding: 16px;
      height: auto; min-height: 0;
       display: flex;
       flex-direction: column;
      overflow: visible;
  }
.sidebar-title { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

.soal-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; flex-grow: 1; overflow-y: visible; align-content: flex-start; padding-bottom: 10px; min-height: 0; }
.soal-btn {
  position: relative;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1.5px solid #d0d0d0; background: white;
  font-size: 11px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; color: #555;
}
.soal-btn.answered { background: var(--green); border-color: var(--green); color: white; }
.soal-btn.flagged { background: #f59e0b !important; border-color: #d97706 !important; color: white !important; }
.soal-btn.answered.flagged { background: #d97706 !important; border-color: #b45309 !important; color: white !important; }
.soal-btn.current { border-color: var(--gold); color: var(--gold); font-weight: 800; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold); }
.soal-btn.answered.current { background: var(--gold); border-color: var(--gold); color: white; }
.soal-btn.flagged.current { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #b45309; }
.grid-flag-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 8px;
  line-height: 1;
}

.sidebar-legend { font-size: 10px; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-dot.answered { background: var(--green); }
.legend-dot.flagged { background: #f59e0b; }
.legend-dot.unanswered { background: white; border: 1.5px solid #d0d0d0; }
.legend-dot.current { background: var(--gold); }

.soal-main { flex: 1; padding: 20px 24px; overflow-y: visible; height: auto; min-height: 0; }

.soal-card {
  background: white; border-radius: 10px;
  border: 0.5px solid var(--border); padding: 20px;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.soal-number { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.soal-text { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 16px; line-height: 1.8; white-space: pre-wrap; }
.soal-poin { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; font-weight: 600; }

/* Responsive Media in Questions */
#soal-content img, #soal-content video, #soal-content iframe {
  max-width: 100% !important;
  height: auto;
  border-radius: 8px;
}
#soal-content iframe {
  aspect-ratio: 16 / 9;
}

/* Gambar Soal — rasio 4:6 (lebar 60% dari container) */
.soal-img {
  display: block;
  max-width: 60%;
  width: 60%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  margin: 16px auto 12px auto;
}
@media (max-width: 600px) {
  .soal-img {
    max-width: 90%;
    width: 90%;
  }
}

.options { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 8px;
  border: 2px solid #e8e8e8; cursor: pointer;
  font-size: 16px; transition: all 0.15s;
}
.option-item:hover { border-color: var(--green); background: var(--green-light); }
.option-item.selected { border-color: var(--green); background: var(--green-light); font-weight: 600; }
.option-item.correct { border-color: var(--green); background: #d4edda; }
.option-item.wrong { border-color: var(--red); background: var(--red-light); }
.opt-letter {
  width: 32px; height: 32px; border-radius: 50%; background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #555; flex-shrink: 0;
}
.selected .opt-letter { background: var(--green); color: white; }
.correct .opt-letter { background: var(--green); color: white; }
.wrong .opt-letter { background: var(--red); color: white; }

/* Toolbar Soal & Pengatur Font */
.soal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.soal-toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.font-ctrl-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.font-size-controller {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #edf2f7;
  padding: 3px;
  border-radius: 6px;
}
.btn-font-sz {
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-font-sz:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
}
.btn-font-sz.active {
  background: var(--green, #1a7a3c);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(26, 122, 60, 0.25);
}

/* Ragu-Ragu Toggle Button */
.btn-ragu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #b45309;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.15);
}
.btn-ragu:hover {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}
.btn-ragu.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.btn-ragu.active:hover {
  background: #d97706;
}
.btn-ragu .ragu-icon {
  font-size: 14px;
}

/* Font Size Scales for Question Content (A- / A / A+ / A++) */
#soal-content.font-sz-sm .soal-text,
#soal-content.font-sz-sm .soal-text *,
#soal-content.font-sz-sm .option-item,
#soal-content.font-sz-sm .option-item span { font-size: 13.5px !important; line-height: 1.6 !important; }
#soal-content.font-sz-sm .option-item { padding: 9px 14px !important; }
#soal-content.font-sz-sm .opt-letter { width: 28px; height: 28px; font-size: 12.5px !important; }
#soal-content.font-sz-sm textarea { font-size: 13px !important; }

#soal-content.font-sz-md .soal-text,
#soal-content.font-sz-md .soal-text *,
#soal-content.font-sz-md .option-item,
#soal-content.font-sz-md .option-item span { font-size: 17px !important; line-height: 1.75 !important; }
#soal-content.font-sz-md .option-item { padding: 13px 18px !important; }
#soal-content.font-sz-md .opt-letter { width: 32px; height: 32px; font-size: 14px !important; }
#soal-content.font-sz-md textarea { font-size: 14px !important; }

#soal-content.font-sz-lg .soal-text,
#soal-content.font-sz-lg .soal-text *,
#soal-content.font-sz-lg .option-item,
#soal-content.font-sz-lg .option-item span { font-size: 21px !important; line-height: 1.85 !important; }
#soal-content.font-sz-lg .option-item { padding: 16px 20px !important; }
#soal-content.font-sz-lg .opt-letter { width: 38px; height: 38px; font-size: 17px !important; }
#soal-content.font-sz-lg textarea { font-size: 17px !important; }

#soal-content.font-sz-xl .soal-text,
#soal-content.font-sz-xl .soal-text *,
#soal-content.font-sz-xl .option-item,
#soal-content.font-sz-xl .option-item span { font-size: 25px !important; line-height: 1.95 !important; }
#soal-content.font-sz-xl .option-item { padding: 19px 24px !important; }
#soal-content.font-sz-xl .opt-letter { width: 44px; height: 44px; font-size: 20px !important; }
#soal-content.font-sz-xl textarea { font-size: 20px !important; }

.soal-nav-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 10px;
  flex-wrap: wrap;
}
.soal-counter { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ===== RESULT ===== */
.result-card {
  max-width: 560px; margin: 30px auto;
  background: white; border-radius: 16px;
  border: 0.5px solid var(--border); padding: 32px;
  box-shadow: var(--shadow); text-align: center;
}
.result-header { margin-bottom: 20px; }
.result-header h2 { font-size: 20px; font-weight: 800; margin-top: 8px; }
.result-header p { font-size: 12px; color: var(--text-muted); }

.result-score-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--green-light); border: 4px solid var(--green);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; margin: 20px auto;
}
.score-number { font-size: 40px; font-weight: 900; color: var(--green); line-height: 1; }
.score-label { font-size: 10px; color: var(--text-muted); }

.result-status { margin: 10px 0 20px; }
.result-stats {
  display: flex; justify-content: center; gap: 30px;
  padding: 16px 0; border-top: 0.5px solid var(--border); border-bottom: 0.5px solid var(--border);
  margin-bottom: 20px;
}
.rs-item { text-align: center; }
.rs-val { font-size: 20px; font-weight: 800; }
.rs-val.green { color: var(--green); }
.rs-val.red { color: var(--red); }
.rs-val.gray { color: #888; }
.rs-label { font-size: 11px; color: var(--text-muted); }

.result-review { text-align: left; margin-bottom: 20px; }
.review-item {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 12px;
  border: 1px solid;
}
.review-item.correct { border-color: #c3e6cb; background: #d4edda; }
.review-item.wrong { border-color: #f5c6cb; background: var(--red-light); }
.review-q { font-weight: 600; margin-bottom: 4px; }
.review-a { color: #555; }

.result-actions { display: flex; gap: 10px; justify-content: center; }

/* ===== IMPORT ===== */
.import-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.import-tab {
  padding: 6px 14px; border: 1.5px solid var(--border); border-radius: 6px;
  background: white; cursor: pointer; font-size: 11px; font-weight: 700;
  color: var(--text-muted); transition: all 0.18s;
}
.import-tab.active { border-color: var(--green); background: var(--green-light); color: var(--green); }

.dropzone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 28px;
  text-align: center; cursor: pointer; background: #fafcfb;
  transition: border-color 0.2s;
}
.dropzone:hover { border-color: var(--green); background: var(--green-light); }
.drop-icon { font-size: 28px; margin-bottom: 8px; }
.dropzone p { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.dropzone small { font-size: 10px; color: #aaa; }

/* ===== SOAL PREVIEW ===== */
.soal-preview-list { padding: 0 16px 16px; }
.soal-preview-item {
  background: #fafcfb; border: 0.5px solid var(--border);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
  font-size: 12px;
}
.spi-q { font-weight: 700; margin-bottom: 6px; color: var(--text); white-space: pre-wrap; }
.spi-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; color: var(--text-muted); }
.spi-ans { margin-top: 6px; font-weight: 700; color: var(--green); font-size: 11px; }

/* ===== MANUAL SOAL INPUT ===== */
.manual-soal-item {
  background: #fafcfb; border: 0.5px solid var(--border);
  border-radius: 9px; padding: 14px; margin-bottom: 10px;
}
.manual-soal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.manual-soal-num { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.manual-soal-del { background: none; border: none; color: var(--red); cursor: pointer; font-size: 12px; }

.opts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }

/* ===== MONITOR ===== */
.cheat-log {
  padding: 12px 16px; max-height: 280px; overflow-y: auto;
  font-size: 11px;
}
.log-entry {
  padding: 6px 0; border-bottom: 0.5px solid #f0f0f0;
  display: flex; gap: 10px;
}
.log-time { color: #aaa; flex-shrink: 0; }
.log-name { font-weight: 700; color: var(--text); flex-shrink: 0; }
.log-event { color: var(--text-muted); }
.log-violation { color: var(--red); font-weight: 700; }
.log-empty { color: var(--text-muted); text-align: center; padding: 20px 0; }

/* ===== SETTINGS ===== */
.setting-list { display: flex; flex-direction: column; }
.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 0.5px solid #f0f0f0;
  gap: 14px;
}
.setting-item:last-child { border-bottom: none; }
.setting-item > div { flex: 1; }
.setting-item strong { font-size: 13px; font-weight: 700; display: block; }
.setting-item p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: white; border-radius: 14px; padding: 28px;
  max-width: 400px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.modal-box p { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.modal-soal-info {
  background: var(--surface); border-radius: 8px; padding: 12px;
  font-size: 12px; margin-bottom: 16px;
}
.modal-actions { display: flex; gap: 10px; }

/* ===== LOADING ===== */
.loading-spinner { 
  text-align: center; 
  padding: 24px; 
  color: var(--text-muted); 
  font-size: 12px;
  animation: fadeIn 0.3s ease-in-out;
}

/* ===== SMOOTH ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* Smooth fade for content */
.fade-in {
  animation: fadeIn 0.4s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-in-out;
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Better loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(26, 122, 60, 0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.spinner-large {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* Smooth transitions for tables and lists */
table tbody, .ujian-list, .cheat-log {
  transition: opacity 0.3s ease-in-out;
}

table tbody.loading, .ujian-list.loading, .cheat-log.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Card smooth appearance */
.card {
  animation: slideInUp 0.4s ease-out;
}

/* Smooth hover effects */
.ujian-item, .option-item, .soal-btn, .btn-primary, .btn-secondary {
  transition: all 0.2s ease-in-out;
}

.ujian-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active {
  transform: scale(0.96);
}

/* Toast animation improvement */
#global-toast {
  animation: slideInRight 0.4s ease-out;
}

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

/* ===== Log entry short class aliases (used in JS) ===== */
.log-t { color: #aaa; flex-shrink: 0; font-size: 10px; }
.log-n { font-weight: 700; color: var(--text); flex-shrink: 0; }
.log-e { color: var(--text-muted); }
.log-v { color: var(--red); font-weight: 700; }

/* ===== Sidebar Toggle Button (mobile only) ===== */
#sidebar-toggle-btn {
  display: none;
  width: 100%;
  padding: 11px 16px;
  background: var(--green-light);
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.3px;
}
#sidebar-toggle-btn:active { background: #d4edda; }

/* Display rules for Submit Buttons */
.mobile-submit-btn { display: none !important; }
.desktop-submit-btn { display: block; }

/* ===== RESPONSIVE â€” Mobile ===== */
@media (max-width: 768px) {

  /* --- General Layout --- */
  .mobile-submit-btn { display: flex !important; }
  .desktop-submit-btn { display: none !important; }
  .content-area { padding: 10px 10px; }
  .form-grid-2 { grid-template-columns: 1fr; gap: 8px; }

  /* --- Stats Row --- */
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
  .stat-card { padding: 10px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }

  /* --- Topbar --- */
  .topbar { padding: 8px 12px; }
  .topbar-logo { height: 35px; width: 35px; }
  .topbar-title { font-size: 12px; line-height: 1.2; }
  .topbar-sub { font-size: 10px; }
  .topbar-left { gap: 8px; }
  .btn-logout { padding: 6px 10px; font-size: 11px; }

  /* --- Tab Navigation --- */
  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0;
    gap: 2px;
    scrollbar-width: none;
  }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 8px 12px; font-size: 11px; white-space: nowrap; flex-shrink: 0; }

  /* --- Cards --- */
  .card-head { padding: 10px 12px; }
  .card-body { padding: 10px 12px; }
  .card-head h3 { font-size: 12px; }

  /* --- Tables --- */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 11px; min-width: 480px; }
  th, td { padding: 7px 10px; white-space: nowrap; }

  /* --- Ujian List Items --- */
  .ujian-item { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .ujian-item > div:last-child { width: 100%; justify-content: flex-end; }
  .ujian-meta { font-size: 10px; line-height: 1.5; }

  /* --- EXAM: Header --- */
  .exam-header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .exam-title-text {
    font-size: 11px;
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .exam-timer { font-size: 18px; letter-spacing: 0.5px; }
  .timer-label { font-size: 9px; }
  .anticheat-banner { padding: 6px 12px; font-size: 10px; gap: 6px; }

  /* --- EXAM: Sidebar Mobile Toggle --- */
  #sidebar-toggle-btn { display: block; }
  .exam-body { flex-direction: column; overflow-y: auto !important; height: 100%; }

  .soal-sidebar {
    width: 100%;
    position: static;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
    padding: 10px 12px;
    max-height: none;
    overflow-y: visible;
    transition: all 0.2s ease;
  }
  .soal-sidebar.collapsed { display: none; }
  .sidebar-title { font-size: 10px; margin-bottom: 8px; }
  .soal-grid { gap: 4px; }
  .soal-btn { width: 34px; height: 34px; font-size: 12px; border-radius: 7px; }
  .sidebar-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
  .legend-item { margin-bottom: 0; font-size: 10px; }
  .btn-submit-exam { margin-top: 10px; padding: 11px; font-size: 12px; }

  /* --- EXAM: Soal Main --- */
    .soal-main { padding: 10px; overflow-y: visible !important; height: auto; }
  .soal-card { padding: 14px; }
  .soal-number { font-size: 10px; }
  .soal-text { font-size: 13px; line-height: 1.55; }
  .soal-poin { font-size: 10px; }
  .options { gap: 7px; }
  .option-item { padding: 10px 12px; font-size: 12px; gap: 8px; }
  .opt-letter { width: 22px; height: 22px; font-size: 10px; }
  .soal-nav-btns { padding: 15px 0; gap: 8px; margin-bottom: 130px; }
  .soal-nav-btns .btn-secondary { flex: 1; padding: 12px 10px; font-size: 13px; justify-content: center; }
  .soal-counter { flex: 0 0 auto; font-size: 13px; font-weight: bold; }

  /* --- Result --- */
  .result-card { margin: 20px auto !important; padding: 18px 14px; }
  .result-score-circle { width: 100px; height: 100px; }
  .score-number { font-size: 32px; }
  .result-stats { gap: 14px; padding: 12px 0; }
  .rs-val { font-size: 18px; }
  .result-actions { flex-direction: column; gap: 8px; }
  .result-actions button { width: 100%; }

  /* --- Login --- */
  .login-card { padding: 22px 18px; margin: 8px; }
  .login-title { font-size: 15px; }
  .login-logo img { width: 85px; height: 85px; }

  /* --- Import --- */
  .import-tabs { flex-wrap: wrap; gap: 4px; }
  .import-tab { font-size: 10px; padding: 5px 10px; }

  /* --- Buttons --- */
  .btn-primary { font-size: 12px; padding: 10px 16px; }
  .btn-secondary { font-size: 11px; padding: 7px 12px; }

  /* --- Modal --- */
  .modal-box { padding: 20px 14px; }
  .modal-actions { flex-direction: column; gap: 8px; }
  .modal-actions .btn-primary,
  .modal-actions .btn-secondary { width: 100%; justify-content: center; }

  /* --- Cheat Log --- */
  .cheat-log { font-size: 10px; padding: 8px 12px; }
  .log-entry { gap: 6px; flex-wrap: wrap; }

  /* --- Dropzone --- */
  .dropzone { padding: 18px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .exam-title-text { max-width: 130px; }
  .result-stats { flex-direction: column; align-items: center; gap: 10px; }
  .tab-btn { padding: 7px 10px; font-size: 10px; }
  .topbar-sub { display: none; }
}

/* ANTI-COPY PASTE & ANTI-DRAG TINGKAT WEB */
body, .soal-card, .soal-text, .option-item, .soal-img {
  -webkit-touch-callout: none; /* Disable long press popup on iOS */
  -webkit-user-select: none;   /* Disable text selection Safari */
  -khtml-user-select: none;    /* Disable text selection Konqueror */
  -moz-user-select: none;      /* Disable text selection Firefox */
  -ms-user-select: none;       /* Disable text selection Internet Explorer/Edge */
  user-select: none;           /* Disable text selection Chrome/Opera */
  -webkit-user-drag: none;
  user-drag: none;
}

/* Izinkan ketik di kolom input/textarea */
input, textarea {
  -webkit-user-select: auto !important;
  -khtml-user-select: auto !important;
  -moz-user-select: auto !important;
  -ms-user-select: auto !important;
  user-select: auto !important;
}

/* Indikator Jaringan Offline/Online */
#network-indicator {
  position: fixed;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

#network-indicator.show {
  bottom: 20px;
}

#network-indicator.offline {
  background-color: #dc3545; /* Merah */
}

#network-indicator.online {
  background-color: #28a745; /* Hijau */
}

/* =====================================================
   REAL-TIME EXAM NETWORK STATUS BADGE & REASSURANCE BANNER
   ===================================================== */
.net-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.3s ease;
  cursor: default;
  user-select: none;
}
.net-status-badge.online {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #81c784;
}
.net-status-badge.offline {
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #e57373;
  animation: pulse-offline 1.5s infinite;
}
.net-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.net-status-badge.online .net-status-dot {
  background: #2e7d32;
  box-shadow: 0 0 6px rgba(46, 125, 50, 0.6);
}
.net-status-badge.offline .net-status-dot {
  background: #c62828;
  box-shadow: 0 0 6px rgba(198, 40, 40, 0.8);
}

@keyframes pulse-offline {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

/* Exam Network Reassurance Banner */
.exam-net-banner {
  margin: 12px 0 16px 0;
  border-radius: 10px;
  padding: 12px 16px;
  animation: slideDownBanner 0.3s ease-out;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.exam-net-banner.banner-offline {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border: 1.5px solid #ffb300;
  color: #b78103;
}
.exam-net-banner.banner-online {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 1.5px solid #4caf50;
  color: #1b5e20;
}
.net-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.net-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.net-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.net-banner-text strong {
  font-size: 13px;
  font-weight: 700;
}
.net-banner-text span {
  font-size: 11.5px;
  opacity: 0.95;
  line-height: 1.4;
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   CBT UX ENHANCEMENTS: PROGRESS BAR, AUTO-SAVE, ZOOM & SHORTCUTS
   ===================================================== */

/* 1. Bar Kemajuan Ujian (Visual Progress Bar) */
.exam-progress-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.exam-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}
.exam-progress-label {
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 5px;
}
.exam-progress-stat {
  font-weight: 700;
  color: #1a7a3c;
  background: #e8f5ed;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
}
.exam-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.exam-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Indikator Auto-Save Real-Time */
.exam-save-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  transition: all 0.3s ease;
  user-select: none;
}
.exam-save-status.saved {
  background: #e8f5ed;
  color: #1a7a3c;
  border: 1px solid #a7f3d0;
}
.exam-save-status.saved.idle {
  opacity: 0.65;
}
.exam-save-status.saving {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
  animation: savePulse 1s infinite alternate;
}
@keyframes savePulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* 3. Timer Warnings & Pulse Animation */
.exam-timer.urgent {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #991b1b !important;
  animation: timerPulseDanger 1s infinite !important;
}
@keyframes timerPulseDanger {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* 4. Lightbox Zoom Gambar Soal */
.soal-img-container {
  display: inline-block;
  position: relative;
  margin-top: 10px;
  margin-bottom: 10px;
  cursor: zoom-in;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  max-width: 100%;
}
.soal-img-container:hover {
  transform: translateY(-2px);
  border-color: #1a7a3c;
  box-shadow: 0 6px 18px rgba(26, 122, 60, 0.15);
}
.soal-img-container .soal-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
}
.soal-img-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 0 0 6px 6px;
  backdrop-filter: blur(4px);
  text-align: center;
}
.soal-img-container:hover .soal-img-zoom-btn {
  background: #1a7a3c;
}

/* Modal Lightbox Zoom */
.exam-image-modal {
  z-index: 10001;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 15px;
}
.exam-image-modal-box {
  background: #ffffff;
  border-radius: 14px;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalZoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.exam-image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.exam-image-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
}
.exam-image-modal-close {
  background: #e2e8f0;
  border: none;
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: background 0.2s, color 0.2s;
}
.exam-image-modal-close:hover {
  background: #ef4444;
  color: #ffffff;
}
.exam-image-modal-body {
  padding: 15px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0f172a;
  min-height: 250px;
}
.exam-image-modal-body img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.exam-image-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}
.exam-image-modal-hint {
  font-size: 11.5px;
  color: #64748b;
}

/* 5. Keyboard Shortcuts Hint */
.keyboard-shortcuts-hint {
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 10px;
  padding: 6px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
}
@media (max-width: 768px) {
  .keyboard-shortcuts-hint {
    display: none; /* Sembunyikan petunjuk keyboard di layar sentuh smartphone */
  }
}

