/* ═══════════════════════════════════════════════════════════
   LEARN AND STUDY FORUM — Vivid Campus Theme
   Fonts: Playfair Display (display) + Inter (body)
   Palette: Warm cream · Coral · Electric Indigo · Emerald
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;0,800;0,900;1,700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ══════════════════════════════════
   1. DESIGN TOKENS
══════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:           #fdf8f3;
  --bg-alt:       #fff5ed;
  --card:         #ffffff;
  --card-hover:   #fffbf8;

  /* Brand Colors */
  --coral:        #ff6b35;
  --coral-light:  rgba(255, 107, 53, 0.12);
  --coral-glow:   rgba(255, 107, 53, 0.25);
  --indigo:       #6c3ce1;
  --indigo-light: rgba(108, 60, 225, 0.1);
  --emerald:      #00c9a7;
  --emerald-light:rgba(0, 201, 167, 0.12);
  --sun:          #fbbf24;
  --sun-light:    rgba(251, 191, 36, 0.15);

  /* Gradients */
  --gradient:         linear-gradient(135deg, #ff6b35 0%, #e840a0 50%, #6c3ce1 100%);
  --gradient-soft:    linear-gradient(135deg, #fff5ed 0%, #f3eeff 100%);
  --gradient-emerald: linear-gradient(135deg, #00c9a7 0%, #0891b2 100%);
  --gradient-sun:     linear-gradient(135deg, #fbbf24 0%, #f97316 100%);

  /* Accent (kept for compatibility with existing JS) */
  --accent:      #ff6b35;
  --accent-glow: rgba(255, 107, 53, 0.3);

  /* Text */
  --text-main: #1a1225;
  --text-dim:  #64748b;
  --text-muted:#94a3b8;

  /* Borders & Shadows */
  --border:        rgba(26, 18, 37, 0.08);
  --shadow-sm:     0 2px 8px rgba(26, 18, 37, 0.06);
  --shadow-md:     0 8px 24px rgba(26, 18, 37, 0.10);
  --shadow-lg:     0 20px 48px rgba(26, 18, 37, 0.14);
  --shadow-coral:  0 8px 32px rgba(255, 107, 53, 0.22);
  --shadow-indigo: 0 8px 32px rgba(108, 60, 225, 0.22);

  /* Radius */
  --r-sm:  10px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  32px;
  --r-pill:999px;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

/* ══════════════════════════════════
   2. RESET & BASE
══════════════════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  /* Subtle dot-grid texture */
  background-image: radial-gradient(circle, rgba(108,60,225,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}

/* Floating ambient blobs — pure CSS, no JS needed */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 12s ease-in-out infinite alternate;
}
body::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(255,107,53,0.13) 0%, transparent 70%);
  top: -120px; right: -100px;
}
body::after {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(108,60,225,0.12) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  animation-direction: alternate-reverse;
  animation-duration: 14s;
}

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════
   3. NAVBAR
══════════════════════════════════ */
.navbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 0 20px;
  gap: 16px;
  position: relative;
  z-index: 100;
  overflow-x: hidden;    /* block horizontal scroll from pill */
  overflow-y: visible;   /* allow dropdown to escape downward */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Frosted top strip */
.container.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(253,248,243,0.82);
  backdrop-filter: blur(16px);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  border-bottom: 1px solid var(--border);
  z-index: -1;
}

/* ══════════════════════════════════
   4. LOGO
══════════════════════════════════ */
.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
  text-align: center;
  position: relative;
  display: inline-block;
  font-style: italic;
}

.logo span {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ══════════════════════════════════
   5. NAV LINKS
══════════════════════════════════ */
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;           /* fill the full container row */
  max-width: 100%;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links li {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: var(--r-pill);
  position: relative;
  flex-shrink: 0;
  touch-action: manipulation;
}

/* Tighten on very small screens */
@media (max-width: 400px) {
  .nav-links { gap: 2px; padding: 5px 8px; }
  .nav-links a { width: 38px; height: 38px; font-size: 1rem; }
}

.nav-links a.active,
.nav-links a:hover {
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--shadow-coral);
  transform: scale(1.1);
}

