/* ==========================================================================
   AIM HIGH SKILLS - Design System & Modern Responsive Stylesheet
   Target Audience: School Students (Grades 4-8, Ages 9-14)
   Aesthetic: Bright, Energetic, Child-Safe, Tactile, Modern & Encouraging
   ========================================================================== */

:root {
  /* Brand Color Palette */
  --primary-blue: #0284c7;        /* Energetic Sky Blue */
  --primary-blue-deep: #0369a1;
  --primary-blue-light: #e0f2fe;
  --secondary-yellow: #f59e0b;    /* Warm Sunshine Gold */
  --secondary-yellow-light: #fef3c7;
  --accent-green: #10b981;        /* Vibrant Mint Green */
  --accent-green-light: #d1fae5;
  --accent-purple: #8b5cf6;       /* Magic Lavender */
  --accent-purple-light: #ede9fe;
  --accent-coral: #f43f5e;        /* Playful Coral */
  --accent-coral-light: #ffe4e6;
  
  /* Neutral Canvas */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --border-accent: #cbd5e1;

  /* Playful Tactile Radii */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --radius-full: 9999px;

  /* Depth & Shadows */
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(2, 132, 199, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(2, 132, 199, 0.14), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.35);

  /* Typography */
  --font-heading: 'Fredoka', 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Accessible focus ring for kids */
:focus-visible {
  outline: 3px solid var(--secondary-yellow);
  outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-dark);
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  user-select: none;
}

/* ==========================================================================
   NAVIGATION & TOP APP BAR
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--border-light);
  padding: 0.75rem 1.25rem;
  transition: var(--transition-fast);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  max-width: 58px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(2, 132, 199, 0.22));
  transition: transform var(--transition-bounce);
  display: block;
}

.brand-wrapper:hover .brand-logo-img {
  transform: scale(1.08) rotate(-2deg);
}

.brand-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-blue), #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.3);
  transform: rotate(-3deg);
  transition: transform var(--transition-bounce);
}

/* Auth / Login Screen Logo */
.auth-logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.auth-logo-img {
  height: 110px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(2, 132, 199, 0.18));
  transition: transform var(--transition-bounce);
}

.auth-logo-img:hover {
  transform: scale(1.05);
}

/* Dashboard & Sections Logo Accents */
.hero-tag-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  padding: 1px 3px;
}

.section-inline-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

.certificate-logo-img {
  height: 75px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.admin-header-logo, .parent-header-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.1));
}

.brand-wrapper:hover .brand-icon-badge {
  transform: rotate(6deg) scale(1.08);
}

.brand-text h1 {
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-text h1 span {
  color: var(--primary-blue);
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary-yellow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Nav Links for Desktop & Tablet */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  transition: all var(--transition-fast);
}

.nav-item-btn:hover {
  color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.nav-item-btn.active {
  color: #fff;
  background: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* Header Utilities & Profile */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  border: 1.5px solid var(--border-light);
  color: var(--text-body);
  font-size: 1.1rem;
  transition: var(--transition-bounce);
}

.tool-pill-btn:hover {
  background: #fff;
  border-color: var(--primary-blue);
  transform: scale(1.08);
}

.tool-pill-btn.active {
  background: var(--secondary-yellow-light);
  border-color: var(--secondary-yellow);
  color: var(--secondary-yellow);
}

/* Gamified Stats Chips */
.gamified-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 800;
  border: 2px solid transparent;
}

.chip-stars {
  background: var(--secondary-yellow-light);
  color: #b45309;
  border-color: #fde68a;
}

.chip-streak {
  background: var(--accent-coral-light);
  color: #be123c;
  border-color: #fecdd3;
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem;
  background: #ffffff;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.user-profile-badge:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbcfe8, #f472b6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.user-meta {
  text-align: left;
}

.user-meta-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
}

.user-meta-grade {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-blue);
}

/* Teacher Portal Button in Header */
.teacher-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px dashed #94a3b8;
  transition: var(--transition-fast);
}

