/* ========================================
   GLOBAL STYLES
   ======================================== */

/* Custom Properties (Design Tokens) */
:root {
  /* Colors */
  --bg: #f6f8fb;
  --card: #ffffff;
  --muted: #6b7786;
  --text: #0b1630;
  --brand: #2b6cff;
  --brand-2: #00aaff;
  --border: #e6edf6;
  --success: #2ecc71;
  --warn: #e67e22;
  --danger: #e74c3c;
  --hero-text: #ffffff;
  
  /* Extended Color Palette */
  --primary-blue: #3b82f6;
  --primary-purple: #8b5cf6;
  --light-blue: #0ea5e9;
  --navy: #1e293b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --red-500: #ef4444;
  --yellow-500: #eab308;
  --orange-500: #f97316;
  
  /* Gradients */
  --hero-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  --gradient-light: linear-gradient(135deg, #ffffff, var(--gray-50));
  --gradient-subtle: linear-gradient(145deg, #ffffff, var(--gray-50));
  --gradient-card: linear-gradient(180deg, var(--card), var(--gray-50), var(--card));
  
  /* Transitions & Animations */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slide: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 6px 18px rgba(11, 22, 48, 0.06);
  --shadow-xl: 0 10px 30px rgba(11, 22, 48, 0.08);
  --shadow-2xl: 0 18px 40px rgba(11, 22, 48, 0.06);
  --shadow-brand: 0 4px 12px rgba(43, 108, 255, 0.25);
  --shadow-brand-lg: 0 8px 25px rgba(43, 108, 255, 0.15);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 999px;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Layout */
  --sidebar-width: 60px;
  --sidebar-expanded-width: 260px;
  --container-max-width: 1200px;
}

/* Box sizing & reset */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  min-height: 100vh;
  background: 
    radial-gradient(1200px 800px at 70% -10%, rgba(43, 108, 255, 0.06), transparent),
    radial-gradient(800px 600px at 10% 10%, rgba(0, 170, 255, 0.04), transparent),
    var(--bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* ========================================
   HERO SECTION (Index Page Only)
   ======================================== */

.hero-section {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 60px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin: 0;
  opacity: 0.95;
  font-weight: 400;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .hero-section {
    padding: 40px 20px 60px;
  }
  
  .hero-icon {
    font-size: 3rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
}


/* ========================================
   LAYOUT & CONTAINERS
   ======================================== */

.container {
  width: clamp(320px, 94vw, 1200px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

@media (min-width: 1400px) {
  .container {
    width: calc(100% - 96px);
    max-width: none;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 12px;
  }
}

/* Grid layout for sidebar + content */
body.has-sidebar {
  display: grid;
  grid-template-columns: 60px 1fr;
  min-height: 100vh;
  transition: var(--transition-smooth);
}

body.has-sidebar.sidebar-expanded {
  grid-template-columns: 260px 1fr;
}

.main-content-area {
  grid-column: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Mobile: Completely hidden sidebar with hamburger menu */
@media (max-width: 768px) {
  body.has-sidebar {
    grid-template-columns: 0px 1fr; /* No space reserved for sidebar */
    overflow-x: hidden;
  }
  
  body.has-sidebar.sidebar-expanded {
    grid-template-columns: 0px 1fr; /* Keep no space reserved even when expanded */
  }
  
  body.has-sidebar .app-header.sidebar {
    width: 300px;
    padding: 20px 16px;
    font-size: 14px;
    transform: translateX(-100%); /* Completely hidden off-screen */
    transition: var(--transition-slide);
    z-index: 1001;
    position: fixed; /* Ensure it's positioned as overlay */
    grid-column: unset; /* Remove from grid system */
    left: 0;
    top: 0;
  }
  
  body.sidebar-expanded .app-header.sidebar {
    transform: translateX(0); /* Slide in from left */
  }
  
  /* Mobile hamburger button */
  .mobile-menu-toggle {
    display: block;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 1002;
    width: 48px;
    height: 48px;
    background: var(--gradient-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md), var(--shadow-inset);
    cursor: pointer;
    font-size: 18px;
    color: var(--primary-blue);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
  }
  
  .mobile-menu-toggle:hover {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-200));
    transform: scale(1.08) translateY(-1px);
    box-shadow: 
      0 6px 16px rgba(59, 130, 246, 0.2),
      0 1px 0 rgba(255, 255, 255, 0.9) inset;
    border-color: rgba(59, 130, 246, 0.3);
  }
  
  .mobile-menu-toggle:active {
    transform: scale(1.02);
    box-shadow: 
      0 2px 8px rgba(59, 130, 246, 0.15),
      0 1px 0 rgba(255, 255, 255, 0.7) inset;
  }
  
  .mobile-menu-toggle:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
  }
  
  /* Sidebar overlay for mobile */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 1000;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: var(--transition-slow);
  }
  
  body.sidebar-expanded .sidebar-overlay {
    display: block;
    opacity: 1;
  }
  
  .main-content-area {
    grid-column: 2; /* Content takes the second column (1fr) */
    min-width: 0;
    overflow-x: hidden;
    width: 100%; /* Take full width */
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 80px 16px 16px 16px; /* Top padding for hamburger button */
    box-sizing: border-box;
  }
  
  /* Hide the sidebar's internal toggle button on mobile */
  body.has-sidebar .app-header.sidebar .menu-toggle {
    display: none;
  }
  
  body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item .label {
    display: block; /* Show labels in mobile expanded mode */
  }
}

/* Desktop: Show sidebar normally, hide mobile hamburger */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .sidebar-overlay {
    display: none !important;
  }
  
  body.has-sidebar {
    grid-template-columns: 60px 1fr;
  }
  
  body.has-sidebar.sidebar-expanded {
    grid-template-columns: 260px 1fr;
  }
  
  body.has-sidebar .app-header.sidebar {
    transform: translateX(0) !important; /* Override mobile transform */
    position: fixed; /* Ensure it stays fixed on desktop too */
  }
  
  /* Show the sidebar's internal toggle button on desktop */
  body.has-sidebar .app-header.sidebar .menu-toggle {
    display: inline-flex;
  }
  
  .container {
    padding: 16px; /* Reset mobile padding */
  }
}


/* ========================================
   HEADER
   ======================================== */

.app-header {
  padding: 28px 20px 6px;
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.app-header .subtitle {
  color: var(--muted);
  margin-top: 6px;
  font-size: 16px;
}

.header-note {
  margin-top: 8px;
  color: #dbe9ff;
  opacity: 0.95;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}


/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

.app-header.sidebar {
  width: 100%;
  min-width: unset;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 20px 12px;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-right: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: 
    0 10px 40px rgba(59, 130, 246, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 1001;
  overflow-y: auto;
  overflow-x: hidden;
  transition: var(--transition-slow);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
  background: var(--gradient-card);
}

.app-header.sidebar h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: var(--navy);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: -0.025em;
}

.app-header.sidebar h1 a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.app-header.sidebar .subtitle,
.app-header.sidebar .header-note {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.app-header.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: calc(100vh - 120px);
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: visible;
}

.app-header.sidebar .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: var(--transition-fast);
}

.app-header.sidebar .menu-toggle:hover {
  background: linear-gradient(145deg, var(--gray-50), var(--gray-200));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

/* Sidebar collapsed/expanded states */
body.has-sidebar .app-header.sidebar {
  width: 60px;
}

body.sidebar-expanded .app-header.sidebar {
  width: 260px;
  padding: 24px 16px;
}

/* Hide title text when collapsed */
body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar h1 a {
  position: absolute;
  left: -9999px;
}

/* Sidebar nav items */
.app-header.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: transparent;
  position: relative;
  transition: var(--transition-normal);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}

.app-header.sidebar .nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
  opacity: 0;
  transition: opacity 200ms ease;
  border-radius: inherit;
}

.app-header.sidebar .nav-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.app-header.sidebar .nav-item:hover::before {
  opacity: 1;
}

.app-header.sidebar .nav-item:focus {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
  background: rgba(59, 130, 246, 0.05);
}

.app-header.sidebar .nav-item:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 6px rgba(59, 130, 246, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

/* Active state for current page */
.app-header.sidebar .nav-item.active,
.app-header.sidebar .nav-item[aria-current="page"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(147, 51, 234, 0.08));
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--primary, #3b82f6);
  font-weight: 600;
  box-shadow: 
    0 3px 8px rgba(59, 130, 246, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.app-header.sidebar .nav-item .icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  transition: var(--transition-normal);
  position: relative;
}

.app-header.sidebar .nav-item:hover .icon {
  color: var(--blue-600);
  transform: scale(1.1);
}

.app-header.sidebar .nav-item.active .icon,
.app-header.sidebar .nav-item[aria-current="page"] .icon {
  color: var(--blue-700);
  transform: scale(1.05);
}

.app-header.sidebar .nav-item .label {
  white-space: nowrap;
}

/* Hide labels when collapsed */
body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item .label {
  display: none;
}

body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item {
  justify-content: center;
  padding: 12px 8px;
  position: relative;
}

/* Tooltips for collapsed state */
body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
  pointer-events: none;
  z-index: 1000;
}

body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(4px);
}