/* ══════════════════════════════════
   6. DROPDOWN
══════════════════════════════════ */
.dropdown { position: relative; }
.dropdown-toggle { cursor: pointer !important; }

.dropdown-menu {
  display: none;
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-width: 210px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  list-style: none;
}

.dropdown-menu li { list-style: none; width: 100%; }

.dropdown-menu li a {
  width: 100%;
  height: auto;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s;
  border-radius: var(--r-md);
  border-left: none;
}

.dropdown-menu li a:hover,
.dropdown-menu li a.active {
  background: var(--coral-light);
  color: var(--coral);
  transform: translateX(4px);
}

.dropdown-menu.show { display: block !important; }

/* ══════════════════════════════════
   6b. NAV BLUR OVERLAY
   Appears behind the dropdown, blurs page content
══════════════════════════════════ */
.nav-blur-overlay {
  position: fixed;
  inset: 0;
  z-index: 99; /* below navbar (z-index:100) and dropdown (z-index:10001), above page */
  background: rgba(26, 18, 37, 0.30);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-blur-overlay.active {
  opacity: 1;
  pointer-events: auto;
}


/* Dropdown hover intentionally removed — JS handles open/close exclusively */


/* ══════════════════════════════════
   7. HERO SECTION
══════════════════════════════════ */
.hero {
  padding: 80px 0 60px;
}

.hero-content {
  max-width: 640px;
}

/* ══════════════════════════════════
   8. TYPOGRAPHY & HEADINGS
══════════════════════════════════ */
h1, h2, h3, .section-title {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.2px;
}

h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 700; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 32px;
  letter-spacing: -0.3px;
}

/* ══════════════════════════════════
   9. GLASS CARDS (now bright & warm)
══════════════════════════════════ */
.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Decorative top stripe on hover */
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 107, 53, 0.2);
  box-shadow: var(--shadow-lg), var(--shadow-coral);
}

.glass-card:hover::before {
  transform: scaleX(1);
}

/* ══════════════════════════════════
   10. STAT CARDS
══════════════════════════════════ */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 100px; height: 100px;
  background: var(--gradient);
  border-radius: 50%;
  opacity: 0.06;
  transition: transform 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
  transform: scale(1.5);
}

/* ══════════════════════════════════
   11. BADGE / PILL LABELS
══════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--gradient);
  color: #fff;
  margin-bottom: 12px;
}

/* Colourful badge variants by faculty */
.badge:nth-child(3n+1) { background: var(--gradient); }
.badge:nth-child(3n+2) { background: var(--gradient-emerald); }
.badge:nth-child(3n+3) { background: var(--gradient-sun); color: #1a1225; }

/* ══════════════════════════════════
   12. RESOURCE ITEMS
══════════════════════════════════ */
.res-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  padding: 9px 16px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.res-item:hover {
  background: var(--coral-light);
  border-color: var(--coral);
  color: var(--coral);
  transform: scale(1.04);
  box-shadow: 0 4px 16px var(--coral-glow);
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ══════════════════════════════════
   13. BUTTONS
══════════════════════════════════ */
.btn {
  padding: 13px 28px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  letter-spacing: 0.2px;
}

.btn-main {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 18px var(--coral-glow);
}

.btn-main:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 28px var(--coral-glow);
  filter: brightness(1.08);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--coral-glow);
}

/* ══════════════════════════════════
   14. GRID LAYOUTS
══════════════════════════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.exclusive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

/* ══════════════════════════════════
   15. FACULTY SECTIONS
══════════════════════════════════ */
.faculty-section { display: none; }
.faculty-section.active { display: block; }

