/*
==============================================
* MYGURUKUL - STYLES
* Modern, kid/teen-friendly, warm scholarly palette
* Responsive, accessible, production-ready
==============================================
*/

/* ============================================
   CSS VARIABLES - THEME & DESIGN TOKENS
   ============================================ */
:root {
  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-devanagari: 'Noto Serif Devanagari', serif;
  
  /* Colors - Enhanced Warm Scholarly Palette */
  --saffron: #FF7700;
  --saffron-light: #FF9933;
  --saffron-dark: #E65C00;
  --indigo: #4B0082;
  --indigo-light: #6A0DAD;
  --indigo-dark: #3A0066;
  --warm-neutral: #8B7355;
  --warm-neutral-light: #A0896B;
  --warm-neutral-dark: #6B5A3F;
  
  /* Background Colors - Glassmorphism Ready */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-tertiary: #F1F3F5;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-glass-dark: rgba(255, 255, 255, 0.15);
  
  /* Text Colors */
  --text-primary: #000000;
  --text-secondary: #4a4a4a;
  --text-tertiary: #6C757D;
  
  /* Accent Colors */
  --accent-primary: var(--saffron);
  --accent-secondary: var(--indigo);
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  
  /* Glassmorphism Properties - Light Theme */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  --backdrop-blur: blur(12px);
  --backdrop-blur-strong: blur(20px);
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #141414;
  --text-primary: #FFFFFF;
  --text-secondary: #E0E0E0;
  --text-tertiary: #B0B0B0;
  --bg-glass: rgba(0, 0, 0, 0.7);
  --bg-glass-dark: rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(0, 0, 0, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 25%, #f1f3f5 50%, #e9ecef 75%, #ffffff 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(0, 0, 0, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #000000 0%, #0a0a0a 25%, #141414 50%, #1a1a1a 75%, #000000 100%);
  background-size: 400% 400%;
  color: #ffffff;
}

[data-theme="dark"] body::before {
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ============================================
   HEADER STYLES
   ============================================ */
.site-header {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-base);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .site-header {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}

[data-theme="dark"] .site-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: var(--text-xl);
  transition: transform var(--transition-fast);
}

.logo-container:hover {
  transform: scale(1.05);
}

.logo-img {
  height: 40px;
  width: auto;
}

.brand-name {
  background: linear-gradient(135deg, var(--saffron), var(--indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-primary);
  background: rgba(255, 119, 0, 0.1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.theme-toggle,
.mobile-menu-btn {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--glass-shadow);
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 119, 0, 0.3);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

.mobile-menu-btn svg {
  transition: transform var(--transition-fast);
}

.mobile-menu-btn.active svg {
  transform: rotate(90deg);
}

.mobile-menu-btn {
  display: none;
  z-index: 1001;
  position: relative;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Sidebar */
.nav-links.mobile-open {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
  border-left: 1px solid var(--glass-border);
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--space-3xl) var(--space-xl);
  gap: var(--space-md);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

[data-theme="dark"] .nav-links.mobile-open {
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.9);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Mobile Menu Close Button */
.mobile-menu-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  z-index: 1001;
  box-shadow: var(--glass-shadow);
}

.nav-links.mobile-open .mobile-menu-close {
  display: flex;
}

.mobile-menu-close:hover {
  background: var(--error);
  color: white;
  transform: rotate(90deg);
}

.mobile-menu-close svg {
  width: 24px;
  height: 24px;
}

/* Mobile Menu Links Styling */
.nav-links.mobile-open .nav-link {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-links.mobile-open .nav-link::after {
  display: none;
}

.nav-links.mobile-open .btn-logout {
  margin-top: var(--space-xl);
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--error);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.nav-links.mobile-open .btn-logout:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  min-height: calc(100vh - 200px);
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

.view-container {
  animation: fadeIn 0.3s ease;
}

.view-container.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   SCHOOL SELECTOR
   ============================================ */
.school-selector-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.school-selector-header h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.school-selector-header p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.search-box {
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  transition: all var(--transition-base);
  box-shadow: var(--glass-shadow);
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(255, 119, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
}

[data-theme="dark"] .search-box:focus-within {
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 119, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.9);
}

.search-box svg {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-base);
  color: var(--text-primary);
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-tertiary);
}

.schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.school-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.school-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, var(--saffron), var(--indigo));
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.school-card:hover::before {
  transform: scaleY(1);
}

.school-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
}

