/* ===================================
   gkall.in - Shared Styles
   Design System: The Cognitive Atelier
   =================================== */

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

/* ---- CSS Variables ---- */
:root {
  /* Beautiful & Colorful Light Mode Base */
  --surface: #f8fafc;
  /* Crisp Slate 50 canvas */
  --surface-dim: #f1f5f9;
  --surface-container-lowest: #ffffff;
  /* Bright white floating cards by default */
  /* Ultra-Premium Colorful Light Mode (Student Focused) */
  --surface: #fdfdfe;
  /* Nearly white base */
  --surface-dim: #f8fafc;
  --surface-container-lowest: #ffffff;
  /* Crisp white cards */
  --surface-container-low: rgba(255, 255, 255, 0.8);
  --surface-container: rgba(255, 255, 255, 0.7);
  --surface-container-high: rgba(255, 255, 255, 0.6);
  --surface-container-highest: rgba(255, 255, 255, 0.5);
  --surface-bright: #ffffff;

  /* Vibrant Hyper-Modern Primary Accent */
  --primary: #4f46e5;
  /* Indigo 600 */
  --primary-container: #eef2ff;
  /* Indigo 50 */
  --on-primary: #ffffff;

  /* Stunning & Colorful Accents */
  --secondary: #10b981;
  /* Emerald 500 */
  --secondary-container: #ecfdf5;
  /* Emerald 50 */
  --tertiary: #f59e0b;
  /* Amber 500 */
  --tertiary-container: #fffbeb;
  /* Amber 50 */
  --error: #ef4444;
  /* Rose 500 */
  --error-container: #fef2f2;
  /* Rose 50 */

  /* Deep, Clear Typography (FIXED CONTRAST) */
  --on-surface: #0f172a;
  /* Slate 900 */
  --on-surface-variant: #475569;
  /* Slate 600 (Darker for Contrast) */
  --outline: #64748b;
  /* Slate 500 (Labels & Inactive Nav) */
  --outline-variant: #cbd5e1;
  /* Slate 300 (Borders) */

  --sidebar-width: 288px;
  --topbar-height: 64px;

  /* Premium Glassmorphism */
  --surface-glass-75: rgba(255, 255, 255, 0.75);
  --surface-glass-92: rgba(255, 255, 255, 0.92);
  --surface-glass-97: rgba(255, 255, 255, 0.97);
  --surface-container-low-glass: rgba(255, 255, 255, 0.85);

  /* Vivid & Soft Drop Shadows */
  --border-subtle: rgba(0, 0, 0, 0.04);
  --border-strong: rgba(0, 0, 0, 0.08);
  --border-glass: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(79, 70, 229, 0.08);
  --shadow-lg: 0 16px 40px rgba(79, 70, 229, 0.12);
  --shadow-primary: 0 8px 24px rgba(79, 70, 229, 0.25);
  --shadow-bottom-nav: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.dark {
  --surface: #10141a;
  --surface-dim: #10141a;
  --surface-container-lowest: #0a0e14;
  --surface-container-low: #181c22;
  --surface-container: #1c2026;
  --surface-container-high: #262a31;
  --surface-container-highest: #31353c;
  --surface-bright: #353940;
  --primary: #b0c6ff;
  --primary-container: #002c6e;
  --on-primary: #002d6f;
  --secondary: #40e56c;
  --secondary-container: #02c953;
  --tertiary: #fabd00;
  --tertiary-container: #3f2d00;
  --error: #ffb4ab;
  --error-container: #93000a;
  --on-surface: #dfe2eb;
  --on-surface-variant: #c6c5d4;
  --outline: #908f9d;
  --outline-variant: #454652;
  --surface-glass-75: rgba(16, 20, 26, 0.75);
  --surface-glass-92: rgba(16, 20, 26, 0.92);
  --surface-glass-97: rgba(16, 20, 26, 0.97);
  --surface-container-low-glass: rgba(24, 28, 34, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-glass: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 12px 32px rgba(176, 198, 255, 0.15);
  --shadow-bottom-nav: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: 'Inter', 'Noto Sans Gujarati', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Gujarati Script Rendering ---- */
.gu,
[lang="gu"] {
  font-family: 'Noto Sans Gujarati', 'Inter', sans-serif;
  line-height: 1.8;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
.font-headline {
  font-family: 'Manrope', 'Noto Sans Gujarati', sans-serif;
  letter-spacing: -0.02em;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: var(--surface-container-low);
}

::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---- Glassmorphism ---- */
.glass {
  background: rgba(24, 28, 34, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-light {
  background: rgba(49, 53, 60, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- TopAppBar ---- */
#topbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--topbar-height);
  z-index: 100;
  background: var(--surface-glass-75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transition: height 0.25s ease, background 0.25s ease;
}

/* Gradient bottom line */
#topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(176, 198, 255, 0.25), rgba(64, 229, 108, 0.2), rgba(250, 189, 0, 0.15), transparent);
}

/* Compact on scroll */
#topbar.scrolled {
  height: 52px;
  background: var(--surface-glass-92);
}

/* ---- Logo ---- */
.logo-text {
  font-family: 'Manrope', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary) 0%, #6b95f3 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  transition: opacity 0.2s;
}

.logo-text:hover {
  opacity: 0.82;
}

/* ---- Header Left/Right group ---- */
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
@media (max-width: 640px) {
  .header-left, .header-right { gap: 0.75rem; }
  #topbar { padding: 0 1rem; }
}

/* Telegram Pill Button (NEW) */
.tg-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 136, 204, 0.08);
  border: 1px solid rgba(0, 136, 204, 0.2);
  color: #0088cc;
  height: 38px;
  padding: 0 16px;
  border-radius: 99px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}
.tg-pill:hover {
  background: #0088cc;
  color: white;
  border-color: #0088cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}
.tg-pill svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
@media (max-width: 768px) {
  .tg-pill span { display: none; }
  .tg-pill { padding: 0; width: 38px; border-radius: 50%; }
}

/* ---- Header Center ---- */
.header-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---- Topbar search ---- */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-container);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  padding: 0.35rem 1rem 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-width: 180px;
}

.topbar-search:hover {
  background: var(--surface-container-high);
  border-color: rgba(176, 198, 255, 0.35);
}

.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.78rem;
  color: var(--on-surface);
  width: 110px;
  font-family: 'Inter', sans-serif;
}

.topbar-search input::placeholder {
  color: var(--outline);
}

.topbar-search .material-symbols-outlined {
  font-size: 1.05rem;
  color: var(--outline);
}

@media (max-width: 1024px) {
  .topbar-search {
    min-width: auto;
  }

  .topbar-search input {
    display: none;
  }
}

/* ---- XP badge pill ---- */
.topbar-rank-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(250, 189, 0, 0.15), rgba(250, 189, 0, 0.08));
  border: 1px solid rgba(250, 189, 0, 0.25);
  border-radius: 99px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--tertiary);
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.topbar-rank-pill:hover {
  background: rgba(250, 189, 0, 0.2);
  border-color: rgba(250, 189, 0, 0.5);
}

