/* ==========================================================================
   UKOM NERS - PROFESSIONAL GLASSMORPHISM DESIGN SYSTEM 2.0
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Dark Theme Palette (Deep Space Navy - Default) */
  --bg-dark: #070b14;
  --bg-dark-surface: #0f172a;
  --bg-dark-card: rgba(15, 23, 42, 0.78);
  --bg-dark-input: rgba(30, 41, 59, 0.7);
  --text-dark-main: #f8fafc;
  --text-dark-muted: #94a3b8;
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-dark-glow: rgba(59, 130, 246, 0.3);

  /* Light Theme Palette (Crisp Medical White) */
  --bg-light: #f1f5f9;
  --bg-light-surface: #ffffff;
  --bg-light-card: rgba(255, 255, 255, 0.88);
  --bg-light-input: #f8fafc;
  --text-light-main: #0f172a;
  --text-light-muted: #64748b;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-light-glow: rgba(59, 130, 246, 0.25);

  /* Theme Variable Binding */
  --bg-body: var(--bg-dark);
  --bg-surface: var(--bg-dark-surface);
  --bg-card: var(--bg-dark-card);
  --bg-input: var(--bg-dark-input);
  --text-main: var(--text-dark-main);
  --text-muted: var(--text-dark-muted);
  --border-color: var(--border-dark);
  --border-glow: var(--border-dark-glow);

  /* Accent Colors */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --secondary: #8b5cf6;
  --secondary-glow: rgba(139, 92, 246, 0.4);
  --cyan: #06b6d4;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --indigo: #6366f1;

  /* CBT Navigation State Colors */
  --cbt-answered: #10b981;
  --cbt-flagged: #f59e0b;
  --cbt-unanswered: rgba(255, 255, 255, 0.08);

  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Speeds */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-body: var(--bg-light);
  --bg-surface: var(--bg-light-surface);
  --bg-card: var(--bg-light-card);
  --bg-input: var(--bg-light-input);
  --text-main: var(--text-light-main);
  --text-muted: var(--text-light-muted);
  --border-color: var(--border-light);
  --border-glow: var(--border-light-glow);
  --cbt-unanswered: rgba(0, 0, 0, 0.06);
}

/* Base Styles & Universal Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 90% 90%, rgba(139, 92, 246, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* Kbd Shortcut Styling */
kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: inset 0 -1px 0 var(--border-color);
  vertical-align: middle;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar Header */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
}
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 6px 20px var(--primary-glow);
}
.brand-title span {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
}
.user-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.theme-toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover {
  transform: scale(1.08);
  border-color: var(--primary);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.spa-view {
  display: none;
  animation: viewFadeIn var(--transition-normal);
}
.spa-view.active {
  display: block;
}

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

/* Glassmorphism Card Element */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  margin-bottom: 1.75rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover {
  border-color: var(--border-glow);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.6rem;
  min-height: 48px; /* Touch target optimized */
  border-radius: 14px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 25px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
  border-color: var(--text-muted);
}

.btn-warning {
  background: linear-gradient(135deg, var(--amber), #d97706);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--rose), #e11d48);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

/* LOGIN VIEW */
.login-container {
  max-width: 460px;
  margin: 3.5rem auto;
  text-align: center;
}
.login-header {
  margin-bottom: 2rem;
}
.login-header h2 {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
}
.input-group {
  margin-bottom: 1.35rem;
  text-align: left;
}
.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.form-input {
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.license-hints {
  margin-top: 1.75rem;
  padding: 1.1rem;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  font-size: 0.88rem;
  text-align: left;
}
.license-hints code {
  background: var(--bg-input);
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  color: var(--primary);
  font-weight: 700;
}

/* DASHBOARD VIEW */
.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-glow);
}
.welcome-text h2 {
  font-size: 2.3rem;
  margin-bottom: 0.5rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.85rem;
}
.dash-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.dash-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
}

.dash-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.3rem;
  margin-bottom: 1.35rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.dash-card:hover .dash-card-icon {
  transform: scale(1.08) rotate(-3deg);
}

.dash-card h3 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}
.dash-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

/* CATEGORY SELECT MENU FOR LEARNING MODE */
.learning-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.cat-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 1.6rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.cat-select-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.cat-select-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.cat-select-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  transition: all var(--transition-fast);
}

.cat-select-card:hover .cat-select-card-icon {
  transform: scale(1.1) rotate(-4deg);
}

.cat-select-card-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.cat-select-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.cat-select-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.cat-select-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.category-filter-bar {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  max-width: 100%;
  scrollbar-width: thin;
}
.cat-chip {
  padding: 0.55rem 1.15rem;
  border-radius: 24px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.cat-chip:hover, .cat-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.vignette-card {
  position: relative;
}
.vignette-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.question-text {
  font-size: 1.15rem;
  line-height: 1.75;
  margin-bottom: 2rem;
  color: var(--text-main);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-bottom: 1.75rem;
}
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.1rem 1.35rem;
  min-height: 52px;
  border-radius: 16px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.option-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}