/* Arrow for tooltip */
body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item::before {
  content: '';
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
  z-index: 1000;
}

body.has-sidebar:not(.sidebar-expanded) .app-header.sidebar .nav-item:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .app-header.sidebar,
  .app-header.sidebar .nav-item,
  .mobile-menu-toggle,
  .sidebar-overlay,
  body.has-sidebar .app-header.sidebar {
    transition: none;
  }
  
  .app-header.sidebar .nav-item:hover,
  .app-header.sidebar .nav-item:focus {
    transform: none;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,22,48,0.28);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

body.sidebar-expanded .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}


/* ========================================
   TYPOGRAPHY & UTILITY CLASSES
   ======================================== */

h2 {
  font-size: 1.05rem;
  margin: 0 0 8px 0;
}

p {
  color: #374151;
  line-height: 1.5;
  text-align: justify;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.trunc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.status {
  color: var(--muted);
  font-size: 12px;
}

.hint {
  margin-top: 6px;
}

.hint summary {
  cursor: pointer;
  color: var(--muted);
}


/* ========================================
   FORM ELEMENTS
   ======================================== */

label {
  color: var(--muted);
  font-size: 13px;
}

input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  background: var(--blue-50);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
}

input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(79, 121, 255, 0.15);
}


/* ========================================
   BUTTONS & INTERACTIVE COMPONENTS
   ======================================== */

.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  color: #fff;
}

.btn:hover {
  filter: brightness(1.08);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  padding: 6px 10px;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ========================================
   NAVIGATION ITEMS (Top Navbar)
   ======================================== */

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  margin: 0 var(--radius-md);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(15, 23, 36, 0.08);
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.04);
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1a1f2d);
  text-decoration: none;
  white-space: nowrap;
  transition: 
    transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 220ms ease,
    border-color 160ms ease;
  will-change: transform, box-shadow;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.09);
  border-color: rgba(43, 108, 255, 0.16);
}

