/* ==========================================================================
   ET+ AI Tutor — Master Stylesheet
   The World's Most Advanced Age-Adaptive AI Tutoring Platform (KG3–G12)
   Version: 1.0.0

   TABLE OF CONTENTS
   --------------------------------------------------------------------------
   1.  CSS Custom Properties (Design Tokens)
   2.  Global Reset & Base Styles
   3.  Typography
   4.  Grid Background Pattern
   5.  Navigation Bar (Glassmorphism)
   6.  Hero Section
   7.  Buttons & Interactive Elements
   8.  Cards (Feature, Grade Band, Stat, Pricing)
   9.  Forms (Login, Enrollment)
   10. Student Dashboard
   11. Chat / Tutor Interface
   12. ET+ Avatar
   13. Correction Display
   14. Emotional State Indicators
   15. Progress Bars (Linear & Circular)
   16. Gamification (Stars, Badges, Streaks)
   17. Knowledge Graph
   18. Assessment / Quiz UI
   19. Modal Dialogs
   20. Sidebar Navigation
   21. Toast Notifications
   22. Loading States & Skeletons
   23. Grade Band Adaptive Styles
   24. Parent / Teacher View
   25. Settings Page
   26. Footer
   27. Utility Classes
   28. Animations & Keyframes
   29. Responsive Breakpoints
   30. Accessibility & Reduced Motion
   ========================================================================== */


/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ========================================================================== */

:root {
  /* ---- Core Dark Theme — Teal/Cyan (matching ET+ reference image) ---- */
  --bg:             #040e14;
  --bg2:            #071a22;
  --bg3:            #0a2230;
  --surface:        #0d2b3a;
  --surface2:       #103545;
  --surface3:       #154050;
  --border:         rgba(0, 229, 255, 0.07);
  --border2:        rgba(0, 229, 255, 0.12);
  --border3:        rgba(0, 229, 255, 0.20);

  /* ---- Text ---- */
  --text:           #e8f4fd;
  --text2:          #8fbfd6;
  --text3:          #5c99b3;
  --text-inverse:   #040e14;

  /* ---- Grade Band Colors ---- */
  --early:          #00E5FF;
  --early-dim:      rgba(0, 229, 255, 0.12);
  --early-glow:     rgba(0, 229, 255, 0.25);
  --primary-band:   #4FC3F7;
  --primary-dim:    rgba(79, 195, 247, 0.12);
  --primary-glow:   rgba(79, 195, 247, 0.25);
  --middle:         #7C6AFA;
  --middle-dim:     rgba(124, 106, 250, 0.12);
  --middle-glow:    rgba(124, 106, 250, 0.25);
  --high:           #FF8A65;
  --high-dim:       rgba(255, 138, 101, 0.12);
  --high-glow:      rgba(255, 138, 101, 0.25);

  /* ---- Accent & Semantic ---- */
  --accent:         #00E5FF;
  --gold:           #FFB300;
  --success:        #00BCD4;
  --error:          #ef4444;
  --warning:        #FFB300;
  --info:           #4FC3F7;

  /* ---- Mastery State Colors ---- */
  --mastery-none:      #78909C;
  --mastery-intro:     #80DEEA;
  --mastery-partial:   #FFB300;
  --mastery-mastered:  #00BCD4;
  --mastery-review:    #f87171;

  /* ---- Emotional State Ambient ---- */
  --emotion-confident:   rgba(0, 188, 212, 0.10);
  --emotion-frustrated:  rgba(248, 113, 113, 0.10);
  --emotion-curious:     rgba(79, 195, 247, 0.10);
  --emotion-overwhelmed: rgba(255, 179, 0, 0.10);

  /* ---- Border Radius ---- */
  --r-sm:  6px;
  --r:     10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* ---- Shadows (teal-tinted) ---- */
  --shadow-sm:  0 1px 3px rgba(0, 20, 30, 0.4);
  --shadow:     0 4px 14px rgba(0, 20, 30, 0.5);
  --shadow-lg:  0 8px 32px rgba(0, 20, 30, 0.55);
  --shadow-xl:  0 16px 48px rgba(0, 20, 30, 0.65);

  /* ---- Typography ---- */
  --font-display: 'Syne', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* ---- Font Sizes (fluid) ---- */
  --text-xs:   clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);
  --text-sm:   clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
  --text-lg:   clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --text-xl:   clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
  --text-2xl:  clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --text-3xl:  clamp(1.5rem, 1.2rem + 0.8vw, 2rem);
  --text-4xl:  clamp(2rem, 1.5rem + 1.2vw, 2.5rem);
  --text-5xl:  clamp(2.5rem, 2rem + 1.5vw, 3.5rem);
  --text-hero: clamp(3rem, 2rem + 3vw, 6rem);

  /* ---- Spacing ---- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ---- Transitions ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
  --duration-slow: 400ms;

  /* ---- Z-index layers ---- */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-modal:     300;
  --z-toast:     400;
  --z-tooltip:   500;

  /* ---- Layout ---- */
  --sidebar-w: 260px;
  --nav-h:     64px;
  --max-w:     1200px;

  /* ---- Current band (set dynamically via JS) ---- */
  --current-band-color: var(--primary-band);
}


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

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 229, 255, 0.3);
  color: #fff;
}