.option-item.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}
.option-item.correct {
  border-color: var(--emerald) !important;
  background: rgba(16, 185, 129, 0.14) !important;
}
.option-item.wrong {
  border-color: var(--rose) !important;
  background: rgba(244, 63, 94, 0.14) !important;
}

.option-prefix {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.option-item.selected .option-prefix {
  background: var(--primary);
  color: #ffffff;
}
.option-item.correct .option-prefix {
  background: var(--emerald);
  color: #ffffff;
}
.option-item.wrong .option-prefix {
  background: var(--rose);
  color: #ffffff;
}

.option-content {
  flex: 1;
  font-size: 1.02rem;
  padding-top: 0.15rem;
}

.explanation-panel {
  margin-top: 1.75rem;
  padding: 1.75rem;
  border-radius: 18px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: viewFadeIn var(--transition-normal);
}
.explanation-panel h4 {
  color: var(--emerald);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
}
.explanation-body {
  font-size: 0.98rem;
  line-height: 1.75;
}

/* CBT EXAM SIMULATOR VIEW */
.cbt-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1.85rem;
  align-items: start;
}

.cbt-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 1.1rem 1.6rem;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  padding: 0.5rem 1.35rem;
  border-radius: 14px;
}
.timer-box.urgent {
  color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.2) !important;
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.25);
  animation: timerPulse 1s infinite alternate;
}

@keyframes timerPulse {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.85; transform: scale(1.02); }
}

.cbt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Mobile Off-Canvas Drawer for CBT Navigation */
.mobile-drawer-toggle {
  display: none;
  width: 100%;
  margin-bottom: 1rem;
}

/* CBT Navigation Grid Sidebar */
.cbt-sidebar {
  position: sticky;
  top: 90px;
}
.cbt-sidebar .card {
  padding: 1.25rem !important;
  border-radius: 20px !important;
}
.nav-grid-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.cbt-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-height: 285px;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}
.cbt-grid::-webkit-scrollbar {
  width: 5px;
}
.cbt-grid::-webkit-scrollbar-track {
  background: transparent;
}
.cbt-grid::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
.cbt-grid::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.grid-num {
  height: 38px;
  border-radius: 10px;
  background: var(--cbt-unanswered);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.grid-num:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}
.grid-num.answered {
  background: var(--cbt-answered) !important;
  color: #ffffff !important;
  border-color: var(--cbt-answered) !important;
}
.grid-num.flagged {
  background: var(--cbt-flagged) !important;
  color: #ffffff !important;
  border-color: var(--cbt-flagged) !important;
}
.grid-num.active {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary);
  font-weight: 800;
}

.cbt-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* RESULTS & ANALYTICS VIEW */
.scorecard-header {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
  border-radius: 24px;
  border: 1px solid var(--border-glow);
  margin-bottom: 2rem;
}
.score-badge {
  display: inline-block;
  font-size: 4.5rem;
  font-family: var(--font-heading);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pass-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.4rem;
  border-radius: 24px;
  font-weight: 800;
  font-size: 1.15rem;
  margin-top: 1rem;
}
.pass-status.passed {
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pass-status.failed {
  background: rgba(244, 63, 94, 0.18);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.category-progress-item {
  margin-bottom: 1.35rem;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.progress-bar-bg {
  height: 12px;
  border-radius: 8px;
  background: var(--bg-input);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: viewFadeIn var(--transition-fast);
}
.modal-backdrop.active {
  display: flex;
}
.modal-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.25rem;
  max-width: 540px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}
.modal-title {
  font-size: 1.45rem;
  margin-bottom: 1.15rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-top: 2rem;
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .cbt-layout {
    grid-template-columns: 1fr;
  }
  .cbt-sidebar {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.92) !important;
    width: 92vw !important;
    max-width: 380px !important;
    height: auto !important;
    max-height: 85vh !important;
    z-index: 20005 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 0.85rem !important;
    background: var(--bg-card) !important;
    border-radius: 22px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
    overflow-y: auto !important;
    right: auto !important;
  }
  .cbt-sidebar.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
  .cbt-sidebar-close-btn {
    display: inline-block !important;
  }
  .cbt-shortcuts-bar {
    display: none !important;
  }
  .mobile-drawer-toggle {
    display: inline-flex;
  }
}

.cbt-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  z-index: 20000;
}
.cbt-sidebar-overlay.active {
  display: block !important;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION & NATIVE APP RESPONSIVE STYLING
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 62px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 10000;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.25rem;
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.25);
}

.mobile-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
}