.nav-item:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.06);
}

.nav-item:focus {
  outline: 2px solid rgba(43, 108, 255, 0.3);
  outline-offset: 2px;
  z-index: 1;
}

.nav-item.active {
  font-weight: 600;
  border-color: rgba(43, 108, 255, 0.3);
  box-shadow: 0 6px 16px rgba(43, 108, 255, 0.1);
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .nav-item {
    transition: none;
  }
  .nav-item:hover,
  .nav-item:focus,
  .nav-item:active {
    transform: none;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.04);
  }
}

@media (max-width: 768px) {
  .navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
  }

  .nav-item {
    padding: 10px 16px;
    font-size: 15px;
    margin: 0;
  }
}


/* ========================================
   CARDS & SURFACES
   ======================================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(11, 22, 48, 0.06);
}

.welcome-card {
  background: linear-gradient(145deg, #ffffff 0%, var(--blue-50) 100%);
  border: 1px solid rgba(43, 108, 255, 0.08);
  box-shadow: var(--shadow-xl);
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.welcome-card h2 {
  color: var(--brand);
  margin-top: 0;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.welcome-card h3 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.welcome-card p {
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1rem;
}

.quick-links {
  display: grid;
  gap: var(--space-xs);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: var(--space-lg);
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(15, 23, 36, 0.06);
  box-shadow: 0 8px 25px rgba(2, 6, 23, 0.08);
  font-weight: 600;
  transition: all 300ms cubic-bezier(.2,.9,.2,1);
  will-change: transform, box-shadow;
  gap: 8px;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(43, 108, 255, 0.02) 100%);
  opacity: 0;
  transition: opacity 300ms ease;
}

.link-card:hover::before {
  opacity: 1;
}

.link-icon {
  font-size: 2rem;
  margin-bottom: 4px;
  display: block;
  transition: transform 300ms ease;
}

.link-text {
  font-size: 0.9rem;
  line-height: 1.3;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.link-card:hover,
.link-card:focus {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.15);
  border-color: rgba(43,108,255,0.15);
}

.link-card:hover .link-icon {
  transform: scale(1.1) rotate(5deg);
}

.link-card:active {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 25px rgba(2,6,23,0.12);
}

.link-card:focus {
  outline: 3px solid rgba(43,108,255,0.12);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .link-card { transition: none; transform: none; }
  .link-icon { transition: none; }
}


/* ========================================
   TABLES
   ======================================== */

.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.drive-table {
  width: 100%;
  border-collapse: collapse;
}

.drive-table thead {
  background: #f3f6fb;
  position: sticky;
  top: 0;
  z-index: 2;
}

.drive-table th,
.drive-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef3fb;
  font-size: 14px;
}

.drive-table tbody tr:hover {
  background: rgba(11, 22, 48, 0.03);
}

.drive-table td .name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drive-table tr.hidden-collapse {
  display: none;
}


/* ========================================
   CONFIG & FORM LAYOUTS
   ======================================== */

.config .row {
  display: grid;
  gap: 8px;
  grid-template-columns: 220px 1fr;
  align-items: center;
  padding: 6px 0;
}

.config .row.actions {
  grid-template-columns: 1fr auto auto 1fr;
  gap: 10px;
}


/* ========================================
   FILTERS GRID
   ======================================== */

.filters .filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .filters .filters-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .filters .filters-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================
   FILE TREE & TABLE INTERACTIONS
   ======================================== */

.tree-toggle {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 5px solid transparent;
  border-left-color: #99b3ff;
  margin-right: 4px;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
  cursor: pointer;
  user-select: none;
}

tr[data-type="folder"][data-collapsed="false"] .tree-toggle {
  transform: rotate(90deg);
}

.indent {
  display: inline-block;
  width: var(--indent, 0px);
}


/* ========================================
   BADGES & CHIPS
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(11, 22, 48, 0.04);
}


/* ========================================
   PREVIEW PANEL (Modal-like floating view)
   ======================================== */