[data-theme="dark"] .school-card:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9);
}

.school-card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.school-card .school-id {
  font-size: var(--text-sm);
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.school-card .school-location {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ============================================
   ROLE SELECTION
   ============================================ */
.role-selection-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.role-selection-header h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
}

.role-selection-header p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.role-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.role-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 119, 0, 0.05), rgba(75, 0, 130, 0.05));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.role-card:hover::after {
  opacity: 1;
}

.role-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
}

[data-theme="dark"] .role-card:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9);
}

.role-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--saffron), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: var(--space-sm);
}

.role-card h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.role-card p {
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary,
.btn-secondary,
.btn-back {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 119, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 119, 0, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 119, 0, 0.3);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  position: relative;
  box-shadow: var(--glass-shadow);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-back {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-lg);
}

.btn-back:hover {
  color: var(--accent-primary);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.dashboard-header h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
}

.subtitle {
  color: var(--text-secondary);
  font-size: var(--text-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--saffron), var(--indigo));
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
}

[data-theme="dark"] .stat-card:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
}

.stat-icon {
  font-size: var(--text-3xl);
}

.stat-content h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--accent-primary);
}

.stat-content p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ============================================
   COURSES
   ============================================ */
.courses-section {
  margin-top: var(--space-3xl);
}

.courses-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xl);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.course-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--glass-shadow);
}

.course-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 119, 0, 0.03), rgba(75, 0, 130, 0.03));
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.course-card:hover::after {
  opacity: 1;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
}

[data-theme="dark"] .course-card:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9);
}

.course-thumbnail {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--saffron), var(--indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-4xl);
  position: relative;
  overflow: hidden;
}

.course-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-content h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.course-content p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  flex: 1;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-sm);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--indigo));
  transition: width var(--transition-base);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   MODULES
   ============================================ */
.module-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.module-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(135deg, var(--saffron), var(--indigo));
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.module-card:hover::before {
  transform: scaleY(1);
}

.module-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
}

[data-theme="dark"] .module-card:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
}

.module-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.module-card.completed {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.05);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.module-number {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(255, 119, 0, 0.1);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
}

.module-status {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
}

.module-status.completed {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.module-status.locked {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
}

/* ============================================
   QUIZ & ASSIGNMENT
   ============================================ */
.quiz-container,
.assignment-container {
  max-width: 800px;
  margin: 0 auto;
}

.question-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--glass-shadow);
}

.question-card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-lg);
}

.option {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--glass-shadow);
}

.option::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.option:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .option:hover {
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
}

.option.selected::before {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 4px white;
}

.option.selected {
  border-color: var(--accent-primary);
  background: rgba(255, 119, 0, 0.1);
}

.option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.option.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   FORUM
   ============================================ */
.forum-container {
  max-width: 1000px;
  margin: 0 auto;
}

.forum-post {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--glass-shadow);
}

.forum-post.pinned {
  border-color: var(--accent-primary);
  background: rgba(255, 119, 0, 0.05);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.post-author {
  font-weight: 600;
  color: var(--text-primary);
}

.post-date {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.post-content {
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.post-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  padding: var(--space-lg);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--glass-shadow);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--glass-shadow);
}

.modal-close:hover {
  background: var(--error);
  color: white;
}

/* ============================================
   CERTIFICATE
   ============================================ */
.certificate {
  text-align: center;
  padding: var(--space-3xl);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur-strong);
  -webkit-backdrop-filter: var(--backdrop-blur-strong);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.certificate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--saffron), var(--indigo));
}

.certificate h1 {
  font-size: var(--text-4xl);
  color: var(--indigo);
  margin-bottom: var(--space-xl);
  font-family: var(--font-devanagari);
}

.certificate h2 {
  font-size: var(--text-2xl);
  color: var(--saffron);
  margin-bottom: var(--space-lg);
}

.certificate p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.certificate-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-2xl);
}

/* ============================================
   TABS
   ============================================ */
.dashboard-tabs {
  display: flex;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--space-xl);
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  padding: var(--space-sm);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--glass-shadow);
}

.tab-btn {
  padding: var(--space-md) var(--space-xl);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  font-family: inherit;
  font-size: var(--text-base);
  position: relative;
  white-space: nowrap;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent-primary);
  transition: width var(--transition-base);
}