.faculty-btn {
  border-radius: var(--r-pill) !important;
  padding: 10px 22px !important;
  font-size: 0.88rem !important;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.faculty-btn.btn-main {
  box-shadow: var(--shadow-coral);
}

/* ══════════════════════════════════
   16. MODAL
══════════════════════════════════ */
#material-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 37, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 20px;
}

#modal-content {
  background: var(--card);
  color: var(--text-main);
  border-radius: var(--r-xl);
  padding: 36px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ══════════════════════════════════
   17. LOADING TEXT
══════════════════════════════════ */
.loading-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}

/* Three bouncing dots — matches skeleton shimmer palette */
.loading-text::before,
.loading-text::after,
.loading-text > span.ld {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0.75;
  animation: ldBounce 1.1s ease-in-out infinite;
}
.loading-text::before { animation-delay: 0s; }
.loading-text::after  {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--coral);
  animation-delay: 0.18s;
}

@keyframes ldBounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: 0.45; }
  40%            { transform: translateY(-7px); opacity: 1;    }
}

/* Skeleton-based loading rows (used instead of loading-text where possible) */
.loading-skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}
.loading-skeleton-rows .skeleton {
  height: 52px;
  border-radius: var(--r-md, 12px);
}

/* Notification skeleton rows — slimmer */
.notif-skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}
.notif-skeleton-rows .sk-line {
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.08) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.notif-skeleton-rows .sk-line.short { width: 55%; }
.notif-skeleton-rows .sk-line.full  { width: 100%; }

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

/* ══════════════════════════════════
   18. PROFILE PHOTO
══════════════════════════════════ */
.profile-photo-container {
  width: 150px;
  height: 150px;
  margin: 0 auto 20px;
  border-radius: 50%;
  padding: 4px;
  background: var(--gradient);
  box-shadow: var(--shadow-coral);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg);
}

/* ══════════════════════════════════
   19. FOOTER
══════════════════════════════════ */
footer {
  margin-top: 100px;
  padding: 72px 0 36px;
  background: var(--text-main);
  border-radius: 40px 40px 0 0;
  position: relative;
  overflow: hidden;
}