.teacher-nav-btn:hover {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* Mobile Bottom Navigation Bar */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-top: 2px solid var(--border-light);
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 95;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.mobile-nav-btn span.icon {
  font-size: 1.35rem;
}

.mobile-nav-btn.active {
  color: var(--primary-blue);
  background: var(--primary-blue-light);
}

/* ==========================================================================
   MAIN APP WRAPPER & CONTAINER
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
}

/* View Section Control */
.app-view {
  display: none;
  animation: fadeInView 0.3s ease-out forwards;
}

.app-view.active {
  display: block;
}

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

/* ==========================================================================
   HERO BANNER & STUDENT OVERVIEW
   ========================================================================== */
.dashboard-hero {
  position: relative;
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
  border-radius: var(--radius-xl);
  color: #fff;
  padding: 2.25rem 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 20%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(254, 240, 138, 0.15);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.hero-title {
  color: #ffffff;
  font-size: 2.2rem;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-title span {
  color: #fef08a;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-desc {
  font-size: 1.05rem;
  color: #f0f9ff;
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.hero-actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual-card {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-illustration {
  width: 290px;
  height: 190px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
  border: 4px solid rgba(255, 255, 255, 0.9);
  transition: transform var(--transition-bounce);
}

.hero-illustration:hover {
  transform: scale(1.04) rotate(-1deg);
}

/* Progress summary widget inside hero */
.hero-progress-pill {
  margin-top: -15px;
  background: #ffffff;
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  border: 2px solid #fef08a;
}

.hero-progress-pill .progress-text {
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-progress-pill .progress-bar-mini {
  width: 80px;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.hero-progress-pill .progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-yellow), var(--accent-green));
  border-radius: var(--radius-full);
}

/* ==========================================================================
   BUTTONS & TACTILE COMPONENTS
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--secondary-yellow), #f59e0b);
  color: #78350f;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
  border: 2px solid #fde68a;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: var(--transition-bounce);
}

.btn-secondary:hover {
  background: #ffffff;
  color: var(--primary-blue);
  transform: translateY(-2px);
}

.btn-green {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  border: 2px solid #6ee7b7;
}

.btn-green:hover {
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.45);
  transform: translateY(-3px) scale(1.02);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

.btn-tts {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  border: 1.5px solid #ddd6fe;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition-bounce);
}

.btn-tts:hover {
  background: var(--accent-purple);
  color: #fff;
  transform: scale(1.05);
}

.btn-tts.speaking {
  background: var(--accent-coral);
  color: #fff;
  border-color: #fda4af;
  animation: pulseSpeech 1.2s infinite;
}

@keyframes pulseSpeech {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   COURSE EXPLORER & LESSON CARDS
   ========================================================================== */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title-wrap h2 {
  font-size: 1.7rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Grade Filter Pills */
.grade-filter-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.grade-pill-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.grade-pill-btn.active {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3);
}

/* Lessons Grid */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.lesson-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.lesson-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-blue);
}

.lesson-card.completed {
  border-color: #6ee7b7;
}

.lesson-card.locked {
  opacity: 0.7;
  filter: grayscale(0.2);
}

.lesson-card-header {
  height: 140px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lesson-card-bg-gradient-1 {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}
.lesson-card-bg-gradient-2 {
  background: linear-gradient(135deg, #10b981, #34d399);
}
.lesson-card-bg-gradient-3 {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.lesson-card-bg-gradient-4 {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
}
.lesson-card-bg-gradient-custom {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
}

.lesson-icon-floating {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  transition: transform var(--transition-bounce);
}

.lesson-card:hover .lesson-icon-floating {
  transform: scale(1.15) rotate(5deg);
}

.lesson-grade-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.lesson-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.status-completed {
  background: #ecfdf5;
  color: #047857;
  border: 1.5px solid #a7f3d0;
}

.status-in-progress {
  background: #fef3c7;
  color: #b45309;
  border: 1.5px solid #fde68a;
}

.status-locked {
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid #cbd5e1;
}

.lesson-card-body {
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lesson-number-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.lesson-title {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.lesson-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.lesson-meta-features {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1.5px dashed var(--border-light);
  margin-bottom: 1.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lesson-feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lesson-card-footer {
  padding: 0 1.5rem 1.25rem;
}

.btn-start-lesson {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  background: var(--primary-blue-light);
  color: var(--primary-blue-deep);
  border: 2px solid #bae6fd;
  transition: all var(--transition-fast);
}

.lesson-card:hover .btn-start-lesson {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.lesson-card.completed .btn-start-lesson {
  background: var(--accent-green-light);
  color: #065f46;
  border-color: #a7f3d0;
}

/* ==========================================================================
   LESSON PLAYER DETAIL VIEW
   ========================================================================== */
.lesson-player-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.player-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.breadcrumb-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-blue);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  transition: var(--transition-fast);
}

.breadcrumb-back-btn:hover {
  background: var(--primary-blue-light);
  transform: translateX(-3px);
}

.lesson-header-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  border: 2px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.lesson-header-info h2 {
  font-size: 1.85rem;
  line-height: 1.2;
  margin-bottom: 0.45rem;
}

.lesson-nlp-focus-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

/* Content Resource Tabs (Video, Audio, PDF, Google Forms, Quiz, Upload) */
.resource-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border-light);
  scrollbar-width: thin;
}

.resource-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.resource-tab-btn:hover {
  color: var(--primary-blue);
  background: #f1f5f9;
}

.resource-tab-btn.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
  background: #ffffff;
  font-weight: 700;
}

/* Tab Panels */
.tab-content-panel {
  display: none;
  background: #ffffff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 2px solid var(--border-light);
  border-top: none;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  animation: fadeInView 0.25s ease-out;
}

.tab-content-panel.active {
  display: block;
}

/* 1. Simulated Responsive Video Player */
.video-player-frame {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.5rem;
}

.video-screen {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 480px;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
}

.video-stage-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay-coach {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  pointer-events: none;
}

.video-overlay-coach * {
  pointer-events: auto;
}

.video-top-tips {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-coach-tip-pill {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(254, 240, 138, 0.4);
}

.video-center-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.9);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  border: 4px solid #fff;
  box-shadow: 0 0 30px rgba(2, 132, 199, 0.6);
  cursor: pointer;
  transition: transform var(--transition-bounce), background var(--transition-fast);
}

.video-center-play-btn:hover {
  transform: scale(1.15);
  background: var(--primary-blue);
}

/* Custom Interactive Video Controls */
.video-custom-controls {
  background: #1e293b;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.video-seek-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  background: #334155;
  border-radius: var(--radius-full);
  cursor: pointer;
  outline: none;
}

.video-seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--secondary-yellow);
  border: 2px solid #fff;
  cursor: pointer;
}

.video-buttons-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 0.9rem;
}