.preview {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(720px, calc(100vw - 36px));
  height: min(70vh, 640px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(11, 22, 48, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.preview.hidden {
  display: none;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.preview .title {
  font-weight: 600;
}

.preview iframe {
  flex: 1;
  width: 100%;
  border: 0;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  background: #0b1320;
}


/* ========================================
   FOOTER & MISC
   ======================================== */

.footer {
  text-align: center;
  color: var(--muted);
}

.message {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border: 1px solid rgba(255,255,255,0.02);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.message.small {
  font-size: 12px;
  padding: 8px 10px;
}

.charm {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(79, 121, 255, 0.08);
}

.file-icon {
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.3));
  margin-right: 8px;
  font-size: 16px;
}

/* ========================================
   COMMON PAGE COMPONENTS
   ======================================== */

/* Page title styling - used across all semester pages */
.page-title {
  text-align: center;
  margin: 48px 0;
  font-size: 2.5rem;
  font-weight: 600;
}

/* Page intro sections */
.page-intro {
  margin-bottom: 24px;
}

/* Table of Contents component */
.toc-accordion {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.toc-header {
  background: var(--card);
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.toc-header:hover {
  background: #f8f9fa;
}

.toc-header h4 {
  margin: 0;
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
}

.toc-toggle {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.toc-content {
  display: none;
  background: #fafbfc;
  padding: 16px;
  margin: 0;
  border-top: 1px solid var(--border);
}

.toc-content.show {
  display: block;
}

/* Status and result messages */
.live-results {
  color: #a0aec0;
  font-size: 0.9em;
  text-align: center;
  padding: 20px;
}

.search-stats {
  color: #68d391;
  font-size: 0.9em;
  float: right;
}

.cache-reload-link {
  color: #6b7280;
  font-size: 0.85em;
  text-decoration: none;
  margin-left: 8px;
}

.cache-reload-link:hover {
  text-decoration: underline;
}

/* Standard iframe sizing */
.semester-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 8px;
}

/* Loading spinner animation */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-top: 2px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error states */
.error-message {
  color: red;
  font-style: italic;
  padding: 8px 0;
}

/* Drive batch containers */
.drive-batch-container {
  margin-bottom: 24px;
}

.drive-list-wrapper {
  margin-top: 16px;
}

.drive-spinner {
  text-align: center;
  padding: 20px;
}

/* Mobile responsive for common components */
@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
    margin: 32px 0;
  }
  
  .toc-header {
    padding: 10px 12px;
  }
  
  .toc-content {
    padding: 12px;
  }
  
  .semester-iframe {
    height: 400px;
  }
}

/* ========================================
   COMMON BUTTON STYLES
   ======================================== */

/* Base button styles */
.btn-base {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-base:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Primary button style */
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  padding: 12px 16px;
  font-weight: 500;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e40af, #0284c7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 108, 255, 0.25);
}

/* Secondary button style */
.btn-secondary {
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  color: #0369a1;
  padding: 8px 12px;
}

.btn-secondary:hover {
  background: #0ea5e9;
  color: white;
  transform: translateY(-1px);
}

/* Small button variant */
.btn-small {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* Icon button style */
.btn-icon {
  background: none;
  color: #666;
  border: 1px solid #ddd;
  padding: 6px 8px;
  border-radius: 4px;
}

.btn-icon:hover {
  background: #f5f5f5;
  color: var(--brand);
  border-color: var(--brand);
}

/* Disabled button state */
.btn-base:disabled {
  background-color: #ccc !important;
  border-color: #ccc !important;
  color: #666 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Button group for spacing */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================
   FORM COMPONENTS CONSOLIDATION
   ======================================== */

/* Standard input styling */
.input-base {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-base:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.1);
}

/* Large input variant */
.input-large {
  font-size: 1.1rem;
  padding: 12px 16px;
}

/* Select styling */
.select-base {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

.select-base:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.1);
}

/* ========================================
   CARD COMPONENTS CONSOLIDATION  
   ======================================== */

/* Base card styles */
.card-base {
  background: var(--card);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

/* Standard card (existing) - enhanced */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(11, 22, 48, 0.06);
}

/* Welcome card variant */
.welcome-card {
  background: linear-gradient(145deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid rgba(43, 108, 255, 0.08);
  box-shadow: 0 10px 30px rgba(11, 22, 48, 0.08);
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

/* Drive/batch card variant - consolidated */
.drive-embed-card,
.batch-group {
  background: var(--card);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
}

.batch-group {
  padding: 12px;
  margin-bottom: 12px;
}

/* Card header patterns */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.card-header h2,
.card-header h3 {
  margin: 0;
}

/* Card hover effects */
.card:hover,
.card-base:hover {
  box-shadow: 0 8px 25px rgba(11, 22, 48, 0.1);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

/* Small card variant */
.card-small {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Spacing utilities */
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--muted); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.font-weight-normal { font-weight: 400; }
.font-weight-medium { font-weight: 500; }
.font-weight-semibold { font-weight: 600; }
.font-weight-bold { font-weight: 700; }

/* Display utilities */
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }

/* Border utilities */
.border-radius-small { border-radius: 4px; }
.border-radius-medium { border-radius: 8px; }
.border-radius-large { border-radius: 12px; }

/* Animation utilities */
.transition-all { transition: all 0.2s ease; }
.transition-fast { transition: all 0.15s ease; }
.transition-slow { transition: all 0.3s ease; }

/* Hover effects */
.hover-lift:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.hover-shadow:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

/* ========================================
   SEMESTER PAGE SPECIFIC STYLES
   ======================================== */

/* Drive search functionality */
.drive-search-bar {
  text-align: center;
  margin-bottom: 16px;
}

.drive-search-bar input {
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 320px;
}

/* Enhanced TOC styling for semester pages */
.toc-content li {
  margin: 4px 0;
}

.toc-content a {
  color: #2196f3;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.toc-content a:hover {
  background-color: #f0f8ff;
}

/* Drive list enhancements */
.drive-desc {
  color: #555;
  margin-bottom: 12px;
}

.drive-list-wrapper {
  position: relative;
  min-height: 120px;
}

.drive-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Popup button for drive actions */
.popup-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
}

.popup-btn:hover {
  background-color: #f0f0f0;
}

/* Drive folder toggles and nested structures */
.folder-toggle {
  cursor: pointer;
  margin-right: 8px;
  font-size: 1.1em;
  color: #2196f3;
}

.folder-name {
  font-weight: 600;
  color: #333;
}

.drive-list-nested {
  list-style: none;
  margin-left: 24px;
  padding-left: 0;
  border-left: 2px solid #eee;
}

.drive-file-link {
  color: #2196f3;
  text-decoration: none;
  font-weight: 500;
}

.drive-file-link:hover {
  text-decoration: underline;
}

.drive-list-error {
  color: #d32f2f;
  font-weight: 600;
  padding: 12px;
}

/* Mobile responsive for drive components */
@media (max-width: 768px) {
  .drive-search-bar input {
    width: 100%;
    max-width: 320px;
  }
  
  .folder-actions {
    gap: 2px;
  }
  
  .drive-list-nested {
    margin-left: 16px;
  }
}

/* ========================================
   BROWSE PAGE STYLES
   ======================================== */

/* Accordion components */
.semester-header h2,
.batch-header h3 {
  margin: 0;
  padding: 0;
}

.accordion-btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.accordion-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateX(2px);
}

.accordion-btn:active {
  background: rgba(0, 0, 0, 0.1);
}

.accordion-icon {
  margin-right: 12px;
  font-size: 14px;
  color: #666;
  transition: transform 0.2s ease;
  display: inline-block;
  width: 18px;
  text-align: center;
}

.semester-header .accordion-btn {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2196f3;
  padding: 8px 12px;
}

.batch-header .accordion-btn {
  font-size: 1.2rem;
  font-weight: 500;
  color: #333;
}

.semester-content,
.batch-content {
  overflow: hidden;
  transition: all 0.3s ease;
}

.semester-content[style*="display: none"],
.batch-content[style*="display: none"] {
  opacity: 0;
  max-height: 0;
}

/* Controls and buttons */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.accordion-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.control-btn {
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  color: #0369a1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.control-btn:hover {
  background: #0ea5e9;
  color: white;
  transform: translateY(-1px);
}

.control-btn:active {
  transform: translateY(0);
}

#loadNextBtn {
  padding: 12px 16px;
  background-color: #2196f3;
  color: white;
  border: 1px solid #2196f3;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.3s ease;
}

#loadNextBtn:hover {
  background-color: #1976d2;
}

#loadNextBtn:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.root-folder-btn,
.expand-btn {
  background: none;
  color: #666;
  border: 1px solid #ddd;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.root-folder-btn:hover,
.expand-btn:hover {
  background: #f5f5f5;
  color: #2196f3;
  border-color: #2196f3;
}

.expand-btn {
  padding: 4px 8px;
  font-size: 12px;
}

.subfolder-item .expand-btn {
  padding: 2px 6px;
  font-size: 10px;
}

/* Search and filter components */
.search-panel {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.search-row {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-row input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1.1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  min-width: 150px;
}

.depth-indicator {
  font-size: 0.8rem;
  color: #666;
  margin-left: 8px;
  padding: 2px 6px;
  background-color: #f0f0f0;
  border-radius: 3px;
}

.results-stats {
  margin-bottom: 16px;
  font-weight: 600;
  color: #666;
}

/* Content organization */
.semester-group {
  margin-bottom: 8px;
  padding-left: 16px;
}

.semester-group h2 {
  margin: 0 0 4px 0;
  color: #2196f3;
  display: block;
  width: 100%;
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.batch-header h3 {
  margin: 0;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 4px;
  display: block;
  width: 100%;
}

/* File and folder lists */
.files-list,
.drive-list,
.subfolder-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drive-list {
  padding-left: 0;
}

.subfolder-list {
  padding-left: 20px;
  margin: 8px 0;
  border-left: 2px solid #eee;
}

.subfolder-list .subfolder-list {
  padding-left: 15px;
  border-left: 1px solid #ddd;
}

.drive-list-item {
  padding: 8px 0 8px 20px;
  border-bottom: 1px solid #eee;
  font-size: 1rem;
}

.subfolder-item {
  padding: 4px 0;
  font-size: 0.9rem;
}

/* File and folder items */
.file-item {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background: #f1f3f4;
}

.folder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subfolder-item .folder-item {
  margin: 2px 0;
}

.folder-actions {
  display: flex;
  gap: 4px;
}

.subfolder-item .folder-actions {
  gap: 2px;
}

/* Links and text */
.file-link,
.folder-link,
.result-link {
  text-decoration: none;
  color: #2196f3;
  font-weight: 500;
}

.folder-link {
  flex-grow: 1;
  color: #333;
}

.result-link {
  color: #333;
  display: flex;
  align-items: center;
  width: 100%;
}

.file-link:hover,
.folder-link:hover,
.result-link:hover {
  color: #2196f3;
  text-decoration: underline;
}

.result-link:hover .file-name {
  color: #2196f3;
  text-decoration: underline;
}

.subfolder-item a {
  text-decoration: none;
  color: #666;
}

.subfolder-item a:hover {
  color: #2196f3;
}

.file-name {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.file-meta,
.file-path {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.file-meta {
  font-size: 0.9rem;
}

/* Search results */
.search-results,
.tree-results {
  margin-top: 16px;
}

.search-result-item {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tree-file {
  margin: 2px 0;
}

/* Status messages */
.no-results {
  text-align: center;
  padding: 48px;
  color: #666;
  font-size: 1.1rem;
  font-style: italic;
}

.loading,
.error,
.empty {
  color: #999;
  font-style: italic;
  padding: 8px 0;
}

.error {
  color: #e74c3c;
}

/* Tree structure decorations */
.tree-folder:not(:first-child)::before,
.tree-file:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  width: 1px;
  background: #dee2e6;
  height: 100%;
}

/* Mobile responsive styles for browse page */
@media (max-width: 768px) {
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .accordion-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-row select {
    min-width: 100%;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ========================================
   TEACHERS PAGE STYLES
   ======================================== */

/* Teachers Page Header */
.teachers-page-header {
  text-align: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-xl);
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-xl);
}

.teachers-page-header h2 {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}

.teachers-page-header p {
  margin: 0 0 var(--space-lg) 0;
  opacity: 0.9;
  font-size: var(--font-size-lg);
  text-align: center;
  color: inherit;
}

/* Quick Navigation for Teachers Page */
.quick-nav-teachers {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.quick-nav-teachers h4 {
  margin: 0 0 var(--space-md) 0;
  color: white;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

.subject-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.subject-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: white;
  transition: var(--transition-normal);
  backdrop-filter: blur(5px);
}

.subject-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.subject-nav-btn .subject-code {
  font-family: 'Courier New', monospace;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.subject-nav-btn .subject-name {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-align: center;
  line-height: 1.2;
}

/* Mobile responsive for teacher page */
@media (max-width: 768px) {
  .quick-nav-teachers {
    padding: var(--space-md);
  }
  
  .subject-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
  }
  
  .subject-nav-btn {
    padding: var(--space-sm);
  }
  
  .subject-nav-btn .subject-name {
    font-size: 10px;
  }
}

/* Teachers Filters */
.teachers-filters {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.teachers-filters-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.teachers-filters-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  align-items: end;
}

.teachers-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.teachers-filter-group label {
  font-weight: var(--font-weight-medium);
  color: var(--gray-700);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.teachers-filter-group select {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: var(--font-size-base);
  transition: var(--transition-fast);
  cursor: pointer;
}

.teachers-filter-group select:hover {
  border-color: var(--primary-blue);
}

.teachers-filter-group select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 150px;
}

.filter-group label {
  font-weight: var(--font-weight-medium);
  color: var(--gray-700);
  font-size: var(--font-size-sm);
}

.filter-dropdown {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: var(--font-size-base);
  transition: var(--transition-fast);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%23666' d='M6 8.5L2.5 5h7L6 8.5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: var(--space-xl);
}

.filter-dropdown:hover {
  border-color: var(--primary-blue);
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%233b82f6' d='M6 8.5L2.5 5h7L6 8.5z'/></svg>");
}

.filter-dropdown:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%233b82f6' d='M6 8.5L2.5 5h7L6 8.5z'/></svg>");
}

/* Reset Filters Button */
.reset-filters-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--gray-700);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reset-filters-btn:hover {
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
  color: var(--gray-800);
  border-color: var(--gray-400);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.reset-filters-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reset-filters-btn span {
  font-size: var(--font-size-base);
  transform: rotate(0deg);
  transition: transform var(--transition-fast);
}

.reset-filters-btn:hover span {
  transform: rotate(90deg);
}

/* Teachers Content Views */
.teachers-content-view {
  animation: fadeIn 0.3s ease;
}

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

/* Teachers Sections */
.teachers-section {
  margin-bottom: var(--space-2xl);
}

.teachers-section-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--gray-900);
  margin: 0 0 var(--space-lg) 0;
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--primary-blue);
  display: inline-block;
}

/* Teachers Semesters */
.teachers-semester {
  margin-bottom: var(--space-xl);
}

.teachers-semester-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--gray-800);
  margin: 0 0 var(--space-md) 0;
}

/* Teachers Courses Grid */
.teachers-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Teachers Course Cards */
.teachers-course-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.teachers-course-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.teachers-course-header {
  padding: var(--space-md);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.teachers-course-name {
  font-weight: var(--font-weight-semibold);
  color: var(--gray-900);
  font-size: var(--font-size-base);
}

.teachers-course-code {
  background: var(--primary-blue);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
  font-weight: var(--font-weight-medium);
}

.teachers-batch-name {
  background: var(--blue-100);
  color: var(--blue-700);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.teachers-semester-name {
  background: var(--gray-200);
  color: var(--gray-700);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* Teachers Lists */
.teachers-list {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.teachers-batch-group {
  margin-bottom: var(--space-md);
  border-left: 3px solid var(--blue-200);
  padding-left: var(--space-md);
}

.teachers-batch-header {
  margin-bottom: var(--space-sm);
}

.teachers-teacher-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.teachers-teacher-item {
  padding: var(--space-sm);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-blue);
  transition: var(--transition-fast);
  font-size: var(--font-size-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.teachers-teacher-item:hover {
  background: var(--blue-50);
  transform: translateX(2px);
}

/* Section tags for teachers */
.teachers-section-tag {
  background: var(--gray-100);
  color: var(--gray-600);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  min-width: 20px;
  text-align: center;
  margin-left: var(--space-sm);
  border: 1px solid var(--gray-200);
}

/* Position tags for faculty */
.teachers-position-tag {
  background: var(--blue-50);
  color: var(--blue-700);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--blue-200);
  margin-left: var(--space-sm);
}

/* Teacher info container for name and position */
.teachers-teacher-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.teachers-teacher-name {
  font-weight: var(--font-weight-medium);
}

/* Section title with position for teacher view */
.teachers-section-title-with-position {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: var(--space-md);
}

.teachers-section-title-with-position .teachers-section-title {
  margin: 0;
}

/* Teacher View Specific Styles */
.teachers-teacher-courses {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.teachers-batch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.teachers-batch-tag {
  background: var(--gray-50);
  color: var(--gray-700);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--gray-200);
  transition: var(--transition-fast);
  line-height: 1.2;
}

.teachers-batch-tag:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

/* New offering tag style for teacher view */
.teachers-offering-tag {
  background: var(--blue-50);
  color: var(--blue-700);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  margin: var(--space-sm);
  display: inline-block;
  border: 1px solid var(--blue-200);
  transition: var(--transition-fast);
  line-height: 1.2;
}

.teachers-offering-tag:hover {
  background: var(--blue-100);
  border-color: var(--blue-300);
}

/* Teachers Page Responsive Design */
@media (max-width: 768px) {
  .teachers-page-header {
    padding: var(--space-lg);
    text-align: left;
  }

  .teachers-page-header h2 {
    font-size: var(--font-size-2xl);
  }

  .teachers-filters-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .teachers-filters-bottom {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .filter-group {
    min-width: 100%;
  }

  .teachers-courses-grid {
    grid-template-columns: 1fr;
  }

  .teachers-course-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   1ST SEMESTER ENHANCED LAYOUT
   ======================================== */

/* Subjects Grid */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-2xl) 0;
}

/* Subject Cards */
.subject-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(43, 108, 255, 0.02) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.subject-card:hover::before {
  opacity: 1;
}

.subject-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(43, 108, 255, 0.2);
}

.subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.subject-code {
  background: var(--brand);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  font-family: 'Courier New', monospace;
}

.subject-icon {
  font-size: 2.5rem;
  opacity: 0.8;
  transition: transform var(--transition-normal);
}

.subject-card:hover .subject-icon {
  transform: scale(1.1) rotate(5deg);
}

.subject-card h3 {
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.subject-card p {
  color: var(--muted);
  font-size: var(--font-size-base);
  line-height: 1.5;
  margin-bottom: auto;
  flex-grow: 1;
  text-align: left;
  position: relative;
  z-index: 1;
}

.subject-meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.resource-count,
.question-count {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.resource-count {
  background: var(--blue-100);
  color: var(--blue-700);
}

.question-count {
  background: var(--green-100);
  color: var(--green-700);
}

/* Quick Navigation Section */
.quick-nav {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--gray-50);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  text-align: center;
}

.quick-nav h3 {
  margin: 0 0 var(--space-lg) 0;
  color: var(--text);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.nav-buttons {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-xl);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
  font-size: var(--font-size-base);
}

.nav-btn:hover {
  background: linear-gradient(135deg, #1e40af, #0284c7);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nav-btn .icon {
  font-size: 1.2rem;
}

/* Mobile Responsive for 1st Semester */
@media (max-width: 768px) {
  .subjects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
  }
  
  .subject-card {
    padding: var(--space-lg);
  }
  
  .subject-icon {
    font-size: 2rem;
  }
  
  .subject-card h3 {
    font-size: var(--font-size-lg);
  }
  
  .nav-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-btn {
    justify-content: center;
  }
  
  .quick-nav {
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
  }
}

/* ========================================
   SUBJECT PAGE STYLES (NEW)
   ======================================== */

/* Breadcrumb Navigation */
.breadcrumb {
  padding: var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb a:hover {
  text-decoration: underline;
  color: var(--brand-2);
}

.breadcrumb span {
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

/* Quick Actions Bar */
.quick-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-lg) 0;
  justify-content: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
  color: var(--blue-700);
  text-decoration: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--blue-200);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--blue-100), var(--blue-200));
  color: var(--blue-800);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-300);
}

.action-btn .icon {
  font-size: 1.2rem;
}

/* Course Information Grid */
.course-info {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-xl);
  align-items: start;
}

