/* ==========================================================================
   AI QUIZ SPACE - FUTURISTIC & KID-FRIENDLY THEME SYSTEM
   Designed with Cosmic Cyber Colors, Glassmorphism, and Playful Gamification
   ========================================================================== */

:root {
  /* Futuristic Cyber Palette */
  --cyber-primary: #4f46e5;
  --cyber-primary-hover: #4338ca;
  --cyber-violet: #7c3aed;
  --cyber-cyan: #06b6d4;
  --cyber-cyan-glow: #22d3ee;
  --cyber-pink: #ec4899;
  --cyber-gold: #f59e0b;
  --cyber-emerald: #10b981;
  --cyber-dark: #0f172a;
  --cyber-dark-alt: #0b0f19;

  /* Surface & Base */
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;

  /* Futuristic Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;

  /* Glow Shadows */
  --shadow-subtle: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 16px 36px -6px rgba(99, 102, 241, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-neon-cyan: 0 0 16px rgba(6, 182, 212, 0.4);
  --shadow-neon-violet: 0 0 16px rgba(124, 58, 237, 0.35);
}

/* ==========================================================================
   BASE & COSMIC BACKGROUND
   ========================================================================== */
body.theme-futuristic {
  font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 10% 15%, rgba(99, 102, 241, 0.07) 0px, transparent 55%),
    radial-gradient(at 90% 12%, rgba(6, 182, 212, 0.08) 0px, transparent 55%),
    radial-gradient(at 50% 90%, rgba(139, 92, 246, 0.06) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Ambient glow accents */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
.glow-top-left {
  top: -100px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: rgba(99, 102, 241, 0.12);
}
.glow-top-right {
  top: -60px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: rgba(6, 182, 212, 0.12);
}
.glow-bottom-center {
  bottom: -150px;
  left: 35%;
  width: 450px;
  height: 350px;
  background: rgba(139, 92, 246, 0.08);
}

/* ==========================================================================
   FUTURISTIC GLASSMORPHIC TOP NAVBAR
   ========================================================================== */
.navbar-cyber {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 25px rgba(11, 15, 25, 0.25);
  padding: 0.75rem 1rem;
  z-index: 1020;
  transition: all 0.3s ease;
}

/* Brand */
.navbar-brand-futuristic {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-avatar-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.navbar-brand-futuristic:hover .brand-avatar-box {
  transform: scale(1.08) rotate(-4deg);
}

.sparkle-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  background: #22d3ee;
  border: 2px solid #0f172a;
  border-radius: 50%;
  animation: pulse-sparkle 2s infinite;
}

@keyframes pulse-sparkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.brand-avatar-box-sm {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
}

.brand-title-futuristic {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.badge-kids {
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.brand-subtitle-futuristic {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.text-neon-cyan {
  color: var(--cyber-cyan-glow) !important;
}

/* Nav Links */
.nav-link-cyber {
  color: rgba(255, 255, 255, 0.75) !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem !important;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.22s ease;
  position: relative;
  border: 1px solid transparent;
}

.nav-link-cyber:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.nav-link-cyber.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.4) 0%, rgba(124, 58, 237, 0.4) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.3);
}

.nav-link-cyber i {
  font-size: 1.05rem;
  color: #93c5fd;
  transition: transform 0.2s ease;
}

.nav-link-cyber:hover i {
  transform: scale(1.15);
  color: var(--cyber-cyan-glow);
}

.badge-pill-glow {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Ruang Ujian Pulse Badge */
.nav-link-exam {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5 !important;
}

.nav-link-exam:hover, .nav-link-exam.active {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #fff !important;
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* User Profile Pill */
.user-profile-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  padding: 4px 14px 4px 5px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  transition: all 0.2s ease;
}

.user-profile-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.user-avatar-glow {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #06b6d4 0%, #4f46e5 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.user-pill-name {
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.1;
  color: #ffffff;
}

.user-pill-role {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Mobile Toggler */
.btn-cyber-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  font-size: 1.25rem;
}

.btn-cyber-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--cyber-cyan-glow);
}

/* ==========================================================================
   OFFCANVAS DRAWER (MOBILE)
   ========================================================================== */
.offcanvas-cyber {
  background: #0b0f19;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 8px 0 35px rgba(0, 0, 0, 0.5);
  width: 300px !important;
}

.drawer-link {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.drawer-link:hover, .drawer-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.drawer-link i {
  font-size: 1.15rem;
}

/* ==========================================================================
   MOBILE FLOATING APP BOTTOM BAR (1-THUMB NAVIGATION)
   ========================================================================== */
.mobile-bottom-dock {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 64px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1040;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 0 6px;
}

.dock-item {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 18px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.dock-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.dock-label {
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.dock-item:hover, .dock-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.dock-item.active .dock-icon {
  color: var(--cyber-cyan-glow);
  transform: scale(1.15);
}

.dock-dot {
  position: absolute;
  top: 6px;
  right: 14px;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px #ef4444;
}

@media (max-width: 1199.98px) {
  .main-content-wrapper {
    padding-bottom: 90px !important;
  }
}

/* ==========================================================================
   DROPDOWN CYBER
   ========================================================================== */
.dropdown-cyber {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  min-width: 230px;
}

.dropdown-item-cyber {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.18s ease;
}

.dropdown-item-cyber:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* ==========================================================================
   CARDS & STAT CARDS (FUTURISTIC & GAMIFIED)
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-header-clean {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title-clean {
  font-size: 1.12rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* STAT CARDS */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.45rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.35);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-3deg);
}

.stat-icon.primary {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5;
}
.stat-icon.success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}
.stat-icon.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}
.stat-icon.purple {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #7c3aed;
}

.stat-value {
  font-size: 2.15rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.stat-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==========================================================================
   BUTTONS (FUTURISTIC & BOUNCY 3D)
   ========================================================================== */
.btn {
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.25rem;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary, .btn-cyber-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover, .btn-cyber-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

/* ==========================================================================
   EXAM OPTION CARDS (FUTURISTIC PADS FOR STUDENTS)
   ========================================================================== */
.exam-option-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
}

.exam-option-card:hover {
  border-color: #818cf8;
  background-color: #faf5ff;
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}

.exam-option-card.selected {
  border-color: var(--cyber-primary);
  background-color: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  transform: translateX(6px);
}

.exam-option-letter {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--secondary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.exam-option-card.selected .exam-option-letter {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Question Palette */
.q-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.q-palette-btn {
  height: 42px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.q-palette-btn:hover {
  background: #e0e7ff;
  transform: scale(1.06);
}

.q-palette-btn.answered {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.q-palette-btn.active {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  border-color: var(--cyber-primary);
}

/* Timer Floating */
.exam-timer-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff;
  padding: 0.75rem 1.45rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.exam-timer-box.urgent {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
  animation: pulse-urgent 1.2s infinite;
}

@keyframes pulse-urgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ==========================================================================
   BADGES & ROLES (CYBER BADGES)
   ========================================================================== */
.badge-role-cyber {
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}
.badge-role-superadmin { background: #fee2e2; color: #991b1b; }
.badge-role-admin { background: #e0e7ff; color: #3730a3; }
.badge-role-teacher { background: #d1fae5; color: #065f46; }
.badge-role-student { background: #e0f2fe; color: #075985; }

/* ==========================================================================
   ALERTS (CYBER TOAST)
   ========================================================================== */
.alert-cyber {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.alert-cyber-success { border-left: 5px solid var(--cyber-emerald); }
.alert-cyber-danger { border-left: 5px solid #ef4444; }
.alert-cyber-info, .alert-cyber-primary { border-left: 5px solid var(--cyber-primary); }

.alert-cyber-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.alert-cyber-success .alert-cyber-icon { background: #d1fae5; color: #059669; }
.alert-cyber-danger .alert-cyber-icon { background: #fee2e2; color: #dc2626; }
.alert-cyber-info .alert-cyber-icon, .alert-cyber-primary .alert-cyber-icon { background: #e0e7ff; color: #4f46e5; }

/* ==========================================================================
   FOOTER (FUTURISTIC)
   ========================================================================== */
.footer-futuristic {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #818cf8 0%, #06b6d4 100%);
  border-radius: 10px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6366f1 0%, #0891b2 100%);
}