/* Decorative blob inside footer */
footer::before {
  content: '';
  position: absolute;
  top: -100px; right: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(255,107,53,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

footer .logo {
  color: #fff;
}

footer p, footer a, footer li, footer .footer-section * {
  color: rgba(255,255,255,0.55) !important;
}

footer a:hover {
  color: var(--coral) !important;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.footer-section h4 {
  color: #fff !important;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.3) !important;
  font-size: 0.78rem;
  letter-spacing: 1px;
}

/* ══════════════════════════════════
   20. NOTIFICATIONS / TOAST
══════════════════════════════════ */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  animation: toastSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.notification-content {
  background: var(--card);
  border: 1.5px solid var(--border);
  padding: 14px 20px;
  border-radius: var(--r-lg);
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.notification-success .notification-content { border-color: var(--emerald); }
.notification-error   .notification-content { border-color: #ef4444; }
.notification-info    .notification-content { border-color: var(--indigo); }

.notification-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-close:hover {
  background: var(--coral-light);
  color: var(--coral);
}

/* ══════════════════════════════════
   21. QUIZ PAGE OVERRIDES
══════════════════════════════════ */

/* Level cards */
.level-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
}

.level-card:hover {
  border-color: var(--coral);
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-coral);
}

.level-card.selected {
  border-color: var(--coral);
  background: var(--coral-light);
  transform: scale(1.04);
  box-shadow: var(--shadow-coral);
}

.level-card h4 { color: var(--text-main) !important; font-family: var(--font-display); }
.level-card span { color: var(--text-dim) !important; font-size: 0.78rem; }

/* Subject chips */
.subject-chip {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
}

.subject-chip:hover { border-color: var(--coral); background: var(--coral-light); }
.subject-chip.selected { border-color: var(--coral); background: var(--coral-light); }
.subject-chip .check-box { border-color: var(--border); }
.subject-chip.selected .check-box { background: var(--coral); border-color: var(--coral); }
.subject-chip .subject-name { color: var(--text-dim); }
.subject-chip.selected .subject-name { color: var(--text-main); font-weight: 600; }

/* Slider */
input[type="range"]::-webkit-slider-thumb {
  background: var(--coral) !important;
  box-shadow: 0 0 12px var(--coral-glow) !important;
}

input[type="range"] {
  background: rgba(26,18,37,0.08) !important;
}

/* Quiz option buttons */
.option-btn {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-dim);
  border-radius: var(--r-lg) !important;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--coral) !important;
  background: var(--coral-light) !important;
  color: var(--coral) !important;
}

.option-btn.correct {
  border-color: var(--emerald) !important;
  background: var(--emerald-light) !important;
  color: #0a7a65 !important;
}

.option-btn.correct .opt-label {
  background: var(--emerald) !important;
  border-color: var(--emerald) !important;
  color: #fff !important;
}

.option-btn.wrong {
  border-color: #ef4444 !important;
  background: rgba(239,68,68,0.08) !important;
  color: #dc2626 !important;
}

.option-btn.wrong .opt-label {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

/* Progress bar */
.progress-bar-track {
  background: rgba(26,18,37,0.08) !important;
}

.progress-bar-fill {
  background: var(--gradient) !important;
}

/* Breadcrumb */
.breadcrumb .crumb { color: var(--text-muted) !important; }
.breadcrumb .crumb.active { color: var(--coral) !important; font-weight: 600; }
.breadcrumb .sep { color: var(--border) !important; }

/* Score badge */
.q-score-badge {
  background: var(--coral-light) !important;
  color: var(--coral) !important;
  font-weight: 700;
}

/* Explanation box */
.explanation-box {
  background: var(--bg-alt) !important;
  border-left-color: var(--coral) !important;
  color: var(--text-dim) !important;
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* Gen spinner */
.gen-spinner {
  border-color: rgba(255,107,53,0.15) !important;
  border-top-color: var(--coral) !important;
}

/* Toast (quiz page) */
.toast {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-md) !important;
}

.toast.error { border-color: #ef4444 !important; }
.toast.success { border-color: var(--emerald) !important; }

/* Result ring */
.result-ring::before { background: var(--card) !important; }

/* ══════════════════════════════════
   22. HERO PILL BADGE (inline in HTML)
══════════════════════════════════ */
/* Overrides the inline-style version used in hero */
.hero [style*="V3.0"],
.hero [style*="V3"],
div[style*="background: rgba(0, 255, 136"] {
  background: var(--coral-light) !important;
  color: var(--coral) !important;
}

/* ══════════════════════════════════
   23. RESPONSIVE — TABLET
══════════════════════════════════ */
@media (max-width: 768px) {
  .navbar { padding: 18px 0 14px; gap: 14px; }

  .logo { font-size: 1.5rem; }

  .nav-links {
    gap: 6px;
    padding: 6px 14px;
  }

  .nav-links a {
    width: 46px; height: 46px;
    font-size: 1.2rem;
  }

  /* Dropdown positioning is handled entirely by JS — no CSS override needed here */
  .dropdown-menu {
    min-width: 240px;
    border: 2px solid var(--coral);
  }

  .dropdown-menu li a {
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  .glass-card { padding: 22px; border-radius: var(--r-lg); }

  footer { border-radius: 28px 28px 0 0; padding: 56px 0 28px; }

  .notification {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
}

/* ══════════════════════════════════
   24. RESPONSIVE — MOBILE
══════════════════════════════════ */
@media (max-width: 480px) {
  .nav-links a { width: 42px; height: 42px; font-size: 1.1rem; }
  .glass-card { padding: 18px; border-radius: var(--r-md); }
  .btn { padding: 12px 22px; font-size: 0.88rem; }
  .bento-grid { grid-template-columns: 1fr; gap: 16px; }
  .exclusive-grid { grid-template-columns: 1fr; }
  footer { border-radius: 24px 24px 0 0; }
}

/* ══════════════════════════════════
   25. SCROLL BAR STYLING
══════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--coral), var(--indigo));
  border-radius: 99px;
}

/* ══════════════════════════════════
   26. SELECTION COLOR
══════════════════════════════════ */
::selection {
  background: var(--coral-light);
  color: var(--coral);
}

/* ══════════════════════════════════
   27. ACCESSIBILITY & MISC
══════════════════════════════════ */
body { -webkit-user-select: none; user-select: none; }
iframe { pointer-events: auto; }

/* Allow text selection in content areas */
.glass-card, .modal-content, p, h1, h2, h3, h4 {
  -webkit-user-select: text;
  user-select: text;
}

/* Focus styles for keyboard nav */
:focus-visible {
  outline: 2.5px solid var(--coral);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
/* ══════════════════════════════════
   28. SMOOTH THEME TRANSITION
   Prevents harsh flash when switching
══════════════════════════════════ */
html {
  transition: background-color 0.25s ease, color 0.25s ease;
}
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow, fill, stroke;
  transition-duration: 0.25s;
  transition-timing-function: ease;
}
/* Don't transition transforms/animations */
.logo span, .ripple, [class*="animate"], [class*="spinner"], [class*="skeleton"] {
  transition: none !important;
}

/* ══════════════════════════════════
   29. DARK THEME — CSS VARIABLES
   Applied to <html data-theme="dark">
══════════════════════════════════ */
[data-theme="dark"] {
  /* Backgrounds */
  --bg:          #0d0818;
  --bg-alt:      #150f28;
  --card:        #1c1535;
  --card-hover:  #231a42;

  /* Text */
  --text-main:  #ede8ff;
  --text-dim:   #9984c8;
  --text-muted: #5a4a7a;

  /* Borders & Shadows */
  --border:        rgba(237, 232, 255, 0.09);
  --shadow-sm:     0 2px 8px  rgba(0, 0, 0, 0.40);
  --shadow-md:     0 8px 24px rgba(0, 0, 0, 0.50);
  --shadow-lg:     0 20px 48px rgba(0, 0, 0, 0.65);
  --shadow-coral:  0 8px 32px rgba(255, 107, 53, 0.30);
  --shadow-indigo: 0 8px 32px rgba(108, 60, 225, 0.28);

  /* Tinted light variants */
  --coral-light:   rgba(255, 107, 53, 0.16);
  --coral-glow:    rgba(255, 107, 53, 0.28);
  --indigo-light:  rgba(108, 60, 225, 0.16);
  --emerald-light: rgba(0, 201, 167, 0.16);
  --sun-light:     rgba(251, 191, 36, 0.16);

  /* Soft gradient adjusts */
  --gradient-soft: linear-gradient(135deg, #1c1535 0%, #1a1540 100%);
}

/* ── Dark: body ambient glows ── */
[data-theme="dark"] body {
  background-image: radial-gradient(circle, rgba(108,60,225,0.11) 1px, transparent 1px);
}
[data-theme="dark"] body::before {
  background: radial-gradient(circle, rgba(255,107,53,0.09) 0%, transparent 70%);
}
[data-theme="dark"] body::after {
  background: radial-gradient(circle, rgba(108,60,225,0.10) 0%, transparent 70%);
}

/* ── Dark: navbar frosted glass ── */
[data-theme="dark"] .container.navbar::before {
  background: rgba(13, 8, 24, 0.88);
}
[data-theme="dark"] .nav-links {
  background: rgba(28, 21, 53, 0.72);
}

/* ── Dark: dropdown ── */
[data-theme="dark"] .dropdown-menu {
  background: var(--card);
  border-color: var(--border);
}

/* ── Dark: footer ── */
[data-theme="dark"] footer {
  background: var(--card) !important;
  border-top: 1px solid var(--border);
}

/* ── Dark: glass-card ── */
[data-theme="dark"] .glass-card {
  background: var(--card);
  border-color: var(--border);
}

/* ── Dark: notification toast ── */
[data-theme="dark"] .notification-content {
  background: var(--card);
  border-color: var(--border);
  color: var(--text-main);
}

/* ── Dark: input / select / textarea ── */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-alt) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted) !important;
}

/* ── Dark: scrollbar ── */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg);
}

/* ── Dark: quiz page stat/card overrides ── */
[data-theme="dark"] .level-card,
[data-theme="dark"] .subject-chip,
[data-theme="dark"] .skeleton-card {
  background: var(--card);
  border-color: var(--border);
}
[data-theme="dark"] .option-btn {
  background: var(--bg-alt) !important;
  border-color: var(--border) !important;
  color: var(--text-dim) !important;
}
[data-theme="dark"] .toast {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] .explanation-box {
  background: var(--bg-alt) !important;
  color: var(--text-dim) !important;
}

/* ── Dark: lsf-pro confirm sheet ── */
[data-theme="dark"] .lsf-confirm-sheet,
[data-theme="dark"] .courses-sheet {
  background: var(--card);
}

/* ── Dark: lsf-toast (pro notification) ── */
[data-theme="dark"] .lsf-toast {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] .toast-title {
  color: var(--text-main) !important;
}
[data-theme="dark"] .toast-msg {
  color: var(--text-dim) !important;
}

/* ══════════════════════════════════
   30. THEME TOGGLE FAB (floating — top right)
══════════════════════════════════ */
.lsf-theme-fab {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 9px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.2s, transform 0.2s;
  font-family: var(--font-body);
}
.lsf-theme-fab:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.04);
}
.lsf-theme-fab:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}
[data-theme="dark"] .lsf-theme-fab {
  background: rgba(28, 21, 53, 0.92);
  border-color: var(--border);
}