.course-details {
  background: var(--gray-50);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--brand);
}

.course-details p {
  margin: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--text);
}

.course-description {
  padding: var(--space-lg);
}

.course-description p {
  color: var(--gray-700);
  line-height: 1.6;
  text-align: left;
}

/* Resource Grid Layout */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.resource-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.resource-card h3 {
  color: var(--brand);
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.resource-card p {
  color: var(--muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
  text-align: left;
}

/* Question Banks Section */
.question-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--green-500);
}

.question-section h3 {
  color: var(--green-500);
  margin: 0 0 var(--space-lg) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.question-section h4 {
  color: var(--text);
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

.questions-container {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.question-set {
  margin-bottom: var(--space-lg);
}

.typed-questions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.question {
  background: var(--gray-50);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--blue-400);
  transition: var(--transition-fast);
}

.question:hover {
  background: var(--blue-50);
  border-color: var(--blue-500);
}

.question p {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  text-align: left;
}

.question strong {
  color: var(--brand);
  font-weight: var(--font-weight-semibold);
}

/* Topic Grid for Math Course */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.topic-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.topic-card h3 {
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.topic-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.topic-card li {
  padding: var(--space-xs) 0;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--font-size-sm);
}

.topic-card li:last-child {
  border-bottom: none;
}

/* Formula Section */
.formula-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--yellow-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--yellow-500);
}