.mobile-nav-item i {
  font-size: 1.35rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-item.active {
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.mobile-nav-item.active i {
  transform: translateY(-2px);
  color: var(--primary) !important;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex !important;
  }

  .main-content {
    padding: 0.85rem 0.85rem 80px 0.85rem !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Hide redundant header buttons on mobile top bar */
  .navbar .nav-actions button:not(#theme-toggle-btn):not(#btn-student-logout) {
    display: none !important;
  }
  .navbar .user-badge {
    display: none !important;
  }

  .navbar {
    padding: 0.5rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .brand {
    gap: 0.4rem !important;
  }

  .brand-title {
    font-size: 0.98rem !important;
  }

  .brand-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.1rem !important;
    border-radius: 8px !important;
  }

  /* Dashboard Grid Cards on Mobile */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .card {
    padding: 1.15rem !important;
    border-radius: 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Data Table Mobile Overflow Scrollable */
  .data-table-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px !important;
  }

  .data-table {
    min-width: 580px;
    font-size: 0.82rem !important;
  }

  .data-table th, .data-table td {
    padding: 0.65rem 0.75rem !important;
  }

  /* Question Card & Option Items Responsive */
  .question-text {
    font-size: 0.98rem !important;
    line-height: 1.65 !important;
  }

  .option-item {
    padding: 0.85rem 1rem !important;
    border-radius: 14px !important;
    margin-bottom: 0.65rem !important;
  }

  .option-prefix {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  /* CBT Simulator Header Bar on Mobile */
  .cbt-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.95rem 1.1rem !important;
  }

  .cbt-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .cbt-actions button {
    width: 100% !important;
  }

  /* Modal Cards Responsive */
  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 1.15rem 1rem !important;
    border-radius: 20px !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .modal-title {
    font-size: 1.15rem !important;
    margin-bottom: 0.85rem !important;
    word-break: break-word !important;
  }

  /* Hide Keyboard Shortcuts and kbd Hints on Mobile */
  .option-kbd-hint {
    display: none !important;
  }
  .cbt-shortcuts {
    display: none !important;
  }

  .welcome-text h2 {
    font-size: 1.5rem !important;
  }

  .timer-box {
    font-size: 1rem !important;
    padding: 0.3rem 0.75rem !important;
  }

  .score-badge {
    font-size: 3rem !important;
  }
}

/* ==========================================================================
   LANDING PAGE SPECIFIC STYLING
   ========================================================================== */

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 4rem 0 3rem;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: 30px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid var(--border-glow);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-heading {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 1.12rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0 4rem;
}

.stat-item-card {
  text-align: center;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.stat-num {
  font-size: 2.8rem;
  font-family: var(--font-heading);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 24px;
  padding: 2.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 15px 35px var(--primary-glow);
}

.pricing-price {
  font-size: 2.5rem;
  font-family: var(--font-heading);
  font-weight: 900;
  margin: 1.25rem 0;
}

.pricing-features-list {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-features-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.faq-item {
  margin-bottom: 1rem;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

.faq-question {
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer {
  margin-top: 5rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .hero-heading {
    font-size: 2.5rem;
  }
  .hero-cta-group {
    justify-content: center;
  }
}

/* ==========================================================================
   DESKTOP EXACT 75% SCALE & FULL VIEWPORT RESPONSIVE SCREEN ADJUSTMENT
   ========================================================================== */
@media (min-width: 1024px) {
  html {
    font-size: 75%;
    zoom: 0.75;
  }

  .main-content {
    max-width: 98% !important;
    width: 98% !important;
    margin: 0 auto !important;
    padding: 1rem 1.25rem !important;
  }

  .data-table-container {
    width: 100% !important;
  }

  .navbar {
    padding: 0.5rem 1.5rem !important;
  }

  .card {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }
}


/* ==========================================================================
   VIGNETTE TEXT HIGHLIGHTER & FLOATING POPOVER STYLES
   ========================================================================== */
mark.vignette-hl {
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}
mark.vignette-hl-yellow {
  background: rgba(245, 158, 11, 0.35);
  color: inherit;
  border-bottom: 2px solid #f59e0b;
}
mark.vignette-hl-green {
  background: rgba(16, 185, 129, 0.35);
  color: inherit;
  border-bottom: 2px solid #10b981;
}
mark.vignette-hl-cyan {
  background: rgba(6, 182, 212, 0.35);
  color: inherit;
  border-bottom: 2px solid #06b6d4;
}

#hl-floating-popover {
  position: absolute;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  border-radius: 30px;
  padding: 0.35rem 0.65rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  animation: hlPopUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes hlPopUp {
  from { opacity: 0; transform: translateY(6px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hl-btn-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.hl-btn-dot:hover {
  transform: scale(1.2);
  border-color: #ffffff;
}
.hl-btn-yellow { background: #f59e0b; }
.hl-btn-green { background: #10b981; }
.hl-btn-cyan { background: #06b6d4; }
.hl-btn-clear {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}
.hl-btn-clear:hover {
  background: #f43f5e;
  color: #fff;
}