.lsf-theme-fab .toggle-track {
  width: 34px;
  height: 18px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  border: 1.5px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
[data-theme="dark"] .lsf-theme-fab .toggle-track {
  background: var(--gradient);
  border-color: transparent;
}
.lsf-theme-fab .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
[data-theme="dark"] .lsf-theme-fab .toggle-thumb {
  transform: translateX(16px);
}
.lsf-theme-fab .toggle-icon {
  font-size: 0.9rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .lsf-theme-fab {
    top: 12px;
    right: 12px;
    padding: 7px 12px;
    gap: 6px;
  }
  .lsf-theme-fab .toggle-track { width: 28px; height: 16px; }
  .lsf-theme-fab .toggle-thumb { width: 10px; height: 10px; }
  [data-theme="dark"] .lsf-theme-fab .toggle-thumb { transform: translateX(12px); }
}

/* Legacy nav toggle — hidden since we use FAB now */
.theme-toggle-li { display: none !important; }

/* ══════════════════════════════════
   31. NAV GREETING (student name)
══════════════════════════════════ */
.nav-greeting {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  letter-spacing: 0.1px;
  animation: greetingFade 0.6s ease;
}
@keyframes greetingFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.greeting-wave {
  font-size: 0.9rem;
}
.greeting-name {
  color: var(--text-main);
  font-weight: 700;
}
@media (max-width: 480px) {
  .nav-greeting { font-size: 0.72rem; padding: 4px 12px; }
}

/* ── Home page hero greeting (above hero heading) ── */
.hero-welcome-greeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 10px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  animation: greetingFade 0.7s ease;
}
.hero-welcome-greeting .greeting-wave { font-size: 1.05rem; }
.hero-welcome-greeting .greeting-name {
  color: var(--text-main);
  font-weight: 800;
}
[data-theme="dark"] .hero-welcome-greeting {
  background: var(--card);
  border-color: var(--border);
}
@media (max-width: 480px) {
  .hero-welcome-greeting { font-size: 0.82rem; padding: 8px 16px; }
}

