/* SelfStudy - Core Design System & Styling */
/* Google Fonts moved to HTML <head> for faster loading */

:root {
  /* 1. Main Background Colors (Student Eye-Friendly Midnight Navy Theme) */
  --bg-deep-black: #090D16;
  --bg-slate-navy: #0F172A;
  --bg-sidebar: #0D1322;
  --bg-sidebar-hover: #162035;
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-card: rgba(15, 23, 42, 0.65);
  --bg-glass-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);

  /* 2. Primary Accent Colors */
  --accent-cyan: #00F0FF;
  --accent-cyan-bright: #00e5ff;
  --accent-fuchsia: #e040fb;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;

  /* 3. Class-Wise Accent Colors */
  --class9-accent-start: #00e5ff;
  --class9-accent-end: #3b82f6;
  --class9-glow: rgba(0, 229, 255, 0.25);

  --class10-accent-start: #f59e0b;
  --class10-accent-end: #ef4444;
  --class10-glow: rgba(245, 158, 11, 0.25);

  --class11-accent-start: #a855f7;
  --class11-accent-end: #ec4899;
  --class11-glow: rgba(168, 85, 247, 0.25);

  --class12-accent-start: #10b981;
  --class12-accent-end: #06b6d4;
  --class12-glow: rgba(16, 185, 129, 0.25);

  /* Typography & Eye-Friendly Text */
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Layout & Sidebar */
  --max-width: 1280px;
  --sidebar-width: 260px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* ========================================================= */
/* THEME CUSTOMIZATION SYSTEM (MIDNIGHT / CYBERPUNK / LIGHT) */
/* ========================================================= */

/* 1. Midnight Navy Theme (Default Dark) */
[data-theme="midnight"] {
  --bg-deep-black: #090D16;
  --bg-slate-navy: #0F172A;
  --bg-sidebar: #0D1322;
  --bg-sidebar-hover: #162035;
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-card: rgba(15, 23, 42, 0.65);
  --bg-glass-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --accent-cyan: #00F0FF;
}

/* 2. Dark Cyberpunk Theme (Neon & Electric Accents) */
[data-theme="cyberpunk"] {
  --bg-deep-black: #05050a;
  --bg-slate-navy: #0c0a1a;
  --bg-sidebar: #080614;
  --bg-sidebar-hover: #181230;
  --bg-glass: rgba(12, 10, 26, 0.85);
  --bg-glass-card: rgba(20, 15, 40, 0.75);
  --bg-glass-hover: rgba(40, 30, 70, 0.85);
  --border-glass: rgba(0, 255, 200, 0.2);
  --text-main: #ffffff;
  --text-muted: #a7a9be;
  --accent-cyan: #00ffcc;
  --accent-purple: #ff007f;
}

/* 3. Clean Light Theme (Eye-Friendly Light Mode) */
[data-theme="light"] {
  --bg-deep-black: #f8fafc;
  --bg-slate-navy: #ffffff;
  --bg-sidebar: #f1f5f9;
  --bg-sidebar-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-glass-card: #ffffff;
  --bg-glass-hover: #f1f5f9;
  --border-glass: rgba(0, 0, 0, 0.1);
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent-cyan: #2563eb;
  --accent-purple: #7c3aed;
}

/* Light Mode Card & Form Overrides */
[data-theme="light"] .placeholder-box,
[data-theme="light"] .class-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .modal-card,
[data-theme="light"] .chapter-item {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .form-input,
[data-theme="light"] #globalSearchInput {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .sidebar {
  background: #f1f5f9 !important;
  border-right-color: #e2e8f0 !important;
}

[data-theme="light"] .sidebar-link {
  color: #334155 !important;
}

[data-theme="light"] .sidebar-link:hover,
[data-theme="light"] .sidebar-link.active {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] th {
  color: #64748b !important;
}

[data-theme="light"] td {
  color: #0f172a !important;
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-deep-black);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Ambient Background Lights (Mesh Glow) */
.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mesh-ball {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.3;
  animation: floatLight 18s ease-in-out infinite alternate;
}

.mesh-ball-1 {
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, rgba(0, 240, 255, 0) 70%);
}