img, video, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--text); }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface3); }


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); font-weight: 800; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { color: var(--text2); line-height: 1.75; }
strong { color: var(--text); font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.9em; }
pre { font-family: var(--font-mono); font-size: var(--text-sm); }

.mono { font-family: var(--font-mono); }
.label-sm {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
}


/* ==========================================================================
   4. GRID BACKGROUND PATTERN
   ========================================================================== */

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 70%);
}


/* ==========================================================================
   5. NAVIGATION BAR (GLASSMORPHISM)
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  background: rgba(4, 14, 20, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-sticky);
  transition: background var(--duration) var(--ease);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.navbar__logo .plus { color: var(--accent); }
.navbar__logo .ai { color: var(--success); }

.navbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.navbar__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text2);
  transition: color var(--duration) var(--ease);
  text-decoration: none;
}
.navbar__link:hover { color: #fff; }
.navbar__link--active { color: #fff; }

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar__grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--current-band-color);
  color: #fff;
}


/* ==========================================================================
   6. HERO SECTION
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + var(--space-16)) var(--space-8) var(--space-16);
  text-align: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 229, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 10% 60%, rgba(0, 188, 212, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 90% 80%, rgba(124, 106, 250, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero__content { position: relative; max-width: 880px; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-dim);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--r-full);
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-band);
  margin-bottom: var(--space-6);
}

.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--primary-band);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -3px;
  color: #fff;
  margin-bottom: var(--space-3);
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--text2);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-6);
}

.hero__desc {
  font-size: var(--text-lg);
  color: var(--text2);
  max-width: 640px;
  margin: 0 auto var(--space-10);
  line-height: 1.8;
}

.hero__bands {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.hero__band {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--r-full);
  border: 1px solid;
  font-size: 12px;
  font-weight: 600;
  transition: transform var(--duration) var(--ease);
}
.hero__band:hover { transform: translateY(-2px); }

.hero__band--early  { border-color: var(--early);       background: var(--early-dim);   color: var(--early);       }
.hero__band--primary { border-color: var(--primary-band); background: var(--primary-dim); color: var(--primary-band); }
.hero__band--middle { border-color: var(--middle);       background: var(--middle-dim);  color: var(--middle);      }
.hero__band--high   { border-color: var(--high);         background: var(--high-dim);    color: var(--high);        }


/* ==========================================================================
   7. BUTTONS & INTERACTIVE ELEMENTS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.5);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: var(--shadow); }

.btn--band {
  background: var(--current-band-color);
  color: #fff;
}
.btn--band:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn--secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn--secondary:hover { background: var(--surface3); border-color: var(--border3); }

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn--outline:hover { background: var(--primary-dim); }

.btn--ghost {
  background: transparent;
  color: var(--text2);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.btn--danger {
  background: var(--error);
  color: #fff;
}
.btn--danger:hover { background: #dc2626; }

.btn--sm { padding: 8px 16px; font-size: var(--text-xs); }
.btn--lg { padding: 16px 32px; font-size: var(--text-base); }
.btn--xl { padding: 18px 40px; font-size: var(--text-lg); border-radius: var(--r-lg); }
.btn--full { width: 100%; }

.btn--glow {
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}
.btn--glow:hover {
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.5);
}


/* ==========================================================================
   8. CARDS
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card:hover { border-color: var(--border2); transform: translateY(-2px); }

.card--feature { position: relative; overflow: hidden; }
.card--feature .card__icon { font-size: 24px; margin-bottom: var(--space-3); display: block; }
.card--feature .card__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-2);
}
.card--feature .card__desc {
  font-size: var(--text-sm);
  color: var(--text2);
  line-height: 1.65;
}

/* Grade Band Cards */
.card--band {
  position: relative;
  overflow: hidden;
}
.card--band::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.card--band[data-band="early_years"]::before   { background: linear-gradient(90deg, var(--early), transparent); }
.card--band[data-band="primary"]::before        { background: linear-gradient(90deg, var(--primary-band), transparent); }
.card--band[data-band="middle_school"]::before  { background: linear-gradient(90deg, var(--middle), transparent); }
.card--band[data-band="high_school"]::before    { background: linear-gradient(90deg, var(--high), transparent); }