.video-controls-left, .video-controls-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.video-ctrl-btn {
  color: #e2e8f0;
  font-size: 1.15rem;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.video-ctrl-btn:hover {
  color: var(--secondary-yellow);
  transform: scale(1.1);
}

.video-chapter-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.chapter-chip {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition-fast);
}

.chapter-chip:hover {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

/* 2. Interactive Audio Player (Modulation & Pitch) */
.audio-player-card {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 2px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.audio-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

.audio-waveform-container {
  height: 80px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1.5px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.wave-bar {
  flex: 1;
  max-width: 8px;
  height: 25%;
  background: #10b981;
  border-radius: 4px;
  transition: height 0.15s ease;
}

.wave-bar.playing {
  animation: wavePulse 0.8s ease-in-out infinite alternate;
}

@keyframes wavePulse {
  0% { height: 15%; background: #34d399; }
  50% { height: 85%; background: #059669; }
  100% { height: 30%; background: #10b981; }
}

.audio-interactive-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pitch-slider-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid #a7f3d0;
  font-size: 0.85rem;
  font-weight: 700;
}

/* 3. PDF Worksheet Viewer & Download */
.pdf-viewer-card {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.pdf-preview-box {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  text-align: left;
  border: 1px solid var(--border-light);
  position: relative;
}

.pdf-watermark {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-blue);
  background: var(--primary-blue-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.worksheet-fillable-item {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--secondary-yellow);
}

.worksheet-fillable-item label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-dark);
  display: block;
  margin-bottom: 0.4rem;
}

.worksheet-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-accent);
  font-family: inherit;
  font-size: 0.95rem;
  background: #ffffff;
}

/* 4. Google Forms / External Activity Simulator */
.gforms-embed-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid #ddd6fe;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.gforms-header-bar {
  background: #7c3aed;
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gforms-body {
  padding: 2rem;
}

/* ==========================================================================
   GAMIFIED QUIZ ENGINE & INSTANT FEEDBACK
   ========================================================================== */
.quiz-engine-card {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 2.5px solid var(--border-light);
  padding: 2.25rem;
  position: relative;
}

.quiz-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.quiz-progress-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.quiz-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--secondary-yellow-light);
  color: #92400e;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.9rem;
}

