/* =========================================================
   SHOOLIFYAI — Main Stylesheet
   Design System: soft blue + purple AI gradients, green accents
   ========================================================= */

:root{
  /* --- Brand Colors --- */
  --color-primary: #4f6bff;
  --color-primary-dark: #3448d6;
  --color-primary-light: #7c8bff;
  --color-purple: #8b5cf6;
  --color-purple-dark: #6d28d9;
  --color-green: #22c55e;
  --color-green-dark: #16a34a;
  --color-navy: #0f172a;
  --color-navy-soft: #1e2a4a;

  /* --- Gradients --- */
  --gradient-primary: linear-gradient(135deg, #4f6bff 0%, #8b5cf6 100%);
  --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #f5f0ff 100%);
  --gradient-green: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  --gradient-hero: radial-gradient(circle at 15% 20%, rgba(79,107,255,.14), transparent 45%),
                    radial-gradient(circle at 85% 10%, rgba(139,92,246,.14), transparent 45%),
                    radial-gradient(circle at 50% 100%, rgba(34,197,94,.10), transparent 45%);

  /* --- Surface / Text --- */
  --bg: #ffffff;
  --bg-soft: #f7f8fc;
  --bg-elevated: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #4b5568;
  --text-muted: #8892a6;
  --border-color: #e6e9f2;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 8px 32px rgba(79, 107, 255, 0.25);

  /* --- Radius --- */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* --- Spacing --- */
  --container-width: 1280px;
  --header-height: 76px;

  /* --- Transitions --- */
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --transition-slow: 0.45s cubic-bezier(.4,0,.2,1);
}

/* =============== RESET =============== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
p { margin: 0; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-primary);
  color: #fff; padding: 10px 16px; z-index: 2000; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* =============== LAYOUT HELPERS =============== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.section-header { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gradient-soft); color: var(--color-primary-dark);
  font-size: 13px; font-weight: 700; padding: 8px 16px;
  border-radius: var(--r-full); margin-bottom: 16px; letter-spacing: 0.02em;
}
.section-title { font-size: clamp(28px, 4vw, 42px); margin-bottom: 16px; }
.section-desc { color: var(--text-secondary); font-size: 17px; }
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grid { display: grid; gap: 24px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* =============== BUTTONS =============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--r-full); font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap; min-height: 48px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(79,107,255,.35); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 2px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-green { background: var(--gradient-green); color: #fff; box-shadow: 0 8px 24px rgba(34,197,94,.28); }
.btn-sm { padding: 10px 18px; font-size: 13px; min-height: 38px; }
.btn-lg { padding: 17px 36px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; background: var(--bg-soft);
  border: 1px solid var(--border-color); color: var(--text-primary); transition: var(--transition);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--gradient-soft); color: var(--color-primary); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }

/* =============== HEADER =============== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  transition: background var(--transition), border-color var(--transition);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; color: var(--text-primary); flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-accent { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 10px 16px; border-radius: var(--r-full); font-weight: 600; font-size: 15px;
  color: var(--text-secondary); transition: var(--transition); position: relative;
}
.main-nav a:hover { color: var(--color-primary); background: var(--bg-soft); }
.main-nav a.active { color: var(--color-primary); background: var(--gradient-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-color);
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); position: relative; transition: var(--transition); flex-shrink: 0;
}
.icon-btn:hover { color: var(--color-primary); border-color: var(--color-primary-light); }
.icon-btn svg { width: 19px; height: 19px; }
.notif-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-green); border: 2px solid var(--bg); display: none;
}
.notif-dot.show { display: block; }

.hamburger {
  display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border-color);
  background: var(--bg-soft); align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  flex-shrink: 0;
}
.hamburger span { width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 1200; opacity: 0; visibility: hidden;
  transition: opacity var(--transition);
}
.mobile-nav-overlay.open { opacity: 1; visibility: visible; }
.mobile-nav {
  position: fixed; top: 0; right: 0; height: 100%; width: min(340px, 86vw); background: var(--bg-elevated);
  z-index: 1300; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform var(--transition-slow);
  display: flex; flex-direction: column; padding: 20px;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.mobile-nav-close {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; color: var(--text-primary);
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }
.mobile-nav-links a {
  padding: 14px 16px; border-radius: var(--r-md); font-weight: 600; font-size: 16px; color: var(--text-primary);
}
.mobile-nav-links a.active, .mobile-nav-links a:hover { background: var(--gradient-soft); color: var(--color-primary); }
.mobile-nav-actions { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }

/* Dropdowns (search / notifications / profile) */
.dropdown-panel {
  position: absolute; top: calc(100% + 12px); right: 0; width: 340px; background: var(--bg-elevated);
  border: 1px solid var(--border-color); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 16px; z-index: 1100; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: var(--transition); max-height: 70vh; overflow-y: auto;
}
.dropdown-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.header-actions .relative { position: relative; }
.dropdown-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.dropdown-empty { padding: 24px 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: var(--r-sm); transition: var(--transition); }
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread { background: var(--gradient-soft); }
.notif-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--gradient-primary); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.notif-body h4 { font-size: 13.5px; margin-bottom: 2px; }
.notif-body p { font-size: 12.5px; color: var(--text-muted); }
.dropdown-footer-btn { width: 100%; margin-top: 8px; text-align: center; padding: 8px; font-size: 13px; font-weight: 700; color: var(--color-primary); border-radius: var(--r-sm); background: none; border: none; }
.dropdown-footer-btn:hover { background: var(--bg-soft); }