.card--band[data-band="early_years"]:hover   { border-color: rgba(0, 188, 212, 0.3); }
.card--band[data-band="primary"]:hover        { border-color: rgba(0, 229, 255, 0.3); }
.card--band[data-band="middle_school"]:hover  { border-color: rgba(124, 106, 250, 0.3); }
.card--band[data-band="high_school"]:hover    { border-color: rgba(255, 138, 101, 0.3); }

/* Stat Cards */
.card--stat {
  text-align: center;
  padding: var(--space-6);
}
.card--stat .stat__num {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: var(--space-1);
  letter-spacing: -2px;
}
.card--stat .stat__label {
  font-size: var(--text-xs);
  color: var(--text3);
  font-weight: 500;
}

/* Pricing Cards */
.card--pricing {
  padding: var(--space-8);
}
.card--pricing.featured {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(124, 106, 250, 0.08));
  border-color: rgba(0, 229, 255, 0.3);
}


/* ==========================================================================
   9. FORMS (LOGIN, ENROLLMENT)
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text);
  font-size: var(--text-base);
  outline: none;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.form-input::placeholder { color: var(--text3); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238fa3bf' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select option { background: var(--bg3); color: var(--text); }
.form-select optgroup { font-weight: 600; color: var(--text); }

.form-textarea { min-height: 120px; resize: vertical; }

.form-error {
  display: block;
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

.form-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text3);
  margin-top: var(--space-1);
}

/* Auth Container */
.auth-container {
  max-width: 440px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-8);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--space-8);
}

.auth-card__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
  text-align: center;
}

.auth-card__subtitle {
  font-size: var(--text-sm);
  color: var(--text2);
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--text3);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
}
.auth-tab:hover { color: var(--text2); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }


/* ==========================================================================
   10. STUDENT DASHBOARD
   ========================================================================== */

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

.dashboard__sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: var(--space-6) 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: var(--z-dropdown);
}

.dashboard__main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: var(--space-8);
  min-height: 100vh;
}

.dashboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.dashboard__welcome h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-1);
}

.dashboard__welcome p {
  color: var(--text2);
  font-size: var(--text-sm);
}

.dashboard__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.dashboard__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

/* Subject Cards */
.subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.subject-card:hover { border-color: var(--current-band-color); transform: translateY(-2px); }

.subject-card__icon { font-size: 28px; }
.subject-card__name { font-size: var(--text-base); font-weight: 600; color: #fff; }
.subject-card__progress { font-size: var(--text-xs); color: var(--text3); }


/* ==========================================================================
   11. CHAT / TUTOR INTERFACE
   ========================================================================== */

.tutor-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
}

.tutor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

.tutor-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.tutor-header__info h2 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 2px;
}

.tutor-header__info .band-badge {
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--current-band-color);
  color: #fff;
  font-weight: 600;
}

.tutor-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Chat Bubbles */
.message {
  max-width: 80%;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-lg);
  font-size: var(--text-base);
  line-height: 1.7;
  animation: messageIn 0.3s var(--ease);
}

.message--tutor {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--r-sm);
}

.message--student {
  align-self: flex-end;
  background: var(--current-band-color);
  color: #fff;
  border-bottom-right-radius: var(--r-sm);
}

.message__content { word-wrap: break-word; }
.message__content p { color: inherit; margin-bottom: var(--space-2); }
.message__content p:last-child { margin-bottom: 0; }
.message__content code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.message__content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--space-3);
  margin: var(--space-2) 0;
  overflow-x: auto;
}