.quiz-meter-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.quiz-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
}

.quiz-question-box {
  margin-bottom: 1.75rem;
}

.quiz-question-text {
  font-size: 1.35rem;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.quiz-opt-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 2.5px solid var(--border-light);
  background: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: left;
  transition: all var(--transition-fast);
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
  transform: translateX(4px);
}

.opt-letter-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.quiz-opt-btn:hover .opt-letter-circle {
  background: var(--primary-blue);
  color: #fff;
}

/* Quiz Answer Feedback States */
.quiz-opt-btn.correct {
  border-color: var(--accent-green);
  background: #ecfdf5;
  color: #065f46;
}

.quiz-opt-btn.correct .opt-letter-circle {
  background: var(--accent-green);
  color: #fff;
}

.quiz-opt-btn.incorrect {
  border-color: var(--accent-coral);
  background: #fff1f2;
  color: #9f1239;
  animation: shakeOpt 0.35s;
}

.quiz-opt-btn.incorrect .opt-letter-circle {
  background: var(--accent-coral);
  color: #fff;
}

@keyframes shakeOpt {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-feedback-box {
  display: none;
  padding: 1.15rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  animation: fadeInView 0.2s ease-out;
}

.quiz-feedback-box.correct {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #d1fae5;
  border: 2px solid #6ee7b7;
  color: #065f46;
}

.quiz-feedback-box.incorrect {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffe4e6;
  border: 2px solid #fda4af;
  color: #9f1239;
}

/* ==========================================================================
   MULTI-MODAL ASSIGNMENT UPLOADER
   ========================================================================== */
.assignment-container {
  max-width: 800px;
  margin: 0 auto;
}

.assignment-prompt-card {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.uploader-tabs-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.upload-type-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 2px solid var(--border-light);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.upload-type-tab.active {
  background: #ffffff;
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.uploader-subpanel {
  display: none;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2.5px dashed var(--border-accent);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.uploader-subpanel.active {
  display: block;
}

/* Voice Recorder UI */
.voice-recorder-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.recorder-mic-btn {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.4);
  cursor: pointer;
  transition: transform var(--transition-bounce);
  border: 4px solid #fff;
}

.recorder-mic-btn:hover {
  transform: scale(1.08);
}

.recorder-mic-btn.recording {
  animation: pulseRecording 1.2s infinite;
  background: #dc2626;
}

@keyframes pulseRecording {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.recorder-timer {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
}

.recorder-canvas-wrap {
  width: 100%;
  max-width: 480px;
  height: 60px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Upload Progress Simulator */
.upload-progress-container {
  display: none;
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
}

.upload-progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.5rem 0;
}

.upload-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* ==========================================================================
   MY PROGRESS, REWARDS & BADGES VIEW
   ========================================================================== */
.rewards-hero-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px solid #fbbf24;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.badge-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
  position: relative;
}

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

.badge-card.unlocked {
  border-color: #fde68a;
  background: radial-gradient(circle at 50% 30%, #fffbeb 0%, #ffffff 70%);
}

.badge-card.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.badge-icon-bubble {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde047);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.25);
}

.badge-title {
  font-size: 1.05rem;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.badge-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   PARENTAL CONTROL DASHBOARD MODE
   ========================================================================== */
.parent-dashboard-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 2.5px solid #cbd5e1;
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
}

.parent-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.parent-metric-box {
  background: #f8fafc;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.parent-metric-val {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--primary-blue);
  line-height: 1.2;
}

/* ==========================================================================
   TEACHER / ADMIN DASHBOARD
   ========================================================================== */
.admin-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 2.5px solid var(--accent-purple);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.admin-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-form-group {
  margin-bottom: 1.35rem;
}

.admin-form-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.admin-form-label span.req {
  color: var(--accent-coral);
}

.admin-input, .admin-textarea, .admin-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  font-family: inherit;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: var(--transition-fast);
}

.admin-input:focus, .admin-textarea:focus, .admin-select:focus {
  background: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.quiz-builder-container {
  background: #faf5ff;
  border: 2px dashed #d8b4fe;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.quiz-question-row-card {
  background: #ffffff;
  border: 1.5px solid #e9d5ff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   AI CHATBOT ASSISTANT ("AIM HIGH BUDDY" - SPARKY)
   ========================================================================== */
.chatbot-widget-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1000;
}

.chatbot-bubble-trigger {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid var(--primary-blue);
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-bounce);
  overflow: hidden;
}

.chatbot-bubble-trigger:hover {
  transform: scale(1.1) rotate(-5deg);
}

.chatbot-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chatbot-badge-notification {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: var(--accent-coral);
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Chat Drawer Panel */
.chatbot-drawer {
  position: fixed;
  bottom: 105px;
  right: 25px;
  width: 380px;
  max-width: calc(100vw - 30px);
  height: 540px;
  max-height: calc(100vh - 130px);
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 3px solid var(--primary-blue);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  animation: slideChatDrawer 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-drawer.open {
  display: flex;
}

@keyframes slideChatDrawer {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  background: linear-gradient(135deg, var(--primary-blue), #0ea5e9);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-mascot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-mascot img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

.chat-safety-banner {
  background: #fef2f2;
  border-bottom: 1.5px solid #fecdd3;
  padding: 0.5rem 0.85rem;
  font-size: 0.76rem;
  color: #9f1239;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-messages-scroll {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #f8fafc;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
}

.chat-bubble.bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-dark);
  border: 1.5px solid var(--border-light);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--primary-blue);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-quick-chips-row {
  padding: 0.65rem 0.85rem;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-quick-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--primary-blue-light);
  color: var(--primary-blue-deep);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid #bae6fd;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-quick-chip:hover {
  background: var(--primary-blue);
  color: #fff;
}

.chat-input-area {
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-top: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-accent);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-bounce);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  background: var(--primary-blue-deep);
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInView 0.2s ease-out;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 2.25rem;
  border: 3px solid var(--primary-blue);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  text-align: center;
  animation: scaleUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUpModal {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close-x {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Fullscreen Confetti Canvas Layer */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3000;
}

/* ==========================================================================
   CHILD-SAFE AUTHENTICATION VIEW
   ========================================================================== */
.auth-container {
  max-width: 500px;
  margin: 1.5rem auto 3rem;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 3px solid var(--primary-blue);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-tabs-row {
  display: flex;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.avatar-selector-grid {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.avatar-choice-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  background: #f8fafc;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.avatar-choice-btn:hover {
  transform: scale(1.15);
}

.avatar-choice-btn.selected {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.3);
}

/* Quick test student buttons */
.quick-students-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.quick-student-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-student-chip:hover {
  background: var(--secondary-yellow-light);
  border-color: var(--secondary-yellow);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE SCREENS)
   ========================================================================== */
@media (max-width: 1024px) {
  .dashboard-hero {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .hero-content {
    max-width: 100%;
  }
  .hero-actions-row {
    justify-content: center;
  }
  .hero-visual-card {
    margin-top: 1rem;
  }
}

@media (max-width: 768px) {
  .brand-logo-img {
    height: 40px;
    max-width: 44px;
  }
  .brand-text h1 {
    font-size: 1.15rem;
  }
  .brand-subtitle {
    display: none;
  }
  .auth-logo-img {
    height: 85px;
  }
  .nav-links {
    display: none; /* Handled by bottom bar */
  }
  .mobile-nav-bar {
    display: flex;
  }
  .main-content {
    padding-bottom: 6rem;
  }
  .lessons-grid {
    grid-template-columns: 1fr;
  }
  .chatbot-drawer {
    right: 15px;
    bottom: 90px;
    width: calc(100vw - 30px);
  }
  .chatbot-widget-container {
    bottom: 75px;
    right: 15px;
  }
  .quiz-engine-card {
    padding: 1.5rem 1rem;
  }
  .tab-content-panel {
    padding: 1.25rem 1rem;
  }
}