.topbar-rank-pill .material-symbols-outlined {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .topbar-rank-pill {
    display: none;
  }
}

/* ---- Topbar tagline chip ---- */
.topbar-tagline {
  display: none;
  align-items: center;
  gap: 0.3rem;
  background: rgba(176, 198, 255, 0.07);
  border: 1px solid rgba(176, 198, 255, 0.14);
  border-radius: 99px;
  padding: 0.25rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  text-transform: uppercase;
}

@media (min-width: 1200px) {
  .topbar-tagline {
    display: flex;
  }
}

/* ---- Notification button with badge ---- */
.icon-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  border: 1.5px solid var(--surface);
  animation: pulse-glow 2s infinite;
}

/* ---- Profile avatar ---- */
.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-container);
  border: 2px solid rgba(176, 198, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-avatar:hover {
  border-color: rgba(176, 198, 255, 0.55);
  transform: scale(1.06);
}

/* ---- Right group ---- */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ---- Scrolled compact topbar for middle section ---- */
#topbar.scrolled .topbar-tagline {
  display: none !important;
}

#topbar.scrolled .topbar-xp-pill {
  padding: 0.25rem 0.65rem;
  font-size: 0.68rem;
}

/* ---- icon-btn ---- */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--outline);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.icon-btn:hover {
  background: rgba(176, 198, 255, 0.08);
  color: var(--primary);
}

.icon-btn:active {
  transform: scale(0.92);
}

.topbar-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--outline);
  text-decoration: none;
  transition: color 0.2s;
  padding-bottom: 2px;
}

.topbar-nav a:hover {
  color: var(--primary);
}