.message__time {
  font-size: var(--text-xs);
  color: var(--text3);
  margin-top: var(--space-2);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  align-self: flex-start;
  max-width: 100px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Chat Input */
.tutor-input {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

.tutor-input__field {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  color: var(--text);
  font-size: var(--text-base);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--duration) var(--ease);
}
.tutor-input__field:focus { border-color: var(--current-band-color); }
.tutor-input__field::placeholder { color: var(--text3); }

.tutor-input__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--current-band-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
}
.tutor-input__btn:hover { filter: brightness(1.15); transform: scale(1.05); }
.tutor-input__btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tutor-input__voice {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--duration) var(--ease);
  flex-shrink: 0;
}
.tutor-input__voice:hover { border-color: var(--current-band-color); color: var(--current-band-color); }
.tutor-input__voice.listening {
  border-color: var(--error);
  color: var(--error);
  animation: voicePulse 1.5s infinite;
}


/* ==========================================================================
   12. ET+ AVATAR
   ========================================================================== */

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--current-band-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  transition: border-color var(--duration-slow) var(--ease);
  flex-shrink: 0;
}

.avatar--lg { width: 72px; height: 72px; font-size: 36px; }
.avatar--xl { width: 96px; height: 96px; font-size: 48px; }

.avatar__mood-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: moodRingPulse 3s infinite;
}

/* Mood ring colors per emotional state */
.avatar[data-emotion="confident"] .avatar__mood-ring  { border-color: var(--success); }
.avatar[data-emotion="curious"] .avatar__mood-ring    { border-color: var(--info); }
.avatar[data-emotion="frustrated"] .avatar__mood-ring { border-color: var(--error); }
.avatar[data-emotion="confused"] .avatar__mood-ring   { border-color: var(--warning); }
.avatar[data-emotion="excited"] .avatar__mood-ring    { border-color: var(--gold); }
.avatar[data-emotion="anxious"] .avatar__mood-ring    { border-color: var(--error); opacity: 0.6; }


/* ==========================================================================
   13. CORRECTION DISPLAY
   ========================================================================== */

.correction {
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--r);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-2) 0;
  font-size: var(--text-sm);
}

.correction__original {
  text-decoration: line-through;
  color: var(--error);
  opacity: 0.7;
}

.correction__corrected {
  color: var(--success);
  font-weight: 600;
}

.correction__explanation {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text2);
  line-height: 1.5;
}

.correction__strategy {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--surface2);
  color: var(--text3);
  margin-top: var(--space-2);
}


/* ==========================================================================
   14. EMOTIONAL STATE INDICATORS
   ========================================================================== */

.emotion-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid;
}

.emotion-indicator--confident  { background: rgba(0, 188, 212, 0.12); border-color: rgba(0, 188, 212, 0.25); color: #00BCD4; }
.emotion-indicator--curious    { background: rgba(79, 195, 247, 0.12); border-color: rgba(79, 195, 247, 0.25); color: #4FC3F7; }
.emotion-indicator--frustrated { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.25); color: #f87171; }
.emotion-indicator--confused   { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.25); color: #fbbf24; }
.emotion-indicator--bored      { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); color: #94a3b8; }
.emotion-indicator--anxious    { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.25); color: #f87171; }
.emotion-indicator--excited    { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.25); color: #fbbf24; }
.emotion-indicator--proud      { background: rgba(0, 188, 212, 0.12); border-color: rgba(0, 188, 212, 0.25); color: #00BCD4; }
.emotion-indicator--defeated   { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.25); color: #f87171; }
.emotion-indicator--neutral    { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); color: #94a3b8; }


/* ==========================================================================
   15. PROGRESS BARS
   ========================================================================== */

.progress-bar {
  height: 8px;
  background: var(--surface2);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--current-band-color);
  transition: width 0.6s var(--ease);
}

.progress-bar--mastered .progress-bar__fill { background: var(--mastery-mastered); }
.progress-bar--partial .progress-bar__fill  { background: var(--mastery-partial); }
.progress-bar--review .progress-bar__fill   { background: var(--mastery-review); }

/* Circular progress */
.progress-circle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-circle__svg { transform: rotate(-90deg); }

.progress-circle__track {
  fill: none;
  stroke: var(--surface2);
}

.progress-circle__fill {
  fill: none;
  stroke: var(--current-band-color);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}

.progress-circle__text {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
}


/* ==========================================================================
   16. GAMIFICATION
   ========================================================================== */

.streak-counter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.streak-counter__flame { font-size: 28px; }
.streak-counter__num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gold);
}
.streak-counter__label { font-size: var(--text-xs); color: var(--text3); }