.mesh-ball-2 {
  top: 40%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-fuchsia) 0%, rgba(224, 64, 251, 0) 70%);
  animation-delay: -5s;
}

.mesh-ball-3 {
  bottom: -10%;
  left: 30%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--accent-pink) 0%, rgba(236, 72, 153, 0) 70%);
  animation-delay: -10s;
}

@keyframes floatLight {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 1rem 2rem;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-highlight {
  background: linear-gradient(135deg, var(--accent-cyan-bright), var(--accent-fuchsia));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-login {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-login:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  transform: translateY(-2px);
}

.btn-signup {
  background: linear-gradient(135deg, var(--accent-fuchsia), var(--accent-purple));
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.btn-signup:hover {
  box-shadow: 0 6px 25px rgba(224, 64, 251, 0.6);
  transform: translateY(-2px);
}

.btn-explore {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 1.5rem;
}

/* Google Login Button */
.btn-google-login {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.btn-google-login:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 1.2rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-glass);
}

.auth-divider span {
  padding: 0 10px;
  letter-spacing: 0.5px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-slate-navy);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.close-modal {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.form-submit {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
}

/* Hero Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1.2rem;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 30px;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Top Positioned Classes Section */
.top-classes-section {
  padding: 6.8rem 2rem 5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.main-section-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 80%, var(--accent-fuchsia) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 2rem;
}

/* 1x4 Horizontal Grid Layout for Academic Subjects */
.subjectsGridContainer {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 1.2rem !important;
}

@media (max-width: 1100px) {
  .subjectsGridContainer {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .subjectsGridContainer {
    grid-template-columns: 1fr !important;
  }
}

/* Class Card (Glassmorphism + Class Accents) */
.class-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transition: height 0.3s ease;
}

.class-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-glass-hover);
}

/* Class 9 Specific Styling */
.card-class-9::before {
  background: linear-gradient(90deg, var(--class9-accent-start), var(--class9-accent-end));
}
.card-class-9:hover {
  box-shadow: 0 15px 35px var(--class9-glow);
}
.card-class-9 .class-number {
  color: var(--class9-accent-start);
}
.card-class-9 .btn-explore {
  background: linear-gradient(135deg, var(--class9-accent-start), var(--class9-accent-end));
  color: #fff;
  box-shadow: 0 4px 15px var(--class9-glow);
}

/* Class 10 Specific Styling */
.card-class-10::before {
  background: linear-gradient(90deg, var(--class10-accent-start), var(--class10-accent-end));
}
.card-class-10:hover {
  box-shadow: 0 15px 35px var(--class10-glow);
}
.card-class-10 .class-number {
  color: var(--class10-accent-start);
}
.card-class-10 .btn-explore {
  background: linear-gradient(135deg, var(--class10-accent-start), var(--class10-accent-end));
  color: #fff;
  box-shadow: 0 4px 15px var(--class10-glow);
}

/* Class 11 Specific Styling */
.card-class-11::before {
  background: linear-gradient(90deg, var(--class11-accent-start), var(--class11-accent-end));
}
.card-class-11:hover {
  box-shadow: 0 15px 35px var(--class11-glow);
}
.card-class-11 .class-number {
  color: var(--class11-accent-start);
}
.card-class-11 .btn-explore {
  background: linear-gradient(135deg, var(--class11-accent-start), var(--class11-accent-end));
  color: #fff;
  box-shadow: 0 4px 15px var(--class11-glow);
}

/* Class 12 Specific Styling */
.card-class-12::before {
  background: linear-gradient(90deg, var(--class12-accent-start), var(--class12-accent-end));
}
.card-class-12:hover {
  box-shadow: 0 15px 35px var(--class12-glow);
}
.card-class-12 .class-number {
  color: var(--class12-accent-start);
}
.card-class-12 .btn-explore {
  background: linear-gradient(135deg, var(--class12-accent-start), var(--class12-accent-end));
  color: #fff;
  box-shadow: 0 4px 15px var(--class12-glow);
}

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

.class-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
}

.tag-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-weight: 600;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.subject-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.2rem;
}

.chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========================================================= */
/* STUDENT EYE-FRIENDLY RESPONSIVE SIDEBAR NAVIGATION MENU   */
/* ========================================================= */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1050;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.sidebar-nav-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.2rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
}