.tab-btn:hover {
  color: var(--accent-primary);
  background: rgba(255, 119, 0, 0.05);
}

.tab-btn.active {
  color: var(--accent-primary);
  background: rgba(255, 119, 0, 0.05);
}

.tab-btn.active::after {
  width: 100%;
}

.tab-content {
  display: none;
  margin-top: var(--space-2xl);
}

.tab-content.active {
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-4xl);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .site-footer {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: var(--space-sm);
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet Styles */
@media (max-width: 1024px) and (min-width: 769px) {
  .header-container {
    padding: 0 var(--space-lg);
  }

  .container {
    padding: 0 var(--space-lg);
  }

  .schools-grid,
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .role-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-tabs {
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .tab-btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .nav-links:not(.mobile-open) {
    display: none;
  }

  .header-container {
    padding: 0 var(--space-md);
  }

  .container {
    padding: 0 var(--space-md);
  }

  .main-content {
    padding: var(--space-xl) 0;
  }

  .school-selector-header h1,
  .role-selection-header h1,
  .dashboard-header h1 {
    font-size: var(--text-2xl);
    line-height: 1.2;
  }

  .school-selector-header p,
  .role-selection-header p {
    font-size: var(--text-base);
  }

  .schools-grid,
  .courses-grid,
  .role-cards {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .stat-card {
    padding: var(--space-lg);
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .stat-icon {
    font-size: var(--text-2xl);
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .dashboard-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    flex-wrap: nowrap;
    padding-bottom: var(--space-xs);
  }

  .dashboard-tabs::-webkit-scrollbar {
    height: 4px;
  }

  .dashboard-tabs::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-full);
  }

  .tab-btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .certificate-actions {
    flex-direction: column;
    gap: var(--space-md);
  }

  .certificate-actions button {
    width: 100%;
  }

  .search-box {
    padding: var(--space-sm) var(--space-md);
  }

  .search-box input {
    font-size: var(--text-sm);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .section-header button {
    width: 100%;
  }

  .modal-content {
    padding: var(--space-xl);
    max-width: 95vw;
    max-height: 90vh;
  }

  .course-thumbnail {
    height: 150px;
  }

  .role-card {
    padding: var(--space-xl);
  }

  .role-icon {
    width: 60px;
    height: 60px;
  }

  .role-card h2 {
    font-size: var(--text-xl);
  }

  .btn-primary,
  .btn-secondary {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
    width: 100%;
  }

  .class-code-input {
    flex-direction: column;
    width: 100%;
  }

  .class-code-input input,
  .class-code-input button {
    width: 100%;
  }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
  .header-container {
    padding: 0 var(--space-sm);
  }

  .container {
    padding: 0 var(--space-sm);
  }

  .main-content {
    padding: var(--space-lg) 0;
  }

  .school-selector-header h1,
  .role-selection-header h1,
  .dashboard-header h1 {
    font-size: var(--text-xl);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .modal-content {
    padding: var(--space-lg);
    max-width: 100vw;
    border-radius: var(--radius-md);
    margin: var(--space-md);
  }

  .school-card,
  .course-card,
  .role-card {
    padding: var(--space-lg);
  }

  .logo-img {
    height: 32px;
  }

  .brand-name {
    font-size: var(--text-lg);
  }

  .theme-toggle,
  .mobile-menu-btn {
    padding: var(--space-xs);
    width: 36px;
    height: 36px;
  }

  .nav-links.mobile-open {
    width: 280px;
    padding: var(--space-2xl) var(--space-lg);
  }

  .search-box {
    padding: var(--space-sm);
  }

  .search-box svg {
    width: 18px;
    height: 18px;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-primary);
  color: white;
  padding: var(--space-md);
  text-decoration: none;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   NEW COMPONENTS - ENHANCED FEATURES
   ============================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.class-code-input {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.class-code-input input {
  padding: var(--space-md);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--glass-shadow);
  color: var(--text-primary);
}

.student-signin-form,
.exam-generator-form {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--glass-shadow);
}

.student-signin-form label,
.exam-generator-form label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.student-signin-form input,
.exam-generator-form input,
.exam-generator-form select {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  box-shadow: var(--glass-shadow);
}

.student-signin-form input:focus,
.exam-generator-form input:focus,
.exam-generator-form select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 119, 0, 0.1);
  transform: translateY(-1px);
}

.student-signin-form input:hover,
.exam-generator-form input:hover,
.exam-generator-form select:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

.notes-section {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
  box-shadow: var(--glass-shadow);
}

.notes-section textarea {
  width: 100%;
  min-height: 200px;
  padding: var(--space-md);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  resize: vertical;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-primary);
  box-shadow: var(--glass-shadow);
}

.submission-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-base);
  box-shadow: var(--glass-shadow);
}