.badge-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: all var(--duration) var(--ease);
}
.badge-card:hover { border-color: var(--gold); }
.badge-card__icon { font-size: 24px; }
.badge-card__name { font-size: var(--text-sm); font-weight: 600; color: #fff; }
.badge-card__desc { font-size: var(--text-xs); color: var(--text3); }
.badge-card--locked { opacity: 0.4; filter: grayscale(1); }

/* Star animation (Early Years) */
.star-celebration {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-toast);
}

.star-particle {
  position: absolute;
  font-size: 24px;
  animation: starFloat 1.5s var(--ease) forwards;
}


/* ==========================================================================
   17. KNOWLEDGE GRAPH
   ========================================================================== */

.knowledge-graph {
  width: 100%;
  height: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
}

.knowledge-graph__canvas { width: 100%; height: 100%; }

.knowledge-graph__legend {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(8, 12, 20, 0.9);
  border-radius: var(--r);
  font-size: var(--text-xs);
}

.legend-item { display: flex; align-items: center; gap: 4px; color: var(--text2); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }


/* ==========================================================================
   18. ASSESSMENT / QUIZ UI
   ========================================================================== */

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}

.quiz-card__question {
  font-size: var(--text-lg);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  cursor: pointer;
  margin-bottom: var(--space-2);
  transition: all var(--duration) var(--ease);
}
.quiz-option:hover { border-color: var(--accent); background: var(--primary-dim); }
.quiz-option.selected { border-color: var(--accent); background: var(--primary-dim); }
.quiz-option.correct { border-color: var(--success); background: rgba(0, 188, 212, 0.1); }
.quiz-option.incorrect { border-color: var(--error); background: rgba(239, 68, 68, 0.1); }

.quiz-timer {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.quiz-timer.warning { color: var(--warning); }
.quiz-timer.danger { color: var(--error); animation: timerPulse 1s infinite; }


/* ==========================================================================
   19. MODAL DIALOGS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--space-8);
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s var(--ease);
}

.modal__title { font-size: var(--text-2xl); margin-bottom: var(--space-4); }
.modal__body { color: var(--text2); margin-bottom: var(--space-6); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--space-3); }

.modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
}


/* ==========================================================================
   20. SIDEBAR NAVIGATION
   ========================================================================== */

.sidebar-logo {
  padding: 0 var(--space-6) var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.sidebar-logo__text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
}
.sidebar-logo__text .plus { color: var(--accent); }
.sidebar-logo__sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: var(--text2);
  font-size: var(--text-sm);
  font-weight: 400;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}
.sidebar-nav__item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.sidebar-nav__item.active {
  color: #fff;
  background: rgba(0, 229, 255, 0.08);
  border-left-color: var(--current-band-color);
  font-weight: 500;
}

.sidebar-nav__icon { font-size: 18px; width: 20px; text-align: center; }
.sidebar-nav__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-full);
  background: var(--current-band-color);
  color: #fff;
}

.sidebar-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text3);
  padding: var(--space-3) var(--space-6) var(--space-1);
  margin-top: var(--space-2);
}

.sidebar-profile {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-profile__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid var(--current-band-color);
}

.sidebar-profile__name { font-size: var(--text-sm); font-weight: 500; color: #fff; }
.sidebar-profile__grade { font-size: var(--text-xs); color: var(--text3); }


/* ==========================================================================
   21. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: calc(var(--nav-h) + var(--space-4));
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--r);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--text-sm);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s var(--ease);
  max-width: 360px;
}

.toast--visible { transform: translateX(0); opacity: 1; }

.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--error); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info    { border-left: 3px solid var(--info); }

.toast__icon { font-size: 16px; flex-shrink: 0; }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon   { color: var(--error); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info .toast__icon    { color: var(--info); }


/* ==========================================================================
   22. LOADING STATES & SKELETONS
   ========================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}

.skeleton--text { height: 14px; margin-bottom: 8px; }
.skeleton--title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton--circle { border-radius: 50%; }
.skeleton--card { height: 160px; }

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--surface2);
  border-top-color: var(--current-band-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--lg { width: 40px; height: 40px; border-width: 4px; }


/* ==========================================================================
   23. GRADE BAND ADAPTIVE STYLES
   ========================================================================== */

/* Early Years: Larger text, rounded everything, playful */
body[data-band="early_years"] {
  --current-band-color: var(--early);
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
}
body[data-band="early_years"] .message { border-radius: var(--r-xl); font-size: var(--text-lg); }
body[data-band="early_years"] .btn { border-radius: var(--r-xl); padding: 14px 28px; font-size: var(--text-base); }
body[data-band="early_years"] .tutor-input__field { font-size: var(--text-lg); min-height: 52px; }

/* Primary: Standard sizing, fun colors */
body[data-band="primary"] {
  --current-band-color: var(--primary-band);
}

/* Middle School: Standard, clean */
body[data-band="middle_school"] {
  --current-band-color: var(--middle);
}

/* High School: Compact, dense, professional */
body[data-band="high_school"] {
  --current-band-color: var(--high);
}
body[data-band="high_school"] .message { font-size: var(--text-sm); }


/* ==========================================================================
   24. PARENT / TEACHER VIEW
   ========================================================================== */

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

.parent-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  padding: var(--space-6);
}