.sidebar-brand-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sidebar Menu List */
.sidebar-menu {
  list-style: none;
  padding: 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0.8rem 0.8rem 0.3rem 0.8rem;
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  position: relative;
}

.sidebar-icon {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: transform 0.25s ease;
}

/* Hovered Link Highlight */
.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-main);
  transform: translateX(4px);
}

.sidebar-link:hover .sidebar-icon {
  transform: scale(1.15);
}

/* Active Link Highlight */
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

/* Theme Accents for Active Link Sidebar */
.theme-c9 .sidebar-link.active {
  color: var(--class9-accent-start);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.25);
}
.theme-c9 .sidebar-link.active::before { background: var(--class9-accent-start); }

.theme-c10 .sidebar-link.active {
  color: var(--class10-accent-start);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.theme-c10 .sidebar-link.active::before { background: var(--class10-accent-start); }

.theme-c11 .sidebar-link.active {
  color: var(--class11-accent-start);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.theme-c11 .sidebar-link.active::before { background: var(--class11-accent-start); }

.theme-c12 .sidebar-link.active {
  color: var(--class12-accent-start);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.theme-c12 .sidebar-link.active::before { background: var(--class12-accent-start); }

/* Badge inside Sidebar Item */
.sidebar-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}

/* Fixed Bottom Sidebar Footer & Logout */
.sidebar-footer {
  padding: 1.2rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(9, 13, 22, 0.96);
  margin-top: auto;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.user-profile-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-logout:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Main Dashboard Body Container */
.main-dashboard-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 2rem;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* ========================================================= */
/* SUBJECT CHAPTER & TOPIC VIEWER WITH ACTION BAR            */
/* ========================================================= */
.subject-detail-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.subject-header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
}

.back-to-subjects-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.back-to-subjects-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateX(-3px);
}

.subject-viewer-layout {
  display: flex;
  gap: 1.5rem;
  min-height: calc(100vh - 180px);
}

/* Left Panel: Chapter & Topic Sidebar */
.chapters-sidebar-panel {
  width: 320px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.chapters-panel-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.chapter-header {
  padding: 0.8rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease;
}

.chapter-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chapter-topics-list {
  list-style: none;
  padding: 0.5rem 0.8rem 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topic-item {
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-size: 0.83rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-main);
  transform: translateX(3px);
}

.topic-item.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  font-weight: 700;
  border: 1px solid rgba(0, 240, 255, 0.25);
}

/* Right Panel: Content View Area */
.content-main-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Top Horizontal Action Bar (Video, Virtual Lab, Quiz) */
.content-horizontal-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-slate-navy);
  border: 1px solid var(--border-glass);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
}

.content-tab-btn {
  flex: 1;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.content-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.content-tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* Coming Soon Placeholder Cards */
.coming-soon-container {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.coming-soon-icon {
  font-size: 3.8rem;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.4));
}

.coming-soon-title {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.coming-soon-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.8rem;
}

/* ========================================================= */
/* FULL SCREEN QUIZ INTERFACE (NO-SCROLL 2x2 OPTIONS GRID)   */
/* ========================================================= */
.quiz-full-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-deep-black);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden; /* No outer scrollbar */
}

.quiz-full-overlay.active {
  opacity: 1;
  visibility: visible;
}

.quiz-top-bar {
  background: var(--bg-slate-navy);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
  flex-shrink: 0;
}

.quiz-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
}

.quiz-body-layout {
  display: flex;
  flex-grow: 1;
  height: calc(100vh - 65px);
  overflow: hidden;
}

/* Quiz Left Panel (Active Question View - Fits Viewport) */
.quiz-left-panel {
  flex-grow: 1;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  height: 100%;
}

.question-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.diff-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.diff-easy { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.diff-medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.diff-hard { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.4); }
.diff-extreme_hard { background: rgba(168, 85, 247, 0.2); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.4); }
.diff-nightmare { background: rgba(236, 72, 153, 0.2); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.4); }

.question-text-eng {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.question-text-hin {
  font-size: 1rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

/* 2x2 Options Grid (Two Options per Row) */
.options-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 Columns */
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.option-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s ease;
  min-height: 56px;
}

.option-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: var(--bg-sidebar-hover);
  transform: translateY(-2px);
}