.topbar-nav a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}


/* ---- Sidebar ---- */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 90;
  background: var(--surface-container-low);
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 2rem;
  margin-bottom: 2rem;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-profile h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-profile p {
  font-size: 0.65rem;
  color: var(--outline);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 0 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0 99px 99px 0;
  color: var(--outline);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--surface-container);
  transform: translateX(4px);
}

.nav-item.active {
  color: var(--primary);
  background: var(--surface-container);
  font-weight: 700;
  transform: translateX(4px);
}

.nav-item .material-symbols-outlined {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: calc(var(--topbar-height) + 1.5rem);
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
  }
}

/* ---- Bottom Nav (Mobile) ---- */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  z-index: 100;
  background: var(--surface-container-low-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-bottom-nav);
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--outline);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.bottom-nav-item.active {
  background: var(--primary);
  color: var(--on-primary);
}

.bottom-nav-item:not(.active):hover {
  color: var(--primary);
}

.bottom-nav-item .material-symbols-outlined {
  font-size: 1.4rem;
}

/* ---- Floating Chat Widget ---- */
#chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
}

.fab-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  background: var(--surface-container-highest);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: var(--shadow-sm);
}

#chat-fab:hover .fab-tooltip {
  opacity: 1;
}

.fab-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: var(--on-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-primary);
  transform: translateY(-2px);
}

.fab-btn:active {
  transform: scale(0.95);
}

.fab-btn .material-symbols-outlined {
  font-size: 1.6rem;
}

/* ---- Cards ---- */
.card {
  background: var(--surface-container-low);
  border-radius: 16px;
  overflow: hidden;
  transition: background 0.2s;
}

.card:hover {
  background: var(--surface-container);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Progress Bar ---- */
.progress-bar {
  height: 6px;
  background: var(--surface-container-highest);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s ease;
}

/* ---- Badges / Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chip-primary {
  background: rgba(176, 198, 255, 0.12);
  color: var(--primary);
}

.chip-secondary {
  background: rgba(64, 229, 108, 0.12);
  color: var(--secondary);
}

.chip-tertiary {
  background: rgba(250, 189, 0, 0.12);
  color: var(--tertiary);
}

.chip-error {
  background: rgba(147, 0, 10, 0.3);
  color: var(--error);
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 99px;
  padding: 0.6rem 1.5rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-outline {
  background: transparent;
  color: var(--on-surface-variant);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
  background: var(--surface-container);
  color: var(--on-surface);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.btn-ghost:hover {
  gap: 8px;
}

/* ---- Section Headers ---- */
.section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--on-surface-variant);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* ---- Divider via background only (no lines) ---- */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, var(--outline-variant), transparent);
  opacity: 0.2;
  margin: 2rem 0;
}

/* ---- XP / Stat Widgets ---- */
.stat-card {
  background: var(--surface-container);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stat-value {
  font-family: 'Manrope', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--on-surface);
  line-height: 1;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--outline);
  margin-top: 4px;
}

/* ---- Ambient shadow ---- */
.shadow-ambient {
  box-shadow: var(--shadow-md);
}

.shadow-primary {
  box-shadow: var(--shadow-primary);
}

.shadow-tertiary {
  box-shadow: 0 8px 24px rgba(250, 189, 0, 0.15);
}

/* ---- Animations ---- */
@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(176, 198, 255, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(176, 198, 255, 0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-fade-up {
  animation: fadeInUp 0.4s ease forwards;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 50%, var(--surface-container) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ---- Material Icons config ---- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  #bottom-nav {
    display: block;
  }

  #chat-fab {
    bottom: 5.5rem;
  }

  .main-content {
    padding-bottom: 5rem;
  }
}

@media (max-width: 768px) {
  #topbar {
    padding: 0 1rem;
  }

  .topbar-desktop-nav {
    display: none;
  }
}

/* ---- Text selection ---- */
::selection {
  background: rgba(176, 198, 255, 0.25);
  color: var(--primary);
}

/* ---- Hover translate utility ---- */
.hover-lift {
  transition: transform 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
}

/* ---- Gradient text ---- */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), #6b95f3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Countdown timer ---- */
.countdown-box {
  background: var(--surface-container-high);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
  flex: 1;
}

.countdown-num {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--tertiary);
  line-height: 1;
}

.countdown-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--outline);
  margin-top: 3px;
}