.submission-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.generated-exam {
  background: var(--bg-primary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.exam-question {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin: var(--space-lg) 0;
}

.at-risk-students {
  margin-top: var(--space-2xl);
}

.chart-container {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  box-shadow: var(--glass-shadow);
}

.chart-container canvas {
  max-width: 100%;
  height: auto;
}

.analytics-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* Modal enhancements */
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="number"],
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-base);
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  box-shadow: var(--glass-shadow);
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 119, 0, 0.1);
  transform: translateY(-1px);
}

.modal-content input:hover,
.modal-content select:hover,
.modal-content textarea:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

/* Enrollment link modal */
#enrollmentLinkInput {
  font-family: monospace;
  font-size: var(--text-sm);
  word-break: break-all;
}

/* Loading spinner */
#generateExamSpinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Copy button feedback */
#copyEnrollmentLink.copied {
  background: var(--success);
  color: white;
}

/* At-risk student card */
.at-risk-student-card {
  padding: var(--space-md);
  margin: var(--space-sm) 0;
  background: var(--bg-secondary);
  border-left: 4px solid var(--error);
  border-radius: var(--radius-md);
}

/* Enhanced forum markdown */
.forum-post .post-content strong {
  font-weight: 700;
  color: var(--text-primary);
}

.forum-post .post-content em {
  font-style: italic;
}

.forum-post .post-content a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.forum-post .post-content a:hover {
  color: var(--saffron-dark);
}

/* Responsive enhancements */
@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .class-code-input {
    flex-direction: column;
    width: 100%;
  }

  .class-code-input input,
  .class-code-input button {
    width: 100%;
  }

  .student-signin-form,
  .exam-generator-form {
    padding: var(--space-lg);
  }

  .chart-container canvas {
    width: 100%;
  }

  .modal-content {
    padding: var(--space-lg);
    max-width: 95vw;
  }
}

/* ============================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */
@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--saffron);
  animation: confetti 3s ease-out forwards;
  z-index: 10000;
}

/* Progress animation */
@keyframes progressPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.progress-fill.animating {
  animation: progressPulse 1s ease-in-out;
}

/* Badge animation */
@keyframes badgeBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: linear-gradient(135deg, var(--saffron), var(--indigo));
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  animation: badgeBounce 0.5s ease;
}

/* ============================================
   PDF VIEWER STYLES - Professional & Engaging
   ============================================ */
.pdf-viewer-modal {
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.pdf-viewer-modal.active {
  opacity: 1;
  visibility: visible;
}

.pdf-viewer-modal .modal-content {
  max-width: 95vw;
  width: 1000px;
  max-height: 95vh;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg-primary);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Ensure modal content background updates with theme */
[data-theme="dark"] .pdf-viewer-modal .modal-content {
  background: #000000 !important;
}

[data-theme="light"] .pdf-viewer-modal .modal-content,
:not([data-theme]) .pdf-viewer-modal .modal-content {
  background: #FFFFFF !important;
}

.pdf-viewer-header {
  background: linear-gradient(135deg, var(--saffron) 0%, var(--indigo) 100%);
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pdf-viewer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pdf-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.pdf-brand-info {
  display: flex;
  flex-direction: column;
}

.pdf-brand-name {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}

.pdf-brand-tagline {
  margin: 0;
  font-size: var(--text-sm);
  opacity: 0.9;
  font-weight: 400;
}

.pdf-viewer-close {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.pdf-viewer-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.pdf-viewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 3rem 4rem;
  background: var(--bg-secondary);
  position: relative;
  min-height: 500px;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Ensure viewer body background is correct in both themes */
[data-theme="dark"] .pdf-viewer-body {
  background: #0a0a0a !important;
}

[data-theme="light"] .pdf-viewer-body,
:not([data-theme]) .pdf-viewer-body {
  background: #fafafa !important;
}

/* PDF Document Styling */
.pdf-document {
  background: var(--bg-primary);
  padding: 4rem;
  margin: 0 auto;
  max-width: 800px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  position: relative;
}

/* Ensure backgrounds are correct in both themes */
[data-theme="dark"] .pdf-document {
  background: #000000 !important;
}

[data-theme="light"] .pdf-document,
:not([data-theme]) .pdf-document {
  background: #FFFFFF !important;
}

/* Ensure text opacity is always 1 for visibility */
.pdf-content,
.pdf-content * {
  opacity: 1 !important;
}

.pdf-document::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--saffron), var(--indigo));
}

