/* ============================================
   KIIT CSE 3rd Semester Section Finder
   Premium University-Style Design System
   ============================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Primary Palette */
  --primary: #0056D2;
  --primary-light: #3378e0;
  --primary-dark: #003d99;
  --primary-bg: #e8f0fe;
  --primary-glow: rgba(0, 86, 210, 0.15);
  
  /* Accent */
  --accent: #00b894;
  --accent-light: #55efc4;
  
  /* Neutrals */
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #fafcff;
  --text: #1a1a2e;
  --text-secondary: #636e80;
  --text-muted: #9aa5b4;
  --border: #e2e8f0;
  --border-light: #f0f3f7;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
  --shadow-primary: 0 4px 20px rgba(0, 86, 210, 0.25);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50px;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Layout */
  --header-height: 72px;
  --max-width: 1280px;
  --sidebar-width: 280px;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --primary: #4d8ce8;
  --primary-light: #6ba1ed;
  --primary-dark: #2d6fd9;
  --primary-bg: rgba(0, 86, 210, 0.12);
  --primary-glow: rgba(77, 140, 232, 0.2);
  
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #22263a;
  --text: #e8eaf0;
  --text-secondary: #9aa5b4;
  --text-muted: #636e80;
  --border: #2a2f3e;
  --border-light: #1e2230;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-primary: 0 4px 20px rgba(77, 140, 232, 0.2);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

input {
  font-family: inherit;
}

/* ---- Utility Classes ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.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;
}

/* ---- Animated Background ---- */
.hero-bg {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0056D2 0%, #003d99 50%, #0056D2 100%);
}

[data-theme="dark"] .hero-bg {
  background: linear-gradient(135deg, #0a1628 0%, #111b33 50%, #0a1628 100%);
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.05) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 50%, rgba(77, 140, 232, 0.1) 0%, transparent 50%);
  animation: heroShimmer 15s ease-in-out infinite alternate;
}

@keyframes heroShimmer {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-5%, 5%); }
}

/* Decorative floating shapes */
.hero-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.hero-shapes .shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  animation: floatShape 20s ease-in-out infinite;
}

.hero-shapes .shape:nth-child(1) {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -50px;
  animation-delay: 0s;
}

.hero-shapes .shape:nth-child(2) {
  width: 200px;
  height: 200px;
  bottom: -80px;
  left: 10%;
  animation-delay: -5s;
}

.hero-shapes .shape:nth-child(3) {
  width: 150px;
  height: 150px;
  top: 30%;
  left: -60px;
  animation-delay: -10s;
}

@keyframes floatShape {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(5deg); }
  50% { transform: translateY(10px) rotate(-3deg); }
  75% { transform: translateY(-10px) rotate(2deg); }
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: all var(--transition-base);
}

[data-theme="dark"] .header {
  background: rgba(15, 17, 23, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-md);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text .university {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.brand-text .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.btn-icon:hover {
  background: var(--primary-bg);
  color: var(--primary);
  transform: scale(1.05);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Theme toggle animation */
.theme-toggle {
  overflow: hidden;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: transform var(--transition-base), opacity var(--transition-base);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  transform: rotate(90deg) scale(0);
  opacity: 0;
  position: absolute;
}

[data-theme="light"] .theme-toggle .icon-moon,
:not([data-theme="dark"]) .theme-toggle .icon-moon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
  position: absolute;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  transform: rotate(0) scale(1);
  opacity: 1;
  position: static;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-light);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: white;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: var(--space-sm);
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h2 {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-size: 32px;
  font-weight: 800;
  color: white;
  display: block;
  line-height: 1.1;
}

.hero-stat .label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  pointer-events: none;
  transition: color var(--transition-fast);
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 18px 56px 18px 56px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  outline: none;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-xl), 0 0 0 4px var(--primary-glow);
}

.search-input:focus ~ .search-icon {
  color: var(--primary);
}

.search-clear {
  position: absolute;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--border-light);
  transition: all var(--transition-fast);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  z-index: 2;
}

.search-clear.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.search-clear:hover {
  background: var(--border);
  color: var(--text);
}

.search-clear svg {
  width: 16px;
  height: 16px;
}

/* Search suggestions dropdown */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
}

.search-suggestions.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.suggestion-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--primary-bg);
}

.suggestion-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.suggestion-icon.section {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  font-size: 12px;
}

.suggestion-icon.student {
  background: var(--primary-bg);
  color: var(--primary);
}

.suggestion-info {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.suggestion-meta mark {
  background: rgba(0, 86, 210, 0.15);
  color: var(--primary);
  border-radius: 2px;
  padding: 0 2px;
}

/* ============================================
   QUICK FILTERS / JUMP
   ============================================ */
.quick-filters {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

.filter-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.active {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Non-hero filter chips */
.section-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.section-filter-row .filter-chip {
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.section-filter-row .filter-chip:hover,
.section-filter-row .filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   STUDENT RESULT CARD
   ============================================ */
.student-results {
  padding: var(--space-lg) 0;
}

.student-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-base);
  animation: fadeInUp 0.4s ease-out both;
}

.student-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.student-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.student-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 13px;
  color: var(--text-secondary);
}

.student-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.student-details .label {
  font-weight: 500;
  color: var(--text-muted);
}

.student-section-badge {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.student-action {
  flex-shrink: 0;
}

.btn-open-section {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-open-section:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-open-section svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   SECTION CARDS GRID
   ============================================ */
.sections-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-top: var(--space-lg);
}

.sections-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.sections-count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  padding-bottom: var(--space-3xl);
}

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out both;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.section-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-glow);
}