/* ---- Site Footer ---- */
#site-footer {
  margin-left: var(--sidebar-width);
  background: var(--surface-container-lowest);
  border-top: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
}

#site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--tertiary), transparent);
  opacity: 0.4;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2.5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand .logo-text {
  font-size: 1.4rem;
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--outline);
  line-height: 1.7;
  margin-top: 0.75rem;
  max-width: 260px;
}

.footer-brand .footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.footer-col h4 {
  font-family: 'Manrope', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col ul li a {
  font-size: 0.82rem;
  color: var(--outline);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s, transform 0.2s;
}

.footer-col ul li a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

.footer-col ul li a .material-symbols-outlined {
  font-size: 0.95rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-bottom p {
  font-size: 0.72rem;
  color: var(--outline);
}

.footer-bottom .footer-socials {
  display: flex;
  gap: 0.5rem;
}

.footer-social-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--outline);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.footer-social-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.footer-social-btn .material-symbols-outlined {
  font-size: 1rem;
}

@media (max-width: 1024px) {
  #site-footer {
    margin-left: 0;
    padding-bottom: 5.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem 1.5rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   SIDEBAR OVERLAY FIX
   ============================================================ */
#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 80;
  display: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#sidebar-overlay.active {
  display: block;
}

/* ============================================================
   MOBILE SEARCH OVERLAY
   ============================================================ */
#search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  background: var(--surface-glass-97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 1rem 1.25rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  transform: translateY(-100%);
  transition: transform 0.25s ease;
}

#search-overlay.active {
  display: flex;
  transform: translateY(0);
}

#search-overlay input {
  flex: 1;
  background: var(--surface-container);
  border: 1px solid rgba(176, 198, 255, 0.2);
  border-radius: 99px;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  color: var(--on-surface);
  outline: none;
  font-family: 'Inter', 'Noto Sans Gujarati', sans-serif;
}

#search-overlay input::placeholder {
  color: var(--outline);
}

#search-overlay .search-close-btn {
  background: none;
  border: none;
  color: var(--outline);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 1.3rem;
}

/* topbar-search on mobile: only show icon, act as button to open overlay */
@media (max-width: 1024px) {
  .topbar-search {
    min-width: unset;
    padding: 0.4rem;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    justify-content: center;
    cursor: pointer;
  }

  .topbar-search input {
    display: none;
  }
}

/* ============================================================
   PREMIUM PROFILE PANEL (v3)
   ============================================================ */
#profile-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  right: 1.5rem;
  width: 360px;
  max-width: calc(100vw - 3rem);
  max-height: calc(100vh - var(--topbar-height) - 40px);
  z-index: 300;
  background: var(--surface-glass-97);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border-glass);
  border-radius: 28px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15), 0 10px 40px rgba(79, 70, 229, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-20px) scale(0.94);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#profile-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Panel Header with Gradient & Avatar */
.profile-panel-head {
  padding: 2.5rem 1.5rem 1.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.profile-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #818cf8 100%);
  z-index: 0;
}

.profile-panel-avatar {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-family: 'Manrope', sans-serif;
  font-weight: 950;
  font-size: 2rem;
  border: 4px solid var(--surface-bright);
}

.profile-panel-info {
  position: relative;
  z-index: 1;
}

/* Stats Hub Dashboard */
.profile-stats-hub {
  display: flex;
  background: var(--surface-container-low);
  margin: 0 1.25rem 1.25rem;
  padding: 1rem 0;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.stat-hub-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-hub-item .count {
  font-family: 'Manrope', sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--on-surface);
  line-height: 1.2;
}

.stat-hub-item .label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--outline);
  text-transform: uppercase;
}

.stat-hub-divider {
  width: 1px;
  background: var(--outline-variant);
  opacity: 0.3;
  margin: 4px 0;
}

/* Premium Navigation Tabs */
.profile-panel-body {
  flex: 1;
  padding: 0 1.25rem 1.25rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--outline-variant) transparent;
}

.profile-panel-body::-webkit-scrollbar {
  width: 4px;
}

.profile-panel-body::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 10px;
}

.profile-tabs-v2 {
  display: flex;
  gap: 8px;
  background: var(--surface-container);
  padding: 5px;
  border-radius: 16px;
  margin-bottom: 1.25rem;
}

.profile-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
}

.profile-tab-btn .material-symbols-outlined {
  font-size: 1.15rem;
}