.option-card.selected {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.option-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-card.selected .option-badge {
  background: var(--accent-cyan);
  color: #090D16;
}

/* Static Right Palette Panel */
.quiz-right-palette {
  width: 340px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-glass);
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  flex-shrink: 0;
  overflow-y: auto;
}

.palette-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

/* 25 Question Number Grid */
.palette-numbers-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 1.2rem;
}

.palette-btn {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.palette-btn:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.palette-btn.current {
  border: 2px solid var(--accent-cyan) !important;
  box-shadow: 0 0 12px var(--accent-cyan);
}

/* Palette Status Colors */
.palette-btn.answered {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.palette-btn.unanswered {
  background: #f59e0b !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
}

/* Palette Color Legend */
.palette-legend-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.answered { background: #10b981; }
.legend-dot.unanswered { background: #f59e0b; }
.legend-dot.not-visited { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); }
.legend-dot.current { border: 2px solid var(--accent-cyan); background: transparent; }

/* Responsive Quiz */
@media (max-width: 992px) {
  .options-grid-2x2 {
    grid-template-columns: 1fr; /* Single column on small mobile screens */
  }
  .quiz-body-layout {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }
  .quiz-right-palette {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-glass);
  }
}

/* Full-Screen Virtual Lab Portal Styles */
.lab-full-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #090d16;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lab-header-bar {
  height: 60px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lab-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lab-iframe-container {
  flex: 1;
  width: 100%;
  height: calc(100vh - 60px);
  background: #000000;
  border: none;
  overflow: hidden;
}

.lab-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* WhatsApp Floating Support Widget */
.whatsapp-float-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #ffffff;
  border-radius: 30px;
  padding: 0.75rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
  z-index: 999;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.6);
  color: #ffffff;
}

/* ========================================================= */
/* 📱 COMPREHENSIVE RESPONSIVE SYSTEM (DESKTOP / TABLET / MOBILE) */
/* ========================================================= */

/* Home Page Navigation Bar Mobile & Tablet Drawer System */
.home-nav-toggle-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.home-nav-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
}

/* 1. Laptops & Desktops (min-width: 993px) -> 100% PERFECT LAPTOP VIEW */
@media (min-width: 993px) {
  .home-nav-toggle-btn {
    display: none !important;
  }
  .home-nav-menu-wrapper {
    display: flex !important;
    align-items: center;
    gap: 2rem;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: var(--sidebar-width) !important;
    height: 100vh !important;
    transform: none !important;
    z-index: 1050 !important;
    display: flex !important;
  }

  .main-dashboard-content, .main-content {
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    padding: 2rem !important;
  }

  .mobile-sidebar-toggle, #mobileSidebarBackdrop {
    display: none !important;
  }
}