/* ══════════════════════════════════
   32. NAV AVATAR (profile pic icon)
══════════════════════════════════ */
.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  /* default ring — JS overrides this with the role colour */
  box-shadow: 0 0 0 2.5px var(--role-none-a, #64748b), 0 0 0 4px var(--card);
  display: block;
  transition: box-shadow 0.4s ease;
}

/* ── Role notif modal dark fix ── */
.lsf-role-modal-box {
  background: var(--card);
  border-radius: 28px;
  max-width: 400px;
  width: 100%;
  padding: 36px 28px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  text-align: center;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lsf-role-modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 10px;
}
.lsf-role-modal-msg {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 24px;
}
/* ══════════════════════════════════════════════════════════════
   33. DARK THEME — MODALS, PDF VIEWER, NEWS, QUOTES
   Comprehensive overrides so every surface respects the theme
══════════════════════════════════════════════════════════════ */

/* ── Material modal & modal content ── */
[data-theme="dark"] #modal-content {
  background: var(--card) !important;
  color: var(--text-main) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55) !important;
}
[data-theme="dark"] #modal-content h3,
[data-theme="dark"] #modal-content h2,
[data-theme="dark"] #modal-content h4 {
  color: var(--text-main) !important;
}
[data-theme="dark"] #modal-content p {
  color: var(--text-dim) !important;
}
[data-theme="dark"] #modal-content .res-item {
  background: var(--bg-alt) !important;
  color: var(--text-dim) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] #modal-content .res-item:hover {
  background: var(--coral-light) !important;
  color: var(--coral) !important;
  border-color: var(--coral) !important;
}
[data-theme="dark"] #modal-content button:not(.btn) {
  color: var(--text-dim) !important;
}