.formula-section h3 {
  color: var(--yellow-700);
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.formula-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.formula-item {
  background: var(--card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--yellow-200);
  font-family: 'Courier New', monospace;
  font-size: var(--font-size-sm);
  color: var(--text);
}

/* Practice Sets Grid */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.practice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.practice-card h3 {
  color: var(--brand);
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.practice-card p {
  color: var(--muted);
  margin-bottom: var(--space-md);
  text-align: center;
}

.practice-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.practice-link:hover {
  color: var(--brand-2);
  text-decoration: underline;
}

/* Communication Areas Grid */
.communication-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.comm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.comm-card h3 {
  color: var(--brand);
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.comm-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comm-card li {
  padding: var(--space-xs) 0;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--font-size-sm);
}

.comm-card li:last-child {
  border-bottom: none;
}

/* Template Section */
.template-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--blue-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--blue-500);
}

.template-section h3 {
  color: var(--blue-700);
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.template-item {
  background: var(--card);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--blue-200);
  font-size: var(--font-size-sm);
  color: var(--text);
}

.template-item strong {
  color: var(--blue-700);
  font-weight: var(--font-weight-semibold);
}

/* Assignment Section */
.assignment-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--purple-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--purple-500);
}

.assignment-section h3 {
  color: var(--purple-700);
  margin: 0 0 var(--space-lg) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

/* Skills Assessment */
.assessment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
}