.section-card:hover::before {
  transform: scaleX(1);
}

.section-card.favorite {
  border-color: rgba(0, 86, 210, 0.3);
}

.section-card.favorite::before {
  transform: scaleX(1);
  background: linear-gradient(90deg, #ffd700, #ffab00);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-section-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.card-favorite {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.card-favorite:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  transform: scale(1.15);
}

.card-favorite.active {
  color: #ffd700;
}

.card-favorite svg {
  width: 18px;
  height: 18px;
}

.card-student-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-student-count svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.card-actions {
  display: flex;
  gap: var(--space-sm);
}

.card-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.card-btn svg {
  width: 15px;
  height: 15px;
}

.btn-preview {
  background: var(--primary);
  color: white;
}

.btn-preview:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

.btn-download {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(0, 86, 210, 0.15);
}

.btn-download:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.btn-share {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-share:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Card animation stagger */
.section-card:nth-child(1) { animation-delay: 0.02s; }
.section-card:nth-child(2) { animation-delay: 0.04s; }
.section-card:nth-child(3) { animation-delay: 0.06s; }
.section-card:nth-child(4) { animation-delay: 0.08s; }
.section-card:nth-child(5) { animation-delay: 0.10s; }
.section-card:nth-child(6) { animation-delay: 0.12s; }
.section-card:nth-child(7) { animation-delay: 0.14s; }
.section-card:nth-child(8) { animation-delay: 0.16s; }
.section-card:nth-child(9) { animation-delay: 0.18s; }
.section-card:nth-child(10) { animation-delay: 0.20s; }

/* ============================================
   FAVORITES SECTION
   ============================================ */
.favorites-section {
  margin-bottom: var(--space-xl);
  display: none;
}

.favorites-section.visible {
  display: block;
  animation: fadeInUp 0.4s ease-out;
}

.favorites-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.favorites-header svg {
  color: #ffd700;
}

.favorites-grid {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scrollbar-width: thin;
}

.favorite-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.favorite-chip:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

/* ============================================
   RECENT SECTIONS
   ============================================ */
.recent-section {
  margin-bottom: var(--space-xl);
  display: none;
}

.recent-section.visible {
  display: block;
  animation: fadeInUp 0.4s ease-out;
}

.recent-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.recent-grid {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scrollbar-width: thin;
}

.recent-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.recent-chip:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary);
}

/* ============================================
   PDF VIEWER MODAL
   ============================================ */
.pdf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.pdf-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.pdf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.pdf-modal.active {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(26, 29, 39, 0.95);
  backdrop-filter: blur(20px);
  color: white;
  gap: var(--space-md);
  flex-shrink: 0;
}

.pdf-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.pdf-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-toolbar-center {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.pdf-toolbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
}

.pdf-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.pdf-toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.pdf-page-info {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

.pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.pdf-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.pdf-close-btn:hover {
  background: #e74c3c;
}

.pdf-close-btn svg {
  width: 18px;
  height: 18px;
}

.pdf-viewer-container {
  flex: 1;
  overflow: auto;
  background: #525659;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-lg);
}

.pdf-canvas-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.pdf-canvas-wrapper canvas {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  background: white;
}

/* PDF Loading State */
.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: white;
  gap: var(--space-md);
}

.pdf-loading .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.pdf-progress-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.pdf-progress-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ============================================
   NO RESULTS
   ============================================ */
.no-results {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  animation: fadeInUp 0.4s ease-out;
}

.no-results-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  background: var(--primary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  animation: bounce 2s ease-in-out infinite;
}

.no-results-icon svg {
  width: 36px;
  height: 36px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.no-results h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.no-results p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  min-width: 280px;
  max-width: 420px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all var(--transition-base);
}

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: #e74c3c; }
.toast.info .toast-icon { color: var(--primary); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 50;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  font-size: 13px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ============================================
   KEYBOARD SHORTCUTS MODAL
   ============================================ */
.shortcuts-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.shortcuts-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.shortcuts-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  z-index: 901;
  max-width: 440px;
  width: 90%;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.shortcuts-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.shortcuts-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.shortcut-row:last-child {
  border-bottom: none;
}

.shortcut-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shortcut-key kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 180px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }
  
  .hero h1 {
    font-size: 28px;
  }
  
  .hero-stats {
    gap: var(--space-xl);
  }
  
  .hero-stat .number {
    font-size: 24px;
  }
  
  .search-input {
    padding: 14px 48px 14px 48px;
    font-size: 15px;
  }
  
  .sections-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .brand-text .subtitle {
    display: none;
  }
  
  .student-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  
  .student-action {
    width: 100%;
  }
  
  .btn-open-section {
    width: 100%;
    justify-content: center;
  }
  
  .card-actions {
    flex-direction: column;
  }
  
  .pdf-toolbar {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  
  .pdf-toolbar-center {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  
  .pdf-title {
    font-size: 13px;
    max-width: 150px;
  }
  
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  
  .toast {
    min-width: auto;
    width: 100%;
  }
  
  .scroll-top {
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .sections-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-stats {
    flex-direction: row;
    gap: var(--space-lg);
  }
  
  .filter-chip {
    font-size: 12px;
    padding: 5px 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Selection ---- */
::selection {
  background: var(--primary);
  color: white;
}

/* ---- Print ---- */
@media print {
  .header, .footer, .scroll-top, .toast-container,
  .pdf-modal, .pdf-modal-overlay, .shortcuts-modal,
  .shortcuts-modal-overlay {
    display: none !important;
  }
}
