/* ============================================================
   CBT MODERN CUSTOM CSS — All Roles
   ============================================================ */

/* ── Animations ── */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ── Global Utilities ── */
.img-responsive  { max-width: 95%; }
strong, b        { font-weight: 700; }
.hidden          { display: none; }
.no-sort::after, .no-sort::before { display: none !important; }
.no-sort         { pointer-events: none !important; cursor: default !important; }
.fw-500          { font-weight: 500; }
.fw-600          { font-weight: 600; }
.fw-700          { font-weight: 700; }
.fs-11           { font-size: 11px; }
.fs-12           { font-size: 12px; }
.fs-13           { font-size: 13px; }
.fs-14           { font-size: 14px; }
.gap-8           { gap: 8px; }
.rounded-lg      { border-radius: 12px; }
.rounded-xl      { border-radius: 16px; }

/* ── Gradient Text ── */
.text-rainbow, .text-gradient {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* ── Gradient Backgrounds ── */
.bg-pelangi, .btn-pelangi {
  background: linear-gradient(135deg, #2563eb, #3b82f6, #06b6d4, #10b981) !important;
  color: #fff !important;
  border: none !important;
}
.bg-gradient-blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.bg-gradient-green  { background: linear-gradient(135deg, #059669, #10b981); }
.bg-gradient-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.bg-gradient-red    { background: linear-gradient(135deg, #dc2626, #ef4444); }
.bg-gradient-purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

/* ── Pulse Badge ── */
.pulse {
  position: relative;
  border: none;
  cursor: pointer;
  animation: pulse 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* ── Sidebar Enhancements ── */
.sidebar .sidebar-header {
  background: linear-gradient(160deg, #0f172a, #1e293b) !important;
}
.sidebar .menu-category {
  letter-spacing: 1.2px;
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8 !important;
  padding: 18px 20px 6px;
  text-transform: uppercase;
}
.sidebar .menu-item.active > .menu-link,
.sidebar .menu-link.active {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #3b82f6 !important;
  border-left: 3px solid #3b82f6;
}
.sidebar .menu-link:hover {
  background: rgba(255,255,255,0.06) !important;
}
.sidebar .menu-item > .menu-link .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  margin-right: 10px;
  font-size: 15px;
}
.sidebar .menu-item.active > .menu-link .icon {
  background: rgba(59,130,246,0.18);
  color: #3b82f6;
}

/* ── Topbar Enhancements ── */
.topbar {
  background: linear-gradient(90deg, #1d4ed8, #2563eb, #3b82f6) !important;
  box-shadow: 0 2px 12px rgba(37,99,235,0.3) !important;
}
.topbar .logo img { filter: brightness(0) invert(1); opacity: 0.92; }

/* ── Stat Cards (Dashboard) ── */
.stat-card {
  border-radius: 16px;
  border: none;
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
  animation: fadeInUp 0.4s ease both;
  text-decoration: none !important;
  display: block;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15) !important;
}
.stat-card .stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
}
.stat-card .stat-value {
  font-size: 36px;
  font-weight: 100;
  line-height: 1;
  color: #fff;
}
.stat-card .stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  letter-spacing: 0.4px;
  text-align: right;
  margin-top: 8px;
}
.stat-card .card-body {
  padding: 20px 22px;
}

/* Warna card */
.stat-card-blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.stat-card-green  { background: linear-gradient(135deg, #059669, #10b981); }
.stat-card-orange { background: linear-gradient(135deg, #d97706, #fbbf24); }
.stat-card-red    { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.stat-card-purple { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.stat-card-teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); }

/* ── Welcome Banner (Beranda) ── */
.welcome-banner {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0ea5e9 100%);
  border-radius: 18px;
  padding: 30px 32px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(37,99,235,0.28);
  animation: fadeInUp 0.4s ease;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 80px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.welcome-banner .wb-role-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 3px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.welcome-banner h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}
.welcome-banner p {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  margin: 0;
}
.welcome-banner .wb-icon {
  font-size: 64px;
  opacity: 0.18;
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ── Running Text Marquee ── */
.running-text {
  background: linear-gradient(90deg, #fef3c7, #fffbeb);
  border-left: 4px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #92400e;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.running-text marquee { flex: 1; }

/* ── Info Cards / Quick Actions ── */
.quick-action-card {
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  padding: 20px;
  transition: all 0.22s ease;
  text-decoration: none !important;
  display: block;
  animation: fadeInUp 0.4s ease both;
}
.quick-action-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 20px rgba(59,130,246,0.12);
  transform: translateY(-2px);
}
.quick-action-card .qa-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
  color: #fff;
}
.quick-action-card h6 {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px;
}
.quick-action-card p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

/* ── Siswa: Exam Card (Lembar Soal Aktif) ── */
.exam-card {
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.4s ease both;
}
.exam-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.1);
}
.exam-card .exam-card-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 12px;
}
.exam-card .exam-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.exam-card .exam-card-body  { padding: 14px 20px; }
.exam-card .exam-card-footer {
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}
.exam-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.exam-status-open   { background: #dcfce7; color: #15803d; }
.exam-status-closed { background: #fee2e2; color: #b91c1c; }
.exam-status-done   { background: #dbeafe; color: #1d4ed8; }

/* ── Lembar Soal List Table ── */
.table-soal-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}
.table-soal-modern thead th {
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 14px;
  border: none;
}
.table-soal-modern tbody tr {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s;
}
.table-soal-modern tbody tr:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.09);
}
.table-soal-modern tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border: none;
  font-size: 13px;
}

/* ── Question Types Badges ── */
.badge-jenis {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-jenis-pg     { background: #dbeafe; color: #1d4ed8; }
.badge-jenis-pgk    { background: #ede9fe; color: #6d28d9; }
.badge-jenis-jodoh  { background: #fef3c7; color: #92400e; }
.badge-jenis-bs     { background: #fee2e2; color: #b91c1c; }
.badge-jenis-essay  { background: #f1f5f9; color: #475569; }

/* ── Question & Test Taking ── */
.card-soal-modern {
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  background: #fff;
  animation: fadeInUp 0.3s ease;
}
.opsi-box-item {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 13px 16px;
  margin-bottom: 10px;
  background: #fff;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
}
.opsi-box-item:hover {
  border-color: #3b82f6;
  background: #f0f7ff;
  transform: translateX(3px);
}
.opsi-box-item.selected {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 2px 10px rgba(16,185,129,0.15);
}
.opsi-badge-btn {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700; font-size: 14px;
  margin-right: 14px;
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  transition: all 0.2s ease;
}
.opsi-box-item.selected .opsi-badge-btn {
  background: #10b981;
  color: #fff;
  border-color: #059669;
}

/* ── PG Kompleks ── */
.pgk-checkbox-custom {
  width: 20px; height: 20px; min-width: 20px;
  margin-right: 12px; margin-top: 4px;
  cursor: pointer;
  accent-color: #10b981;
}

/* ── Benar / Salah Buttons ── */
.bs-btn-group { display: inline-flex; gap: 10px; }
.bs-pill-btn {
  padding: 9px 22px;
  border-radius: 22px;
  font-size: 13px; font-weight: 600;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bs-pill-btn:hover         { border-color: #3b82f6; }
.bs-pill-btn.active-benar  { background: #10b981; color: #fff; border-color: #059669; }
.bs-pill-btn.active-salah  { background: #ef4444; color: #fff; border-color: #dc2626; }

/* ── Menjodohkan Table ── */
.table-jodoh-matching {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}
.table-jodoh-matching tr {
  background: #f8fafc;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.table-jodoh-matching td {
  padding: 12px 16px;
  vertical-align: middle;
}
.table-jodoh-matching td:first-child {
  border-radius: 10px 0 0 10px;
  font-weight: 600;
  color: #1e293b;
}
.table-jodoh-matching td:last-child { border-radius: 0 10px 10px 0; }

/* ── Violation Badge ── */
.badge-pelanggaran-header {
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.3s;
}
.badge-pelanggaran-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fcd34d;
}
.badge-pelanggaran-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #f87171;
  animation: pulse 1.2s infinite;
}

/* ── Form Enhancements ── */
.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.card { border-radius: 12px; border: 1px solid #e8eef5; }
.card-header { border-radius: 12px 12px 0 0 !important; }
.btn { border-radius: 8px !important; }
.btn-lg { border-radius: 10px !important; }

/* ── Progress & Score Display ── */
.score-ring {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 6px solid #e2e8f0;
  background: #fff;
  position: relative;
}
.score-ring.pass  { border-color: #10b981; }
.score-ring.fail  { border-color: #ef4444; }
.score-ring .score-val  { font-size: 28px; font-weight: 800; line-height: 1; }
.score-ring.pass .score-val { color: #10b981; }
.score-ring.fail .score-val { color: #ef4444; }
.score-ring .score-sub  { font-size: 11px; color: #64748b; }

/* ── Hasil/Result Breakdown ── */
.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
}
.result-stat .rs-val  { font-size: 30px; font-weight: 700; }
.result-stat .rs-label { font-size: 12px; color: #64748b; margin-top: 4px; }
.result-stat.correct   { background: #f0fdf4; border-color: #bbf7d0; }
.result-stat.wrong     { background: #fef2f2; border-color: #fecaca; }
.result-stat.empty     { background: #fafafa; border-color: #e5e7eb; }
.result-stat.correct .rs-val { color: #15803d; }
.result-stat.wrong .rs-val   { color: #b91c1c; }
.result-stat.empty .rs-val   { color: #6b7280; }

/* ── Notification Alerts ── */
.alert { border-radius: 10px !important; border: none !important; }
.alert-success { background: #f0fdf4; color: #15803d; border-left: 4px solid #10b981 !important; }
.alert-danger  { background: #fef2f2; color: #b91c1c; border-left: 4px solid #ef4444 !important; }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b !important; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-left: 4px solid #3b82f6 !important; }

/* ── Avatar & User Display ── */
.user-avatar-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .welcome-banner h2 { font-size: 20px; }
  .welcome-banner    { padding: 20px; }
  .stat-card .stat-value { font-size: 28px; }
  .welcome-banner .wb-icon { display: none; }
}

/* ── Preloader ── */
.preloader {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}
.preloader .spinner-dots .dot1,
.preloader .spinner-dots .dot2,
.preloader .spinner-dots .dot3 {
  background: rgba(255,255,255,0.8);
}