.search-panel input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border-color);
  background: var(--bg-soft); font-size: 14px; color: var(--text-primary); margin-bottom: 10px;
}
.search-results { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.search-result-item { padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.search-result-item:hover { background: var(--bg-soft); color: var(--color-primary); }
.search-result-item span.tag { font-size: 11px; color: var(--text-muted); background: var(--bg-soft); padding: 3px 8px; border-radius: var(--r-full); }

.profile-menu-list a, .profile-menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--text-primary); background: none; border: none; text-align: left;
}
.profile-menu-list a:hover, .profile-menu-list button:hover { background: var(--bg-soft); color: var(--color-primary); }

.lang-select {
  padding: 9px 12px; border-radius: var(--r-full); border: 1px solid var(--border-color); background: var(--bg-soft);
  font-size: 13px; font-weight: 700; color: var(--text-primary); cursor: pointer;
}

/* =============== HERO =============== */
.hero {
  position: relative; padding: 72px 0 96px; background: var(--gradient-hero); overflow: hidden;
}
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.5; z-index: 0;
}
.blob-1 { width: 380px; height: 380px; background: var(--color-primary-light); top: -120px; left: -120px; }
.blob-2 { width: 320px; height: 320px; background: var(--color-purple); top: 40%; right: -140px; }
.blob-3 { width: 260px; height: 260px; background: var(--color-green); bottom: -100px; left: 30%; opacity: 0.3; }

.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border-color);
  padding: 8px 16px 8px 8px; border-radius: var(--r-full); font-size: 13px; font-weight: 700; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.hero-badge .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--gradient-green); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.hero-title { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.08; margin-bottom: 22px; }