/* The inline modal HTML uses background:#fff — override it */
[data-theme="dark"] #material-modal > div {
  background: var(--card) !important;
  color: var(--text-main) !important;
}

/* ── PDF viewer modal ── */
[data-theme="dark"] #pdf-viewer-modal {
  background: rgba(5, 2, 16, 0.9) !important;
}
[data-theme="dark"] #pdf-viewer-modal > div {
  background: var(--card) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] #pdf-viewer-modal > div > div:first-child {
  background: var(--card) !important;
  border-bottom-color: var(--border) !important;
}
[data-theme="dark"] #pdf-title {
  color: var(--text-main) !important;
}

/* ── News article modal (home page) ── */
[data-theme="dark"] #news-modal,
[data-theme="dark"] .news-modal,
[data-theme="dark"] [id*="news-modal"],
[data-theme="dark"] [class*="news-modal"] {
  background: rgba(5, 2, 16, 0.85) !important;
}
[data-theme="dark"] #news-modal > div,
[data-theme="dark"] .news-modal > div,
[data-theme="dark"] .news-modal-box,
[data-theme="dark"] .nm-box,
[data-theme="dark"] [class*="news-modal"] > div {
  background: var(--card) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}
/* News modal inner text elements */
[data-theme="dark"] .nm-title,
[data-theme="dark"] [class*="nm-title"],
[data-theme="dark"] .news-modal h2,
[data-theme="dark"] .news-modal h3 {
  color: var(--text-main) !important;
}
[data-theme="dark"] .nm-body,
[data-theme="dark"] .nm-content,
[data-theme="dark"] .news-modal p,
[data-theme="dark"] [class*="nm-body"] {
  color: var(--text-dim) !important;
}
[data-theme="dark"] .nm-header,
[data-theme="dark"] [class*="nm-header"] {
  background: var(--card) !important;
  border-bottom-color: var(--border) !important;
}
[data-theme="dark"] .nm-footer,
[data-theme="dark"] [class*="nm-footer"],
[data-theme="dark"] .nm-actions {
  background: var(--bg-alt) !important;
  border-top-color: var(--border) !important;
}
/* Comment list inside news modal */
[data-theme="dark"] .nm-comment,
[data-theme="dark"] [class*="comment-item"],
[data-theme="dark"] .comment-row {
  background: var(--bg-alt) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] .comment-author,