.pdf-document-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  border-bottom: 3px solid var(--saffron);
  padding-bottom: 1rem;
  color: var(--text-primary);
}

/* Ensure title is visible in both themes */
[data-theme="dark"] .pdf-document-title {
  color: #FFFFFF !important;
}

[data-theme="light"] .pdf-document-title,
:not([data-theme]) .pdf-document-title {
  color: #000000 !important;
}

.pdf-document-subtitle {
  font-size: var(--text-lg);
  margin-bottom: 2rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Ensure subtitle is visible in both themes */
[data-theme="dark"] .pdf-document-subtitle {
  color: #E0E0E0 !important;
}

[data-theme="light"] .pdf-document-subtitle,
:not([data-theme]) .pdf-document-subtitle {
  color: #4a4a4a !important;
}

.pdf-document-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Ensure meta information background and text update with theme */
[data-theme="dark"] .pdf-document-meta {
  background: #0a0a0a !important;
  color: #E0E0E0 !important;
}

[data-theme="dark"] .pdf-document-meta strong {
  color: #FFFFFF !important;
}

[data-theme="light"] .pdf-document-meta,
:not([data-theme]) .pdf-document-meta {
  background: #F8F9FA !important;
  color: #4a4a4a !important;
}

.pdf-document-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-content {
  line-height: 1.8;
  color: var(--text-primary);
  font-size: var(--text-base);
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Ensure PDF content text is visible in both themes - base color */
[data-theme="dark"] .pdf-content {
  color: #FFFFFF !important;
}

[data-theme="light"] .pdf-content,
:not([data-theme]) .pdf-content {
  color: #000000 !important;
}

/* Ensure all child elements inherit the correct color */
[data-theme="dark"] .pdf-content *:not(a):not(code):not(pre) {
  color: inherit !important;
}

[data-theme="light"] .pdf-content *:not(a):not(code):not(pre),
:not([data-theme]) .pdf-content *:not(a):not(code):not(pre) {
  color: inherit !important;
}

/* Force all direct text elements in PDF content to be visible - unified colors */
[data-theme="dark"] .pdf-content p,
[data-theme="dark"] .pdf-content span,
[data-theme="dark"] .pdf-content div,
[data-theme="dark"] .pdf-content strong,
[data-theme="dark"] .pdf-content em,
[data-theme="dark"] .pdf-content b,
[data-theme="dark"] .pdf-content i,
[data-theme="dark"] .pdf-content h1,
[data-theme="dark"] .pdf-content h2,
[data-theme="dark"] .pdf-content h3,
[data-theme="dark"] .pdf-content h4,
[data-theme="dark"] .pdf-content h5,
[data-theme="dark"] .pdf-content h6 {
  color: #FFFFFF !important;
}

[data-theme="light"] .pdf-content p,
[data-theme="light"] .pdf-content span,
[data-theme="light"] .pdf-content div,
[data-theme="light"] .pdf-content strong,
[data-theme="light"] .pdf-content em,
[data-theme="light"] .pdf-content b,
[data-theme="light"] .pdf-content i,
[data-theme="light"] .pdf-content h1,
[data-theme="light"] .pdf-content h2,
[data-theme="light"] .pdf-content h3,
[data-theme="light"] .pdf-content h4,
[data-theme="light"] .pdf-content h5,
[data-theme="light"] .pdf-content h6,
:not([data-theme]) .pdf-content p,
:not([data-theme]) .pdf-content span,
:not([data-theme]) .pdf-content div,
:not([data-theme]) .pdf-content strong,
:not([data-theme]) .pdf-content em,
:not([data-theme]) .pdf-content b,
:not([data-theme]) .pdf-content i,
:not([data-theme]) .pdf-content h1,
:not([data-theme]) .pdf-content h2,
:not([data-theme]) .pdf-content h3,
:not([data-theme]) .pdf-content h4,
:not([data-theme]) .pdf-content h5,
:not([data-theme]) .pdf-content h6 {
  color: #000000 !important;
}

/* But allow links to have their own color */
[data-theme="dark"] .pdf-content a {
  color: #FF9933 !important;
}

[data-theme="light"] .pdf-content a,
:not([data-theme]) .pdf-content a {
  color: var(--saffron) !important;
}

.pdf-content h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--saffron-light);
}