.profile-tab-btn.active {
  background: var(--surface-bright);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Premium Field Styling */
.premium-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.premium-field label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--outline);
  letter-spacing: 0.04em;
  padding-left: 4px;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-container-low);
  border: 1.5px solid var(--outline-variant);
  border-radius: 14px;
  padding: 0 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-input-wrap:focus-within {
  border-color: var(--primary);
  background: var(--surface-bright);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}

.field-input-wrap .material-symbols-outlined {
  font-size: 1.1rem;
  color: var(--outline);
}

.field-input-wrap input,
.field-input-wrap select {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--on-surface);
  font-family: inherit;
}

/* Premium Save Button */
.save-btn-premium {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 14px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
  margin-top: 1rem;
  transition: all 0.3s;
}

.save-btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.4);
}

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

/* Premium Menu Items */
.profile-menu-v2 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item-v2 {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--on-surface-variant);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
  background: transparent;
  width: 100%;
  border: none;
  cursor: pointer;
  text-align: left;
}

.menu-item-v2:hover {
  background: var(--surface-container-high);
  color: var(--on-surface);
}

.menu-item-v2 .icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-divider-v2 {
  height: 1px;
  background: var(--outline-variant);
  opacity: 0.3;
  margin: 8px 12px;
}

/* Backdrop & Transitions */
#profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  display: none;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#profile-backdrop.active {
  display: block;
}

#topbar.scrolled~#profile-panel,
body.profile-open #profile-panel {
  top: calc(52px + 12px);
}

@media (max-width: 640px) {
  #profile-panel {
    top: 50% !important;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
    transform: translateY(-50%) scale(0.94);
    max-height: 85vh;
  }

  #profile-panel.open {
    transform: translateY(-50%) scale(1);
  }
}

/* ---- DYNAMIC COLORFUL CARD ENGINE (Testbook style) ---- */
.bg-primary\/10 {
  background-color: var(--primary-container) !important;
}

.bg-secondary\/10 {
  background-color: var(--secondary-container) !important;
}

.bg-tertiary\/10 {
  background-color: var(--tertiary-container) !important;
}

.bg-error\/10 {
  background-color: var(--error-container) !important;
}

/* Gorgeous semantic tints to cards in LIGHT MODE */
html:not(.dark) .card {
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

html:not(.dark) .card:has(.text-primary) {
  background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%) !important;
  border-bottom: 3px solid var(--primary) !important;
}

html:not(.dark) .card:has(.text-secondary) {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%) !important;
  border-bottom: 3px solid var(--secondary) !important;
}

html:not(.dark) .card:has(.text-tertiary) {
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%) !important;
  border-bottom: 3px solid var(--tertiary) !important;
}

html:not(.dark) .card:has(.text-error) {
  background: linear-gradient(145deg, #ffffff 0%, #fef2f2 100%) !important;
  border-bottom: 3px solid var(--error) !important;
}

/* ULTRA-PREMIUM COLORFUL GLASSMORPHISM OVERRIDES */
html:not(.dark) body.bg-surface {
  background: radial-gradient(at 0% 0%, #e0e7ff 0%, transparent 50%),
    radial-gradient(at 100% 0%, #fef3c7 0%, transparent 50%),
    radial-gradient(at 100% 100%, #d1fae5 0%, transparent 50%),
    radial-gradient(at 0% 100%, #fee2e2 0%, transparent 50%),
    #fdfdfe !important;
  background-attachment: fixed !important;
}

html:not(.dark) .card,
html:not(.dark) .bg-surface-container {
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  background-clip: padding-box;
}

/* ---- PREMIUM PHASE 4 ADDITIONS ---- */
.glass-v2 {
  background: var(--surface-container-low-glass) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid var(--border-glass) !important;
  box-shadow: var(--shadow-md);
}

.hover-premium {
  transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1) !important;
}

.hover-premium:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--primary) !important;
}

/* ═══════════════════════════════════════
   AI Chat Drawer (Premium)
   ════════════════════════════════════════ */
.chat-drawer {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 380px;
  max-height: 550px;
  background: rgba(var(--surface-container-highest-rgb, 28, 27, 31), 0.85);
  border: 1px solid var(--outline-variant);
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateY(30px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(25px) saturate(180%);
  overflow: hidden;
}

.chat-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary-container), transparent);
  border-bottom: 1px solid var(--outline-variant);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: radial-gradient(circle at top right, var(--primary-container), transparent 40%);
}

.msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  animation: slideInUp 0.3s ease-out;
}

.msg.ai {
  background: var(--surface-container-low);
  color: var(--on-surface);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--outline-variant);
}

.msg.user {
  background: var(--primary);
  color: var(--on-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.chat-input-area {
  padding: 20px;
  border-top: 1px solid var(--outline-variant);
  display: flex;
  gap: 12px;
  background: var(--surface-container-lowest);
}

.chat-input-area input {
  flex: 1;
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  border-radius: 16px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--on-surface);
  transition: all 0.3s;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-container-highest);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@media (max-width: 640px) {
  .chat-drawer {
    right: 15px;
    left: 15px;
    width: auto;
    bottom: 85px;
    height: 70vh;
  }
}

/* ════════════════════════════════════════════
   INFINITE QUIZ ENGINE — UI Styles
   ════════════════════════════════════════════ */

/* ── Overlay backdrop ── */
#quiz-engine-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#quiz-engine-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Quiz Shell card ── */
.quiz-shell {
  background: var(--surface-container-low);
  border-radius: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeInUp 0.3s ease;
}

/* ── Header row ── */
.quiz-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.quiz-stats-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.qz-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}

.qz-stat.correct {
  background: rgba(16, 185, 129, 0.12);
  color: var(--secondary);
}

.qz-stat.wrong {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

.qz-stat.xp {
  background: rgba(250, 189, 0, 0.12);
  color: var(--tertiary);
}

.qz-stat.streak {
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
  animation: pulse-glow 1.5s infinite;
}

/* ── Timer ── */
.quiz-timer {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(176, 198, 255, 0.1);
  color: var(--primary);
  letter-spacing: 0.06em;
  transition: all 0.3s;
}

.quiz-timer.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  animation: pulse-glow 0.8s infinite;
}

/* ── Question number ── */
.quiz-qnum {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--outline);
}

/* ── Question box ── */
.quiz-question-box {
  background: var(--surface-container);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--primary);
}

.quiz-question {
  font-family: 'Noto Sans Gujarati', 'Manrope', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.6;
}

/* ── Options grid ── */
.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-opt-btn {
  background: var(--surface-container);
  border: 2px solid var(--outline-variant);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  font-family: 'Noto Sans Gujarati', 'Inter', sans-serif;
  line-height: 1.4;
}

.quiz-opt-btn:hover:not(:disabled) {
  background: rgba(176, 198, 255, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.quiz-opt-btn.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--secondary);
  color: var(--secondary);
}

.quiz-opt-btn.wrong {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--error);
  color: var(--error);
}

.quiz-opt-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

/* ── Feedback toast ── */
.quiz-feedback {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
  min-height: 36px;
}

.quiz-feedback.visible {
  opacity: 1;
}

.quiz-feedback.correct {
  background: rgba(16, 185, 129, 0.12);
  color: var(--secondary);
}

.quiz-feedback.wrong {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

/* ── Toolbar ── */
.quiz-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--outline-variant);
}

.quiz-skip-btn,
.quiz-close-btn {
  color: var(--outline);
  font-size: 0.75rem;
}

/* ── Result screen ── */
.quiz-result {
  align-items: center;
  text-align: center;
}

.quiz-result-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.quiz-result-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--on-surface);
}

.quiz-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 0.5rem;
}

.quiz-result-card {
  background: var(--surface-container);
  border-radius: 14px;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.quiz-result-card div {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--on-surface);
  line-height: 1;
}

.quiz-result-card small {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--outline);
}

.quiz-accuracy-bar {
  width: 100%;
  margin-top: 0.75rem;
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }

  .quiz-result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quiz-shell {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .quiz-question {
    font-size: 0.95rem;
  }
}