[data-theme="dark"] [class*="comment"] .author {
  color: var(--text-main) !important;
}
[data-theme="dark"] .comment-text,
[data-theme="dark"] [class*="comment"] .text {
  color: var(--text-dim) !important;
}
/* Comment input in modal */
[data-theme="dark"] .nm-comment-input,
[data-theme="dark"] [class*="comment-input"] {
  background: var(--bg-alt) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}

/* ── Quote / Daily quote section (home page) ── */
[data-theme="dark"] .quote-section,
[data-theme="dark"] .daily-quote,
[data-theme="dark"] [class*="quote-section"],
[data-theme="dark"] [id*="quote"],
[data-theme="dark"] .quote-card,
[data-theme="dark"] .quote-block,
[data-theme="dark"] [class*="quote-card"],
[data-theme="dark"] [class*="quote-block"] {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] .quote-text,
[data-theme="dark"] blockquote,
[data-theme="dark"] [class*="quote-text"],
[data-theme="dark"] [class*="quote"] q,
[data-theme="dark"] [class*="quote"] p {
  color: var(--text-main) !important;
}
[data-theme="dark"] .quote-author,
[data-theme="dark"] [class*="quote-author"],
[data-theme="dark"] [class*="quote"] cite {
  color: var(--text-dim) !important;
}

/* ── Role notification modal ── */
[data-theme="dark"] #role-notif-modal {
  background: rgba(5, 2, 16, 0.85) !important;
}
[data-theme="dark"] .lsf-role-modal-box {
  background: var(--card) !important;
  color: var(--text-main) !important;
}

/* ── Bottom nav dark ── */
[data-theme="dark"] .lsf-bottom-nav {
  background: rgba(13, 8, 24, 0.95) !important;
  border-top-color: var(--border) !important;
}
[data-theme="dark"] .bnav-item {
  color: var(--text-muted);
}
[data-theme="dark"] .bnav-item.active {
  color: var(--coral);
}
[data-theme="dark"] .bnav-badge {
  border-color: var(--bg) !important;
}

/* ── Courses sheet dark ── */
[data-theme="dark"] .courses-sheet {
  background: var(--card) !important;
}
[data-theme="dark"] .courses-sheet-title {
  color: var(--text-main) !important;
}
[data-theme="dark"] .courses-sheet-item {
  border-top-color: var(--border) !important;
  color: var(--text-main) !important;
}
[data-theme="dark"] .courses-sheet-item:active {
  background: var(--coral-light) !important;
}
[data-theme="dark"] .courses-sheet-info .name {
  color: var(--text-main) !important;
}
[data-theme="dark"] .courses-sheet-info .sub {
  color: var(--text-dim) !important;
}

/* ── Home page article/news cards ── */
[data-theme="dark"] .article-card,
[data-theme="dark"] .news-card,
[data-theme="dark"] [class*="article-card"],
[data-theme="dark"] [class*="news-card"] {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .article-card h2,
[data-theme="dark"] .article-card h3,
[data-theme="dark"] .news-card h2,
[data-theme="dark"] .news-card h3 {
  color: var(--text-main) !important;
}
[data-theme="dark"] .article-card p,
[data-theme="dark"] .news-card p {
  color: var(--text-dim) !important;
}

/* ── Stat cards and feature cards on home ── */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] [class*="stat-card"],
[data-theme="dark"] [class*="feature-card"] {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .stat-card *,
[data-theme="dark"] .feature-card * {
  color: var(--text-main);
}

/* ── Generic any modal with background:#fff inline ── */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"] {
  background: var(--card) !important;
  color: var(--text-main) !important;
}
/* But NOT iframes or media */
[data-theme="dark"] iframe[style*="background:#fff"],
[data-theme="dark"] img[style*="background:#fff"] {
  background: transparent !important;
}