[data-theme="dark"] .pdf-content h1 {
  border-bottom-color: var(--saffron-light) !important;
}

.pdf-content h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.pdf-content h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.pdf-content p {
  margin-bottom: 1.25rem;
  text-align: justify;
}

.pdf-content ul,
.pdf-content ol {
  margin: 1.25rem 0;
  padding-left: 2rem;
}

.pdf-content li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* Ensure list items are visible in both themes */
[data-theme="dark"] .pdf-content li {
  color: #FFFFFF !important;
}

[data-theme="light"] .pdf-content li,
:not([data-theme]) .pdf-content li {
  color: #000000 !important;
}

.pdf-content blockquote {
  border-left: 4px solid var(--saffron);
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
}

/* Ensure blockquotes are visible in dark mode */
[data-theme="dark"] .pdf-content blockquote {
  color: #E0E0E0 !important;
}

.pdf-content code {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--indigo);
}

/* Ensure code is visible in dark mode */
[data-theme="dark"] .pdf-content code {
  color: #FFFFFF !important;
  background: var(--bg-tertiary) !important;
}

.pdf-content pre {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 4px solid var(--indigo);
}

.pdf-content a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.pdf-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
}

.pdf-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.pdf-content th,
.pdf-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-tertiary);
  color: var(--text-primary);
}

/* Ensure table cells are visible in both themes */
[data-theme="dark"] .pdf-content th,
[data-theme="dark"] .pdf-content td {
  color: #FFFFFF !important;
}

[data-theme="light"] .pdf-content th,
[data-theme="light"] .pdf-content td,
:not([data-theme]) .pdf-content th,
:not([data-theme]) .pdf-content td {
  color: #000000 !important;
}

.pdf-content th {
  background: linear-gradient(135deg, var(--saffron-light), var(--indigo-light));
  color: white;
  font-weight: 600;
}

.pdf-content tr:hover {
  background: var(--bg-secondary);
}

.pdf-highlight {
  background: linear-gradient(120deg, rgba(255, 119, 0, 0.2) 0%, rgba(255, 119, 0, 0.2) 100%);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
}

.pdf-viewer-footer {
  background: var(--bg-secondary);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Ensure footer updates with theme */
[data-theme="dark"] .pdf-viewer-footer {
  background: #0a0a0a !important;
  color: #E0E0E0 !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="light"] .pdf-viewer-footer,
:not([data-theme]) .pdf-viewer-footer {
  background: #F8F9FA !important;
  color: #4a4a4a !important;
  border-top-color: rgba(0, 0, 0, 0.1) !important;
}

.pdf-footer-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pdf-separator {
  color: var(--text-tertiary);
}

.pdf-footer-watermark {
  opacity: 0.6;
  font-size: var(--text-xs);
}

/* Scrollbar styling for PDF viewer */
.pdf-viewer-body::-webkit-scrollbar {
  width: 10px;
}

.pdf-viewer-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.pdf-viewer-body::-webkit-scrollbar-thumb {
  background: var(--saffron);
  border-radius: var(--radius-full);
}

.pdf-viewer-body::-webkit-scrollbar-thumb:hover {
  background: var(--saffron-dark);
}

/* Watermark overlay for additional protection */

.pdf-document::after {
  content: 'MyGurukul - Confidential';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 3rem;
  color: rgba(255, 119, 0, 0.05);
  pointer-events: none;
  z-index: 1;
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
}

/* Loading state */
.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 1rem;
}

.pdf-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive PDF viewer */
@media (max-width: 768px) {
  .pdf-viewer-modal .modal-content {
    max-width: 100vw;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  .pdf-viewer-body {
    padding: 2rem 1.5rem;
  }

  .pdf-document {
    padding: 2rem 1.5rem;
  }

  .pdf-document-title {
    font-size: var(--text-2xl);
  }

  .pdf-viewer-header {
    padding: 1rem 1.5rem;
  }

  .pdf-viewer-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