.session-log {
  list-style: none;
}

.session-log__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration) var(--ease);
}
.session-log__item:hover { background: rgba(255, 255, 255, 0.02); }


/* ==========================================================================
   25. SETTINGS PAGE
   ========================================================================== */

.settings-section {
  margin-bottom: var(--space-8);
}

.settings-section__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
}

.setting-row__label { color: var(--text); font-weight: 500; }
.setting-row__desc { font-size: var(--text-xs); color: var(--text3); margin-top: 2px; }

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.toggle__slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--duration) var(--ease);
}

.toggle input:checked + .toggle__slider { background: var(--current-band-color); }
.toggle input:checked + .toggle__slider::before { transform: translateX(20px); }


/* ==========================================================================
   26. FOOTER
   ========================================================================== */

.footer {
  padding: var(--space-16) var(--space-8);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.footer__logo {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-2);
}
.footer__logo .plus { color: var(--accent); }

.footer__desc {
  color: var(--text3);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text3);
}


/* ==========================================================================
   27. UTILITY CLASSES
   ========================================================================== */

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-6); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text3); }
.text-secondary { color: var(--text2); }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.rounded { border-radius: var(--r); }
.rounded-lg { border-radius: var(--r-lg); }
.border { border: 1px solid var(--border); }

/* Band color utilities */
.text-early  { color: var(--early); }
.text-primary-band { color: var(--primary-band); }
.text-middle { color: var(--middle); }
.text-high   { color: var(--high); }
.bg-early    { background: var(--early-dim); }
.bg-primary-band  { background: var(--primary-dim); }
.bg-middle   { background: var(--middle-dim); }
.bg-high     { background: var(--high-dim); }


/* ==========================================================================
   28. ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes moodRingPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes starFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-100px) scale(0.3) rotate(180deg); opacity: 0; }
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}


/* ==========================================================================
   29. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1200px) {
  :root { --sidebar-w: 220px; }
}

@media (max-width: 1024px) {
  .dashboard__sidebar { display: none; }
  .dashboard__main { margin-left: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: calc(var(--nav-h) + var(--space-10)); min-height: auto; }
}

@media (max-width: 768px) {
  .navbar__nav { display: none; }
  .hero__title { letter-spacing: -2px; }
  .hero__bands { flex-direction: column; align-items: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .dashboard__stats { grid-template-columns: repeat(2, 1fr); }
  .auth-container { padding: var(--space-10) var(--space-4) var(--space-6); }
  .modal { width: 95%; padding: var(--space-6); }
  .tutor-input { padding: var(--space-3) var(--space-4); }
  .message { max-width: 90%; }
}

@media (max-width: 480px) {
  :root { --nav-h: 56px; }
  .navbar { padding: 0 var(--space-4); }
  .hero { padding-left: var(--space-4); padding-right: var(--space-4); }
  .dashboard__main { padding: var(--space-4); }
  .dashboard__stats { grid-template-columns: 1fr; }
  .tutor-messages { padding: var(--space-4); }
}


/* ==========================================================================
   30. ACCESSIBILITY & REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* High contrast override */
@media (prefers-contrast: high) {
  :root {
    --border: rgba(255, 255, 255, 0.3);
    --border2: rgba(255, 255, 255, 0.5);
    --text2: #c0cfdf;
    --text3: #8fa3bf;
  }
}