.hero-desc { font-size: 18px; color: var(--text-secondary); max-width: 540px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat strong { font-size: 26px; display: block; }
.hero-stat span { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* Hero visual (Shooli mascot) */
.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 420px; }
.shooli-orb-wrap { position: relative; width: 300px; height: 300px; }
.shooli-orb {
  width: 100%; height: 100%; border-radius: 50%; background: var(--gradient-primary);
  box-shadow: 0 30px 70px rgba(79,107,255,.4); position: relative; display: flex; align-items: center; justify-content: center;
  animation: float-orb 6s ease-in-out infinite;
}
.shooli-orb::before {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  background: linear-gradient(160deg, rgba(255,255,255,.35), transparent 60%);
}
.shooli-face { position: relative; z-index: 1; display: flex; gap: 26px; }
.shooli-eye { width: 22px; height: 30px; background: #fff; border-radius: 50%; animation: blink 4.5s infinite; }
.shooli-orb .shooli-cheek { position:absolute; width:22px; height:12px; background:rgba(255,255,255,.35); border-radius:50%; }
.shooli-ring {
  position: absolute; border: 2px dashed rgba(79,107,255,.35); border-radius: 50%; inset: -30px;
  animation: spin-slow 18s linear infinite;
}
.float-card {
  position: absolute; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700;
  animation: float-card 5s ease-in-out infinite;
}
.float-card svg, .float-card .fc-icon { width: 20px; height: 20px; flex-shrink: 0; }
.card-subject { top: 6%; left: -6%; animation-delay: 0s; }
.card-message { bottom: 12%; left: -12%; animation-delay: 1.2s; }
.card-progress { top: 55%; right: -14%; animation-delay: 0.6s; width: 168px; }
.card-badge { top: -4%; right: 4%; animation-delay: 1.8s; }
.fc-icon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.mini-progress { height: 6px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; margin-top: 6px; }
.mini-progress span { display: block; height: 100%; background: var(--gradient-green); border-radius: 4px; }

/* =============== SUBJECT BADGES ROW =============== */
.subject-badges-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.subject-badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg-elevated); border: 1px solid var(--border-color);
  padding: 8px 14px; border-radius: var(--r-full); font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm);
}

/* =============== AI ASSISTANT SECTION =============== */
.assistant-section {
  background: var(--color-navy); border-radius: var(--r-xl); margin: 0 auto; position: relative; overflow: hidden;
  color: #fff; padding: 64px 40px;
}
.assistant-section::before {
  content: ''; position: absolute; inset: 0; background: var(--gradient-hero); opacity: 0.6;
}
.assistant-inner { position: relative; z-index: 1; }
.assistant-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.assistant-head .section-tag { background: rgba(255,255,255,0.1); color: #cdd6ff; }
.assistant-head h2 { color: #fff; font-size: clamp(26px,4vw,38px); margin-bottom: 14px; }
.assistant-head p { color: #c9cee0; font-size: 16px; }

.mode-toggle {
  display: inline-flex; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-full); padding: 5px; gap: 4px; margin: 0 auto 32px; display: flex; width: fit-content;
}
.mode-toggle button {
  border: none; background: transparent; color: #cfd4e6; font-weight: 700; font-size: 14px; padding: 10px 22px;
  border-radius: var(--r-full); display: flex; align-items: center; gap: 8px; transition: var(--transition);
}
.mode-toggle button.active { background: #fff; color: var(--color-navy); box-shadow: var(--shadow-sm); }

.assistant-panel {
  background: #fff; border-radius: var(--r-lg); color: var(--text-primary); box-shadow: var(--shadow-lg);
  max-width: 760px; margin: 0 auto; overflow: hidden;
}

/* Voice panel */
.voice-panel { padding: 40px 24px; text-align: center; }
.mic-ring-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; }
.mic-btn {
  width: 110px; height: 110px; border-radius: 50%; background: var(--gradient-primary); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-glow); position: relative; z-index: 2;
  transition: var(--transition);
}
.mic-btn svg { width: 40px; height: 40px; }
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.listening { background: var(--gradient-green); animation: pulse-ring-btn 1.4s ease-in-out infinite; }
.pulse-ring { position: absolute; border-radius: 50%; border: 3px solid var(--color-primary-light); opacity: 0; }
.mic-ring-wrap.listening .pulse-ring { animation: pulse-ring 1.8s ease-out infinite; }
.pulse-ring:nth-child(2) { animation-delay: .5s !important; }
.pulse-ring:nth-child(3) { animation-delay: 1s !important; }
.voice-status { font-weight: 700; font-size: 15px; margin-bottom: 6px; min-height: 20px; }
.voice-hint { color: var(--text-muted); font-size: 13.5px; margin-bottom: 20px; }
.sound-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 28px; margin-bottom: 16px; }
.sound-wave span { width: 4px; height: 6px; background: var(--color-primary); border-radius: 3px; }
.sound-wave.active span { animation: wave 1s ease-in-out infinite; }
.sound-wave span:nth-child(1){animation-delay:0s} .sound-wave span:nth-child(2){animation-delay:.1s}
.sound-wave span:nth-child(3){animation-delay:.2s} .sound-wave span:nth-child(4){animation-delay:.3s}
.sound-wave span:nth-child(5){animation-delay:.4s} .sound-wave span:nth-child(6){animation-delay:.3s}
.sound-wave span:nth-child(7){animation-delay:.2s} .sound-wave span:nth-child(8){animation-delay:.1s}
.sound-wave span:nth-child(9){animation-delay:0s}
.voice-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.voice-transcript {
  margin-top: 24px; background: var(--bg-soft); border-radius: var(--r-md); padding: 16px; text-align: left; font-size: 14px;
  display: none;
}
.voice-transcript.show { display: block; }
.voice-unsupported { display: none; background: #fff3f0; color: #b4231e; border: 1px solid #ffd7cf; border-radius: var(--r-md); padding: 14px 18px; font-size: 13.5px; margin-top: 16px; text-align: left; }
.voice-unsupported.show { display: flex; gap: 10px; align-items: flex-start; }

/* Chat panel */
.chat-panel { display: none; flex-direction: column; height: 560px; }
.chat-panel.active-mode { display: flex; }
.voice-panel.hidden-mode { display: none; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
.chat-toolbar-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.chat-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--gradient-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 800; }
.chat-toolbar-actions { display: flex; gap: 8px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.chat-empty { text-align: center; margin: auto; color: var(--text-muted); }
.chat-empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--gradient-soft); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: var(--color-primary); }
.starter-questions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.starter-chip {
  border: 1px solid var(--border-color); background: var(--bg-elevated); border-radius: var(--r-full); padding: 9px 16px;
  font-size: 13px; font-weight: 600; color: var(--text-primary); transition: var(--transition);
}
.starter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--gradient-soft); }