/* 2. Tablets & Smartphones (max-width: 992px) -> SLIDE-IN MOBILE DRAWER */
@media (max-width: 992px) {
  .home-nav-toggle-btn {
    display: flex !important;
  }

  .home-nav-menu-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(9, 13, 22, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1.2rem 1.5rem;
    flex-direction: column;
    gap: 1.2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 999;
  }

  .home-nav-menu-wrapper.active {
    display: flex !important;
  }

  .nav-links {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.8rem !important;
    align-items: flex-start !important;
  }

  .nav-link {
    display: block !important;
    width: 100% !important;
    padding: 0.65rem 1rem !important;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    font-size: 1rem !important;
  }

  .auth-buttons {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.8rem !important;
  }

  .auth-buttons .btn,
  .auth-buttons .theme-toggle-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
  }
  .dashboard-layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 270px !important;
    height: 100vh !important;
    z-index: 9999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5) !important;
  }

  .sidebar.active {
    transform: translateX(0) !important;
  }

  .main-dashboard-content, .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1.2rem !important;
  }

  .mobile-sidebar-toggle {
    display: flex !important;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
  }

  .subject-viewer-layout,
  .subject-detail-layout {
    flex-direction: column !important;
    gap: 1rem !important;
    min-height: auto !important;
  }

  .chapters-sidebar-panel {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 320px !important;
    overflow-y: auto !important;
  }

  .content-main-panel,
  .content-viewer-panel {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* 3D Lab Header Bar Mobile & Tablet Responsiveness */
  .lab-header-bar {
    height: auto !important;
    min-height: 52px !important;
    padding: 0.5rem 1rem !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .lab-title-group {
    font-size: 0.9rem !important;
    gap: 8px !important;
  }

  .lab-iframe-container {
    height: calc(100vh - 65px) !important;
  }

  /* Full Screen Quiz Overlay Mobile & Tablet Layout */
  .quiz-full-overlay {
    overflow-y: auto !important;
  }

  .quiz-top-bar {
    height: auto !important;
    min-height: 52px !important;
    padding: 0.5rem 1rem !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .quiz-timer-badge {
    font-size: 0.85rem !important;
    padding: 0.25rem 0.75rem !important;
  }

  .quiz-body-layout {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }

  .quiz-left-panel {
    width: 100% !important;
    padding: 1rem !important;
    height: auto !important;
    overflow: visible !important;
    flex-grow: 0 !important;
  }

  .options-grid-2x2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .option-card {
    padding: 0.8rem 1rem !important;
    min-height: 48px !important;
    font-size: 0.92rem !important;
  }

  .quiz-right-palette {
    width: 100% !important;
    border-left: none !important;
    border-top: 1px solid var(--border-glass) !important;
    padding: 1rem !important;
    height: auto !important;
    flex-shrink: 0 !important;
  }

  .palette-numbers-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
  }

  .palette-btn {
    height: 38px !important;
    font-size: 0.85rem !important;
  }
}

/* 3. Mobile Phones (max-width: 768px) */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .navbar-container {
    padding: 0.8rem 1rem !important;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-brand-logo {
    height: 36px !important;
  }

  .nav-title {
    font-size: 1.1rem !important;
  }

  .nav-actions {
    gap: 6px !important;
  }

  .btn {
    padding: 0.5rem 0.9rem !important;
    font-size: 0.82rem !important;
  }

  .classes-grid,
  .subjectsGridContainer,
  .features-grid,
  .placeholder-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .class-card {
    padding: 1.2rem !important;
  }

  .stats-summary-grid,
  .analytics-grid-4col {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem !important;
  }

  .usersTableWrapper,
  .table-responsive,
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quiz-top-bar {
    padding: 0.6rem 1rem !important;
    height: auto !important;
    min-height: 55px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .quiz-left-panel {
    padding: 1rem !important;
  }

  .question-text-eng {
    font-size: 1.05rem !important;
  }

  .question-text-hin {
    font-size: 0.9rem !important;
  }

  .options-grid-2x2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .option-card {
    padding: 0.75rem 1rem !important;
    min-height: 50px !important;
  }

  /* Subject Viewer Split Layout Stacking on Mobile & Tablet */
  .subject-header-nav {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 1rem !important;
  }

  .subject-header-nav > div {
    text-align: left !important;
  }

  .subject-viewer-layout,
  .subject-detail-layout {
    flex-direction: column !important;
    gap: 1rem !important;
    min-height: auto !important;
  }

  .chapters-sidebar-panel {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 320px !important;
    overflow-y: auto !important;
  }

  .content-main-panel,
  .content-viewer-panel {
    width: 100% !important;
    min-width: 0 !important;
  }

  .content-horizontal-bar {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .content-tab-btn {
    flex: 1 1 auto !important;
    min-width: 90px !important;
    padding: 0.65rem 0.8rem !important;
    font-size: 0.85rem !important;
    justify-content: center !important;
  }

  .modal-box, .modal-card {
    width: 92% !important;
    max-width: 440px !important;
    padding: 1.5rem !important;
    margin: 1rem auto !important;
  }

  .whatsapp-float-btn {
    bottom: 15px !important;
    right: 15px !important;
    padding: 0.65rem 1.1rem !important;
    font-size: 0.82rem !important;
  }
}

/* 4. Small Smartphones (max-width: 480px) */
@media (max-width: 480px) {
  .stats-summary-grid,
  .analytics-grid-4col {
    grid-template-columns: 1fr !important;
  }

  .lab-header-bar {
    padding: 0.4rem 0.8rem !important;
  }

  .quiz-top-bar {
    padding: 0.4rem 0.8rem !important;
  }

  .question-text-eng {
    font-size: 1rem !important;
  }

  .question-text-hin {
    font-size: 0.88rem !important;
  }

  .palette-numbers-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 5px !important;
  }

  .palette-btn {
    height: 34px !important;
    font-size: 0.8rem !important;
  }
}

/* ========================================================= */
/* 🤖 AI DOUBT SOLVER, REFERRAL & FORMULA PDF STYLES */
/* ========================================================= */

.floating-ai-tutor-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.4rem;
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.4);
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-ai-tutor-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 15px 35px rgba(224, 64, 251, 0.5);
}