.skill-card h3 {
  color: var(--brand);
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.skill-card p {
  color: var(--muted);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  text-align: center;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.5s ease;
}

/* Teachers Grid */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.teacher-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.teacher-card h3 {
  color: var(--brand);
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.teacher-card p {
  color: var(--muted);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  text-align: center;
}

.view-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.view-link:hover {
  color: var(--brand-2);
  text-decoration: underline;
}

/* Batch Navigation */
.batch-navigation {
  margin-top: var(--space-lg);
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.batch-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.batch-card h3 {
  color: var(--text);
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

.batch-link {
  color: var(--brand);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.batch-link:hover {
  color: var(--brand-2);
  text-decoration: underline;
}

/* Lab Section */
.lab-section {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--orange-500);
}

.lab-section h3 {
  color: var(--orange-600);
  margin: 0 0 var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.lab-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lab-section li {
  padding: var(--space-sm) 0;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--font-size-sm);
}

.lab-section li:last-child {
  border-bottom: none;
}

/* Case Study Section */
.case-study {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--green-500);
  box-shadow: var(--shadow-sm);
}

.case-study h3 {
  color: var(--green-600);
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.case-study p {
  color: var(--gray-700);
  margin: 0;
  font-size: var(--font-size-sm);
  text-align: left;
}

/* Mobile Responsive for Subject Pages */
@media (max-width: 768px) {
  .quick-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-btn {
    justify-content: center;
    text-align: center;
  }
  
  .course-info {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .resource-grid,
  .topic-grid,
  .practice-grid,
  .communication-grid,
  .teachers-grid,
  .assessment-grid {
    grid-template-columns: 1fr;
  }
  
  .batch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .formula-section,
  .template-section,
  .assignment-section,
  .question-section,
  .lab-section {
    padding: var(--space-md);
  }
}

/* ========================================
   COLLAPSIBLE SECTIONS (SUBJECT PAGES)
   ======================================== */

.collapsible-section {
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.collapsible-section:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(43, 108, 255, 0.1);
}

.section-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--blue-50) 100%);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border);
}

.section-header:hover {
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--blue-100) 100%);
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-content {
  padding: var(--space-lg);
  background: var(--card);
  transition: all 0.3s ease;
}