.msg { display: flex; gap: 10px; max-width: 88%; animation: fade-up .35s ease; }
.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 800; }
.msg-ai .msg-avatar { background: var(--gradient-primary); }
.msg-user .msg-avatar { background: var(--gradient-green); }
.msg-bubble { padding: 12px 16px; border-radius: var(--r-md); font-size: 14.5px; line-height: 1.55; }
.msg-ai .msg-bubble { background: var(--bg-soft); border-bottom-left-radius: 4px; }
.msg-user .msg-bubble { background: var(--gradient-primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble p + p { margin-top: 8px; }
.msg-bubble ul, .msg-bubble ol { margin: 8px 0 0 18px; list-style: disc; }
.msg-bubble ol { list-style: decimal; }
.msg-actions { display: flex; gap: 6px; margin-top: 6px; }
.msg-actions button { background: none; border: none; color: var(--text-muted); font-size: 12px; display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; }
.msg-actions button:hover { color: var(--color-primary); background: var(--bg-soft); }
.typing-dots { display: inline-flex; gap: 4px; padding: 14px 16px; background: var(--bg-soft); border-radius: var(--r-md); }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: typing-bounce 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; } .typing-dots span:nth-child(3) { animation-delay: .4s; }

.chat-input-bar { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border-color); }
.chat-input-bar textarea {
  flex: 1; border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 12px 14px; resize: none;
  font-size: 14.5px; max-height: 120px; background: var(--bg-soft); color: var(--text-primary); min-height: 46px;
}
.chat-send-btn, .chat-mic-btn {
  width: 46px; height: 46px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-send-btn { background: var(--gradient-primary); color: #fff; }
.chat-mic-btn { background: var(--bg-soft); border: 1px solid var(--border-color); color: var(--text-primary); }
.chat-mic-btn.listening { background: var(--gradient-green); color: #fff; animation: pulse-ring-btn 1.4s infinite; }

/* =============== SUBJECTS =============== */
.subjects-grid { grid-template-columns: repeat(4, 1fr); }
.subject-card {
  background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 26px 22px;
  text-align: left; transition: var(--transition); cursor: pointer; display: block; width: 100%;
}
.subject-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.subject-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; margin-bottom: 16px; }
.subject-card h3 { font-size: 17px; margin-bottom: 6px; }
.subject-card p { font-size: 13.5px; color: var(--text-secondary); }

/* =============== FEATURE CARDS =============== */
.features-grid { grid-template-columns: repeat(4, 1fr); }
.feature-card {
  background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 28px 24px;
  transition: var(--transition); position: relative; overflow: hidden;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-icon { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; margin-bottom: 18px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; color: var(--text-secondary); }

/* =============== HOW IT WORKS =============== */
.steps-grid { grid-template-columns: repeat(3, 1fr); position: relative; }
.step-card { text-align: center; padding: 12px; position: relative; }
.step-num {
  width: 64px; height: 64px; border-radius: 50%; background: var(--gradient-primary); color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; box-shadow: var(--shadow-glow);
}
.step-card h3 { font-size: 19px; margin-bottom: 8px; }
.step-card p { color: var(--text-secondary); font-size: 14.5px; max-width: 260px; margin: 0 auto; }
.step-connector { position: absolute; top: 32px; left: 100%; width: 100%; height: 2px; background: repeating-linear-gradient(90deg, var(--border-color) 0 8px, transparent 8px 16px); }

/* =============== FOR SCHOOLS =============== */
.schools-section { background: var(--bg-soft); border-radius: var(--r-xl); padding: 64px 40px; }
.schools-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.schools-list { display: grid; gap: 14px; margin: 24px 0 32px; }
.schools-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; font-weight: 600; }
.check-badge { width: 26px; height: 26px; border-radius: 50%; background: var(--gradient-green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; margin-top: 1px; }
.school-preview-cards { display: grid; gap: 16px; }
.preview-card { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.preview-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.preview-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.preview-bar-row .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.preview-bar-row .bar span { display: block; height: 100%; border-radius: 4px; background: var(--gradient-primary); }

/* =============== ABOUT =============== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-cards { display: grid; gap: 16px; }
.about-card { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 22px; }
.about-card h4 { font-size: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.about-card p { font-size: 14px; color: var(--text-secondary); }
.about-icon-sm { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; }

/* =============== CONTACT FORM =============== */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; }
.contact-info-card { background: var(--gradient-primary); color: #fff; border-radius: var(--r-lg); padding: 36px; height: fit-content; }
.contact-info-card h3 { font-size: 22px; margin-bottom: 12px; }
.contact-info-card p { color: rgba(255,255,255,.88); font-size: 14.5px; margin-bottom: 24px; }
.contact-info-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; font-size: 14px; }
.contact-info-item .ci-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.form-card { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--r-md); border: 1.5px solid var(--border-color);
  background: var(--bg-soft); font-size: 14.5px; color: var(--text-primary); transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--color-primary); background: var(--bg-elevated); }
.form-group textarea { min-height: 110px; resize: vertical; }
.form-error { color: #dc2626; font-size: 12.5px; margin-top: 6px; display: none; font-weight: 600; }
.form-group.invalid input, .form-group.invalid select, .form-group.invalid textarea { border-color: #dc2626; }
.form-group.invalid .form-error { display: block; }

/* =============== FOOTER =============== */
.site-footer { background: var(--color-navy); color: #cdd3e5; padding: 72px 0 28px; margin-top: 96px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { color: #9aa3bd; font-size: 14px; max-width: 300px; margin-bottom: 20px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #fff; transition: var(--transition); }
.footer-social a:hover { background: var(--gradient-primary); transform: translateY(-3px); }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 18px; letter-spacing: .04em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: 12px; }
.footer-col a { color: #9aa3bd; font-size: 14.5px; transition: var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #7c86a3; }

/* =============== TOASTS =============== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, 88vw); }
.toast {
  background: var(--bg-elevated); color: var(--text-primary); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 600; border-left: 4px solid var(--color-primary);
  animation: toast-in .35s ease;
}
.toast.success { border-left-color: var(--color-green); }
.toast.error { border-left-color: #dc2626; }
.toast.warning { border-left-color: #f59e0b; }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); flex-shrink: 0; }

/* =============== MODALS =============== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 2500; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--bg-elevated); border-radius: var(--r-lg); max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modal-pop .3s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border-color); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 24px; }
.modal-close-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-soft); border: none; display: flex; align-items: center; justify-content: center; }

/* =============== DASHBOARD (students/teachers) shared =============== */
.dash-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.dash-sidebar { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 20px; position: sticky; top: calc(var(--header-height) + 20px); }
.dash-side-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.dash-side-link.active, .dash-side-link:hover { background: var(--gradient-soft); color: var(--color-primary); }
.dash-main { min-width: 0; }
.welcome-banner { background: var(--gradient-primary); border-radius: var(--r-lg); padding: 30px 32px; color: #fff; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.welcome-banner h2 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.welcome-banner p { color: rgba(255,255,255,.88); font-size: 14.5px; }
.dash-cards-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; }
.dash-card { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 22px; }
.dash-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dash-card-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
.dash-card h4 { font-size: 13.5px; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.dash-card .big-num { font-size: 26px; font-weight: 800; }
.progress-bar { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress-bar span { display: block; height: 100%; background: var(--gradient-primary); border-radius: 4px; transition: width .6s ease; }
.dash-panel { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 24px; margin-bottom: 24px; }
.dash-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.dash-panel-head h3 { font-size: 17px; }
.activity-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.activity-row:last-child { border-bottom: none; }
.activity-row .tag { font-size: 11.5px; padding: 4px 10px; border-radius: var(--r-full); background: var(--gradient-soft); color: var(--color-primary-dark); font-weight: 700; }
.two-col-panels { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.tool-card-grid { grid-template-columns: repeat(3, 1fr); }
.tool-card { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 20px; cursor: pointer; transition: var(--transition); text-align: left; }
.tool-card:hover { border-color: var(--color-primary-light); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.tool-card .feature-icon { margin-bottom: 12px; width: 44px; height: 44px; border-radius: 12px; font-size: 19px; }
.tool-card h4 { font-size: 14.5px; margin-bottom: 4px; }
.tool-card p { font-size: 12.5px; color: var(--text-secondary); }

/* Recommended topic pill list */
.topic-pill { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-soft); margin-bottom: 10px; font-size: 13.5px; font-weight: 600; }

/* =============== STUDY PLANNER =============== */
.planner-form-grid { grid-template-columns: repeat(2, 1fr); }
.subject-chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-chip-select .chip { padding: 9px 16px; border-radius: var(--r-full); border: 1.5px solid var(--border-color); font-size: 13px; font-weight: 700; background: var(--bg-soft); }
.subject-chip-select .chip.selected { background: var(--gradient-primary); color: #fff; border-color: transparent; }
.plan-days-remaining { display: flex; align-items: center; gap: 16px; background: var(--gradient-soft); border-radius: var(--r-md); padding: 16px 20px; margin: 16px 0; }
.plan-days-remaining strong { font-size: 30px; color: var(--color-primary-dark); }
.plan-day-card { background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 14px; }
.plan-day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.plan-day-head h4 { font-size: 15px; }
.plan-task { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.plan-task input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--color-primary); flex-shrink: 0; }
.plan-task.done label { text-decoration: line-through; color: var(--text-muted); }
.plan-task label { flex: 1; cursor: pointer; }

/* =============== QUIZ =============== */
.quiz-setup-grid { grid-template-columns: repeat(2, 1fr); }
.quiz-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 14px; }
.quiz-timer { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; background: var(--gradient-soft); color: var(--color-primary-dark); padding: 8px 18px; border-radius: var(--r-full); }
.quiz-timer.low-time { background: #fff0ee; color: #dc2626; }
.quiz-progress-track { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; margin-bottom: 28px; }
.quiz-progress-track span { display: block; height: 100%; background: var(--gradient-primary); border-radius: 4px; transition: width .4s ease; }
.quiz-question { font-size: 20px; margin-bottom: 24px; }
.quiz-options { display: grid; gap: 12px; margin-bottom: 28px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); border: 2px solid var(--border-color);
  background: var(--bg-elevated); text-align: left; font-size: 15px; font-weight: 600; transition: var(--transition);
}
.quiz-option:hover { border-color: var(--color-primary-light); }
.quiz-option.selected { border-color: var(--color-primary); background: var(--gradient-soft); }
.quiz-option.correct { border-color: var(--color-green); background: #eafbf0; }
.quiz-option.incorrect { border-color: #dc2626; background: #fff0ee; }
.quiz-option .opt-letter { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.quiz-option.selected .opt-letter { background: var(--color-primary); color: #fff; }
.quiz-option.correct .opt-letter { background: var(--color-green); color: #fff; }
.quiz-option.incorrect .opt-letter { background: #dc2626; color: #fff; }
.quiz-nav-row { display: flex; justify-content: space-between; align-items: center; }
.quiz-explanation { margin-top: 16px; padding: 14px 16px; background: var(--bg-soft); border-radius: var(--r-md); font-size: 13.5px; display: none; }
.quiz-explanation.show { display: block; }
.quiz-result-score { text-align: center; padding: 20px 0; }
.score-ring { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--color-primary) calc(var(--pct)*1%), var(--bg-soft) 0); position: relative; }
.score-ring::before { content: ''; position: absolute; inset: 12px; background: var(--bg-elevated); border-radius: 50%; }
.score-ring span { position: relative; z-index: 1; font-size: 30px; font-weight: 800; }
.review-item { border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; }
.review-item.wrong { border-color: #f6b8ae; background: #fff8f6; }
.review-item.right { border-color: #a9e6c1; background: #f5fcf8; }

/* =============== TEACHER MODALS: forms =============== */
.gen-form-grid { grid-template-columns: 1fr 1fr; }
.range-value { font-weight: 800; color: var(--color-primary); }
.generated-list { display: grid; gap: 10px; margin-top: 16px; }
.generated-item { background: var(--bg-soft); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; }

/* =============== SKELETON LOADING =============== */
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border-color) 37%, var(--bg-soft) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--r-md); }
.skeleton-card { height: 120px; }

/* =============== SPINNER =============== */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin-slow .6s linear infinite; }
.spinner-dark { border: 2.5px solid rgba(15,23,42,.15); border-top-color: var(--color-primary); }

/* =============== MISC =============== */
.page-hero { padding: 56px 0 40px; text-align: center; }
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 14px; }
.page-hero p { color: var(--text-secondary); font-size: 17px; max-width: 600px; margin: 0 auto; }
hr.divider { border: none; border-top: 1px solid var(--border-color); margin: 48px 0; }
.chip-list { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-pill { padding: 5px 12px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 700; background: var(--gradient-soft); color: var(--color-primary-dark); }

/* =============== ICON COLOR UTILITIES =============== */
.bg-blue { background: linear-gradient(135deg,#4f6bff,#6d8bff); }
.bg-purple { background: linear-gradient(135deg,#8b5cf6,#a78bfa); }
.bg-green { background: linear-gradient(135deg,#22c55e,#10b981); }
.bg-orange { background: linear-gradient(135deg,#f59e0b,#f97316); }
.bg-pink { background: linear-gradient(135deg,#ec4899,#f472b6); }
.bg-teal { background: linear-gradient(135deg,#14b8a6,#22d3ee); }
.bg-red { background: linear-gradient(135deg,#ef4444,#f87171); }
.bg-indigo { background: linear-gradient(135deg,#6366f1,#818cf8); }