.ai-doubt-modal-card {
  max-width: 680px !important;
  width: 92% !important;
}

.ai-chat-output-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-bubble {
  max-width: 88%;
  padding: 0.85rem 1.2rem;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.ai-bot-message {
  align-self: flex-start;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.ai-user-message {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.referral-code-card {
  background: rgba(236, 72, 153, 0.08);
  border: 2px dashed rgba(236, 72, 153, 0.4);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.referral-code-text {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ec4899;
  margin: 0.6rem 0;
  text-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

.stat-box-mini {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.formula-resource-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.formula-resource-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* 100% Full-Screen Virtual Lab Overlay System */
.lab-full-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  background: #090d16;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.lab-iframe-container {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  min-height: 100vh;
  position: relative;
  flex: 1;
  overflow-x: hidden !important;
}

.lab-iframe {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  min-height: 100vh;
  border: none;
  display: block;
}

.lab-floating-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 1000000;
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
  border: 1px solid #ef4444;
  padding: 0.45rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.lab-floating-close-btn:hover {
  background: #ef4444;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

/* Math Formulas & KaTeX Fraction Engine */
.math-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  padding: 0 0.25rem;
  font-family: 'Outfit', 'Cambria Math', 'Times New Roman', serif;
  font-size: 0.95em;
  line-height: 1.1;
}

.math-num {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 1px;
}

.math-denom {
  padding-top: 1px;
}

.katex {
  font-size: 1.1em !important;
  line-height: 1.2 !important;
}

.katex-display {
  margin: 0.5em 0 !important;
}

/* ========================================================= */
/* 📱 UNIVERSAL MOBILE & TABLET LANDSCAPE ORIENTATION ENGINE */
/* ========================================================= */
@media (orientation: landscape) and (max-height: 600px) {
  html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .lab-full-overlay {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
  }

  .lab-iframe-container {
    height: 100vh !important;
    max-height: 100vh !important;
  }

  .main-layout-container, .curriculum-grid-container {
    padding: 10px !important;
  }
}

/* ========================================================= */
/* ⚡ 60S FAST CONCEPT REELS & SHORTS MODAL STYLES          */
/* ========================================================= */
.reels-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.95);
  backdrop-filter: blur(20px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.reels-player-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 94vh;
  max-height: 820px;
  background: #090d16;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.15);
}

.reels-top-bar {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  flex-shrink: 0;
}

.reels-subject-pills {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(10, 15, 30, 0.8);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.reels-subject-pills::-webkit-scrollbar {
  display: none;
}

.reel-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.reel-pill:hover {
  color: #fff;
  border-color: rgba(0, 240, 255, 0.4);
}
.reel-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(168, 85, 247, 0.25));
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.reels-video-container {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel-iframe-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.reel-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
}

.reel-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 14px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 16, 0.75) 40%, rgba(5, 8, 16, 0.95) 100%);
  pointer-events: auto;
  z-index: 5;
  text-align: left;
}

.reels-side-controls {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

.reels-nav-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}
.reels-nav-arrow:hover {
  background: var(--accent-cyan);
  color: #090d16;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

.reel-card-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 15px 35px rgba(0, 240, 255, 0.3) !important;
}
.reel-card-item:hover img {
  transform: scale(1.05);
}

/* ========================================================= */
/* 📑 FULL-SCREEN SUBJECTIVE Q&A PORTAL STYLES              */
/* ========================================================= */
.subjective-full-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.98);
  backdrop-filter: blur(16px);
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.subjective-modal-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #090d16;
}

.subjective-modal-header {
  padding: 12px 24px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 10;
}

.subjective-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}