.toggle-icon {
  font-size: 1.2rem;
  color: var(--brand);
  transition: transform 0.3s ease;
  font-weight: bold;
}

.collapsible-subsection {
  margin-bottom: var(--space-md);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}

.subsection-header {
  background: var(--gray-50);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.subsection-header:hover {
  background: var(--gray-100);
}

.subsection-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.subsection-content {
  padding: var(--space-md);
  background: var(--card);
  border-top: 1px solid var(--gray-200);
}

.course-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.info-card {
  background: var(--gray-50);
  padding: var(--space-md);
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

.info-card h4 {
  margin: 0 0 var(--space-xs) 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.course-description {
  background: var(--blue-50);
  padding: var(--space-lg);
  border-radius: 8px;
  border-left: 4px solid var(--brand);
}

.course-description p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.resource-placeholder {
  background: var(--gray-50);
  padding: var(--space-lg);
  border-radius: 6px;
  border: 2px dashed var(--gray-300);
  text-align: center;
  color: var(--muted);
  font-style: italic;
  margin-top: var(--space-md);
}

.question-bank {
  background: var(--card);
  border-radius: 6px;
  padding: var(--space-md);
}

.question-bank p {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-lg);
  background: var(--gray-50);
  border-radius: 4px;
}

.question-item {
  background: var(--card);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  transition: all 0.3s ease;
}

.question-item:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(43, 108, 255, 0.1);
}

.question-item p {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
}

.question-item strong {
  color: var(--brand);
  font-weight: 600;
}

.question-bank-section {
  background: var(--gray-50);
  border-radius: 6px;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--brand);
}

.question-bank-section h4 {
  margin: 0 0 var(--space-sm) 0;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.question-bank-section p {
  margin: var(--space-xs) 0;
  line-height: 1.6;
  color: var(--text);
}

.test-bank-section {
  background: var(--blue-50);
  border-radius: 6px;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--blue-500);
}

.test-bank-section h4 {
  margin: 0 0 var(--space-sm) 0;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.test-bank-section p {
  margin: var(--space-xs) 0;
  line-height: 1.6;
  color: var(--text);
}

/* Mobile responsiveness for collapsible sections */
@media (max-width: 768px) {
  .section-header {
    padding: var(--space-sm) var(--space-md);
  }
  
  .section-header h2 {
    font-size: 1.1rem;
  }
  
  .section-content {
    padding: var(--space-md);
  }
  
  .subsection-header {
    padding: var(--space-xs) var(--space-sm);
  }
  
  .subsection-header h3 {
    font-size: 0.9rem;
  }
  
  .subsection-content {
    padding: var(--space-sm);
  }
  
  .course-info-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .info-card {
    padding: var(--space-sm);
  }
}
}