/* ========================================
   ESL GO - UNIFIED APP CSS (MERGED & OPTIMIZED)
   Merged from: global.css + design-system.css + utilities.css + teacher.css
   Date: 2025-01-04
   ======================================== */

/* ========================================
   1. GLOBAL VARIABLES & THEME
   ======================================== */

:root {
  /* ===== PRIMARY COLOR PALETTE (Teal Theme - Brand Identity) ===== */
  --primary-color: #0DCEDA;        /* Main brand teal */
  --primary-dark: #0BA8B3;         /* Darker teal for hover states */
  --primary-light: #6EF3D6;        /* Light teal for accents */
  --primary-rgb: 13, 206, 218;     /* RGB values for opacity */
  --primary: var(--primary-color); /* Alias for Bootstrap compatibility */
  --primary-hover: var(--primary-light);
  --primary-text: #ffffff;
  
  /* ===== SECONDARY & ACCENT COLORS ===== */
  --secondary-color: #475569;      /* Neutral gray */
  --secondary-dark: #334155;       /* Darker gray */
  --secondary-light: #64748B;      /* Lighter gray */
  --accent-color: #FF6B6B;         /* Coral accent */
  --accent-dark: #E55A5A;          /* Darker coral */
  --accent-light: #FF8B8B;         /* Lighter coral */
  
  /* ===== BACKGROUND COLORS ===== */
  --bg-primary: #F8FAFC;           /* Main background */
  --bg-secondary: #F1F5F9;         /* Secondary background */
  --bg-tertiary: #E2E8F0;          /* Tertiary background */
  --bg-card: #FFFFFF;              /* Card background */
  --bg-game: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* ===== TEXT COLORS ===== */
  --text-primary: #1E293B;         /* Primary text */
  --text-secondary: #64748B;       /* Secondary text */
  --text-muted: #94A3B8;           /* Muted text */
  --text-inverse: #FFFFFF;         /* Text on dark backgrounds */
  --black: #222222;
  --white: #ffffff;
  
  /* ===== STATUS COLORS ===== */
  --success-color: #10B981;        /* Success green */
  --warning-color: #F59E0B;        /* Warning orange */
  --error-color: #EF4444;          /* Error red */
  --info-color: #3B82F6;           /* Info blue */
  --success: var(--success-color);
  --warning: var(--warning-color);
  --danger: var(--error-color);
  
  /* ===== GRAY SCALE ===== */
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* ===== DASHBOARD STAT COLORS ===== */
  --dashboard-stat-upcoming: #e74c3c;
  --dashboard-stat-students: #f39c12;
  --dashboard-stat-programs: #2ecc71;
  --dashboard-stat-completed: #3498db;
  --dashboard-stat-progress: #34495e;
  --dashboard-stat-lessons: #27ae60;
  --dashboard-stat-games: #8e44ad;
  --dashboard-stat-blog: #2980b9;
  --dashboard-stat-challenge: #3498db;
  
  /* ===== TYPOGRAPHY ===== */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-display: 'Inter', sans-serif; /* No cursive! */
  --font-family-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-primary: var(--font-family-primary);
  --font-title: var(--font-family-primary);
  
  /* Font Sizes (Base - will use clamp in classes) */
  --font-size-xs: 0.75rem;         /* 12px */
  --font-size-sm: 0.875rem;        /* 14px */
  --font-size-base: 1rem;          /* 16px */
  --font-size-lg: 1.125rem;        /* 18px */
  --font-size-xl: 1.25rem;         /* 20px */
  --font-size-2xl: 1.5rem;         /* 24px */
  --font-size-3xl: 1.875rem;       /* 30px */
  --font-size-4xl: 2.25rem;        /* 36px */
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* ===== SPACING ===== */
  --spacing-xs: 0.25rem;           /* 4px */
  --spacing-sm: 0.5rem;            /* 8px */
  --spacing-md: 1rem;              /* 16px */
  --spacing-lg: 1.5rem;            /* 24px */
  --spacing-xl: 2rem;              /* 32px */
  --spacing-2xl: 3rem;             /* 48px */
  --spacing-3xl: 4rem;             /* 64px */
  
  /* ===== BORDERS & RADIUS ===== */
  --border-width: 1px;
  --border-width-thick: 2px;
  --border-color: #E2E8F0;
  --border-color-dark: #CBD5E1;
  --border-radius-sm: 0.25rem;     /* 4px */
  --border-radius-md: 0.5rem;      /* 8px */
  --border-radius-lg: 0.75rem;     /* 12px */
  --border-radius-xl: 1rem;        /* 16px */
  --border-radius-2xl: 1.5rem;     /* 24px */
  --border-radius-full: 9999px;    /* Full circle */
  
  /* ===== SHADOWS ===== */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  
  /* ===== TRANSITIONS ===== */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ===== Z-INDEX ===== */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===== DARK MODE THEME ===== */
[data-theme="dark"],
.dark-mode {
  --bg-primary: #0f0f1e;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #1a1a2e;
  --bg-game: linear-gradient(135deg, #1e1b4b 0%, #2d1b69 100%);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --border-color-dark: #475569;
  --btn-bg: #8b5cf6;
  --btn-hover: #7c3aed;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========================================
   2. GLOBAL RESETS & BASE STYLES
   ======================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  overflow-anchor: none;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

/* ========================================
   3. CLAMP SYSTEM — RESPONSIVE PERFECTION
   ======================================== */

/* FONT SIZES - Fluid scaling */
h1, .game-title { 
  font-size: clamp(1.8rem, 6vw, 3.5rem); 
  font-family: var(--font-family-primary) !important; /* No cursive! */
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: -0.02em !important;
}

h2, .game-subtitle { 
  font-size: clamp(1.3rem, 4.5vw, 2rem); 
}

h3, .stat-label, .section-header { 
  font-size: clamp(1rem, 3.5vw, 1.4rem); 
}

h4 { font-size: clamp(0.95rem, 3vw, 1.25rem); }
h5 { font-size: clamp(0.9rem, 2.5vw, 1.1rem); }
h6 { font-size: clamp(0.85rem, 2vw, 1rem); }

p, label, input, select, button, .btn, .nav-link {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.stat-number, .stat-value, .timer, .moves { 
  font-size: clamp(1.1rem, 4vw, 1.6rem); 
  font-weight: 700; 
}

/* SPACING - Fluid padding/margins */
.game-header, .game-footer, .dashboard-sidebar { 
  padding: clamp(0.5rem, 2vw, 1.5rem); 
}

.game-main, .dashboard-content { 
  padding: clamp(0.75rem, 3vw, 2.5rem); 
}

.gap, .stats-grid {
  gap: clamp(0.75rem, 3vw, 2rem);
}

/* BUTTONS - Touch-friendly + responsive */
.toubtn, button {
  min-height: 44px; /* Apple guideline */
  padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 4vw, 2rem);
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  border-radius: clamp(6px, 1.5vw, 8px);
}

/* CONTAINERS - Fluid widths */
.game-content-panel, .container, .dashboard-section {
  max-width: clamp(320px, 92vw, 1400px);
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   MOBILE: Remove ALL side padding globally for better space utilization
   This single rule applies to ALL pages across the entire app
   ======================================== */
@media (max-width: 767px) {
  /* Override Bootstrap container padding and margins globally - MUST override margin: auto */
  .container,
  .container-fluid,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl,
  main.container,
  body .container,
  body main.container,
  body.theme-public .container,
  body.theme-public main.container,
  body.theme-teen .container,
  body.theme-teen main.container,
  body.theme-adult .container,
  body.theme-adult main.container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin: 0 !important; /* Override any margin shorthand that includes auto */
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Remove side padding and margins from all main content wrappers */
  main,
  main.container,
  .content-wrapper,
  .page-wrapper,
  .main-content,
  .dashboard-content,
  .game-main,
  .game-content-panel,
  .dashboard-section,
  .content-panel,
  .page-content,
  .callout--grid,
  .block,
  .resource-page-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Ensure blocks and resource cards are full width */
  .block {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Reduce content padding inside blocks on mobile */
  .block__content-wrapper {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Remove side padding from Bootstrap rows (they add negative margins) */
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Remove side padding from Bootstrap columns - full width on mobile */
  [class*="col-"],
  .col,
  .col-auto {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Game cards - full width on mobile */
  .games-grid,
  .game-card,
  .games-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Fix any content that might be offset */
  .game-layout-container,
  .game-grid-wrapper,
  .game-info-wrapper,
  .crossword-overlay__content,
  .wordsearch-container,
  .memory-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Remove side padding from body and html */
  body,
  html {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Keep minimal top/bottom padding for readability, but remove sides and margins */
  main.container,
  body.theme-public main.container,
  body.theme-teen main.container,
  body.theme-adult main.container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Remove side padding from landing page sections */
  .cefr-test-section,
  .learner-types-section,
  .free-tools-section,
  .cta-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Ensure sections don't overflow */
  section {
    overflow-x: hidden;
  }
  
  /* Ensure body and html have no side margins */
  body,
  html {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* SIDEBAR - Responsive width */
.dashboard-sidebar {
  width: clamp(200px, 25vw, 280px);
  padding: clamp(1rem, 2vw, 1.5rem);
}

/* INPUTS - Fluid sizing */
input, select, textarea, .form-control {
  padding: clamp(0.5rem, 2vw, 0.75rem);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
}

/* ========================================
   4. TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin: 0 0 var(--spacing-md) 0;
}

p {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-secondary);
  line-height: var(--line-height-normal);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ========================================
   5. BOOTSTRAP OVERRIDES (Wider Containers)
   ======================================== */

@media (min-width: 768px) {
  .container, .container-md, .container-sm {
    max-width: 1200px !important;
  }
}

@media (min-width: 992px) {
  .container, .container-lg, .container-md, .container-sm {
    max-width: 1400px !important;
  }
}

@media (min-width: 1200px) {
  .container, .container-xl, .container-lg, .container-md, .container-sm {
    max-width: 1600px !important;
  }
}

@media (min-width: 1400px) {
  .container, .container-xxl, .container-xl, .container-lg, .container-md, .container-sm {
    max-width: 1800px !important;
  }
}

/* ========================================
   6. COMPONENTS (Buttons, Cards, Forms, Alerts)
   ======================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 4vw, 2rem);
  font-family: var(--font-family-primary);
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border: var(--border-width) solid transparent;
  border-radius: clamp(6px, 1.5vw, 8px);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px; /* Touch-friendly */
  min-width: 44px;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-inverse);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--text-inverse);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  border-color: var(--secondary-dark);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-warning {
  background-color: var(--warning-color);
  color: white;
}

.btn-danger {
  background-color: var(--error-color);
  color: white;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--text-inverse);
}

/* --- Cards --- */
.card {
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

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

.card-header {
  padding: var(--spacing-lg);
  border-bottom: var(--border-width) solid var(--border-color);
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.card-body {
  padding: clamp(1rem, 3vw, 2rem);
}

.card-footer {
  padding: var(--spacing-lg);
  border-top: var(--border-width) solid var(--border-color);
  background-color: var(--bg-secondary);
  border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
}

/* --- Forms --- */
.form-control {
  display: block;
  width: 100%;
  padding: clamp(0.5rem, 2vw, 0.75rem);
  font-family: var(--font-family-primary);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

/* --- Alerts --- */
.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius-lg);
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: var(--success-color);
  color: var(--success-color);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: var(--warning-color);
  color: var(--warning-color);
}

.alert-error, .alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--error-color);
  color: var(--error-color);
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: var(--info-color);
  color: var(--info-color);
}

/* ========================================
   7. TEACHER DASHBOARD (Scoped with clamp)
   ======================================== */

.teacher-dashboard {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: clamp(200px, 25vw, 280px); /* Responsive sidebar */
  background: #1f2937;
  color: white;
  padding: clamp(1rem, 2vw, 1.5rem);
  position: fixed;
  top: 70px;
  bottom: 0;
  left: 0;
  height: calc(100vh - 70px);
  overflow-y: auto;
  z-index: 1000;
}

.sidebar-header {
  margin-bottom: 2rem;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: clamp(0.5rem, 1.5vw, 0.75rem);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  color: #e5e7eb;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #3b82f6;
}

.nav-link i {
  margin-right: 0.75rem;
  width: 1.5rem;
  text-align: center;
}

/* Override for navbar links - icons should be centered above text */
.navbar-nav .nav-link i,
.navbar-auth-buttons .nav-link i {
  margin-right: 0 !important;
  margin-bottom: 0.3rem;
  display: block;
  width: auto;
  text-align: center;
}

.dashboard-content {
  flex: 1;
  padding: clamp(1rem, 3vw, 2rem);
  margin-left: clamp(200px, 25vw, 280px); /* Match sidebar width */
  margin-top: 70px;
}

.dashboard-section {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
}

.section-header {
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 30vw, 250px), 1fr));
  gap: clamp(0.75rem, 2.5vw, 1.5rem);
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  text-align: center;
  transition: all var(--transition-normal);
}

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

.stat-number {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
}

/* ========================================
   8. UTILITY CLASSES
   ======================================== */

/* Spacing Utilities */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

/* Text Utilities */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-justify { text-align: justify !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.font-weight-bold { font-weight: bold !important; }
.font-weight-normal { font-weight: normal !important; }
.font-weight-light { font-weight: 300 !important; }

/* Text Color Utilities (Use theme variables) */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-white { color: #fff !important; }
.text-dark { color: var(--text-primary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Background Utilities (Use theme variables) */
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--error-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.bg-light { background-color: var(--gray-100) !important; }
.bg-dark { background-color: var(--gray-900) !important; }
.bg-white { background-color: #fff !important; }
.bg-transparent { background-color: transparent !important; }

/* Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flexbox Utilities */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

/* Position Utilities */
.position-static { position: static !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

/* Border Utilities */
.border { border: 1px solid var(--border-color) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.border-right { border-right: 1px solid var(--border-color) !important; }
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
.border-left { border-left: 1px solid var(--border-color) !important; }

.rounded { border-radius: 0.25rem !important; }
.rounded-top { border-top-left-radius: 0.25rem !important; border-top-right-radius: 0.25rem !important; }
.rounded-right { border-top-right-radius: 0.25rem !important; border-bottom-right-radius: 0.25rem !important; }
.rounded-bottom { border-bottom-right-radius: 0.25rem !important; border-bottom-left-radius: 0.25rem !important; }
.rounded-left { border-top-left-radius: 0.25rem !important; border-bottom-left-radius: 0.25rem !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-0 { border-radius: 0 !important; }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-none { box-shadow: none !important; }

/* Width and Height Utilities */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

/* Overflow Utilities */
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-visible { overflow: visible !important; }
.overflow-scroll { overflow: scroll !important; }

/* Cursor Utilities */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* User Select Utilities */
.user-select-all { user-select: all !important; }
.user-select-auto { user-select: auto !important; }
.user-select-none { user-select: none !important; }

/* Visibility Utilities */
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* Opacity Utilities */
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* ========================================
   9. DARK MODE OVERRIDES
   ======================================== */

[data-theme="dark"] .teacher-dashboard .dashboard-sidebar { 
  background: #0f0f1e; 
}

[data-theme="dark"] .nav-link:hover { 
  background: rgba(255,255,255,0.05); 
}

[data-theme="dark"] .card {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .form-control {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* ========================================
   10. RESPONSIVE DISPLAY UTILITIES
   ======================================== */

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-inline-flex { display: inline-flex !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-inline-flex { display: inline-flex !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-inline-flex { display: inline-flex !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-block { display: block !important; }
  .d-xl-inline { display: inline !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-flex { display: flex !important; }
  .d-xl-inline-flex { display: inline-flex !important; }
}

/* ========================================
   11. ANIMATIONS
   ======================================== */

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.fade-in {
  animation: fadeIn var(--transition-normal);
}

.slide-in {
  animation: slideIn var(--transition-normal);
}

.bounce {
  animation: bounce 0.5s ease;
}

/* ========================================
   12. RESPONSIVE MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 1.875rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
    --spacing-3xl: 2rem;
    --spacing-2xl: 1.5rem;
  }
  
  .dashboard-content {
    margin-left: 0; /* Stack on mobile */
    margin-top: 70px;
    padding: var(--spacing-md);
  }
  
  .dashboard-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    top: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 0.9rem;
  }
  
  .btn {
    padding: clamp(8px, 3vw, 12px) clamp(12px, 5vw, 16px);
  }
}

/* ========================================
   END OF UNIFIED APP CSS
   ======================================== */