/* ── Glass v2 / hover-premium (used on cards) ── */
.glass-v2 {
  background: var(--surface-container-low);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hover-premium {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-premium:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════
   AUTH MODAL
   ═══════════════════════════════════════════ */
.gk-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: gk-fade-in 0.18s ease;
}

@keyframes gk-fade-in {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.gk-auth-card {
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  animation: gk-slide-up 0.22s ease;
}

@keyframes gk-slide-up {
  from {
    transform: translateY(24px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.gk-auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.gk-auth-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--on-surface-variant);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}

.gk-auth-close:hover {
  background: var(--surface-container);
}

.gk-auth-tagline {
  font-size: 0.77rem;
  color: var(--on-surface-variant);
  margin-bottom: 1.4rem;
}

.gk-auth-tabs {
  display: flex;
  background: var(--surface-container);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.4rem;
}

.gk-auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.gk-auth-tab.active {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

.gk-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gk-auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gk-auth-field label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--on-surface-variant);
}

.gk-auth-field label .material-symbols-outlined {
  font-size: 1rem;
}

.gk-auth-field input {
  background: var(--surface-container);
  border: 1.5px solid var(--outline-variant);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--on-surface);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.gk-auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.gk-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gk-pass-wrap input {
  flex: 1;
  padding-right: 44px;
}

.gk-pass-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--on-surface-variant);
  display: flex;
  padding: 4px;
}

.gk-pass-toggle .material-symbols-outlined {
  font-size: 1.1rem;
}

.gk-auth-error {
  background: var(--error-container);
  color: var(--error);
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
}

.gk-auth-submit {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.18s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.38);
  font-family: inherit;
}

.gk-auth-submit:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.gk-auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gk-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1rem 0;
  color: var(--outline);
  font-size: 0.8rem;
}

.gk-auth-divider::before,
.gk-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--outline-variant);
}

.gk-auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  background: var(--surface-container-high);
  border: 1.5px solid var(--outline-variant);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.gk-auth-google:hover {
  background: var(--surface-container-highest);
  border-color: var(--primary);
}

.gk-auth-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gk-auth-footer {
  text-align: center;
  font-size: 0.74rem;
  color: var(--on-surface-variant);
  margin-top: 1rem;
}

/* Toast notification */
.gk-auth-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface-container-highest);
  color: var(--on-surface);
  padding: 11px 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999999;
  pointer-events: none;
  white-space: nowrap;
}

.gk-auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Loading spinner */
.gk-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gk-spin 0.65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes gk-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Guest Banner ── */
.gk-guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--primary-container), var(--surface-container-low));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

/* ---- Direct AI Support Styles ---- */
.chat-drawer {
  position: fixed;
  right: -420px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: var(--surface-glass-97);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-subtle);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.chat-drawer.open {
  right: 0;
}

.chat-header {
  padding: 1.25rem 1.5rem;
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg {
  padding: 0.875rem 1.125rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 85%;
  word-wrap: break-word;
}

.msg.ai {
  background: var(--surface-container-high);
  color: var(--on-surface);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--border-subtle);
}

.msg.user {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  box-shadow: var(--shadow-md);
}

.chat-input-area {
  padding: 1.25rem;
  background: var(--surface-container-lowest);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.75rem;
}

.chat-input-area input {
  flex: 1;
  background: var(--surface-dim);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

@media (max-width: 480px) {
  .chat-drawer {
    width: 100%;
    right: -100%;
  }
}

.msg.typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--outline);
  border-radius: 50%;
  animation: dot-pulse 1.5s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.chat-list {
  margin: 8px 0;
  padding-left: 20px;
}

.chat-list li {
  margin-bottom: 4px;
}

/* ==========================================================================
   PREMIUM MOCK TEST CARDS
   ========================================================================== */

.premium-card {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.dark .premium-card {
  background: var(--surface-container-low);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.premium-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.1);
}

.dark .premium-card:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  border-color: rgba(79, 70, 229, 0.4);
}

.card-icon-container {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  position: relative;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  transition: all 0.3s ease;
}

.premium-card:hover .card-icon-container {
  transform: scale(1.1) rotate(-5deg);
  background: var(--primary);
  border-color: var(--primary);
}

.premium-card:hover .card-icon-container .material-symbols-outlined {
  color: white;
}

/* Info Pills */
.mock-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1rem 0 1.5rem 0;
}

.mock-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--surface-container);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mock-pill .material-symbols-outlined {
  font-size: 16px;
}

/* Status Badges */
.card-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  z-index: 10;
}

.badge-free { background: #dcfce7; color: #166534; }
.badge-locked { background: #fef3c7; color: #92400e; }
.badge-pro { background: #f3e8ff; color: #6b21a8; }

.dark .badge-free { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.dark .badge-locked { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.dark .badge-pro { background: rgba(168, 85, 247, 0.15); color: #c084fc; }