/* ============================================================
   STYLES.CSS — Light Theme Dashboard Revision (Reference-Based)
   ============================================================ */

/* ── CSS Variables ── */
:root {
  /* Colors */
  --bg-app: #f4f7f6; /* Main grey background */
  --bg-sidebar: #1a2639; /* Dark navy */
  --bg-sidebar-hover: rgba(255,255,255,0.05);
  --bg-sidebar-active: rgba(255,255,255,0.1);
  --bg-card: #ffffff;
  
  --primary-green: #42b89d;
  --primary-green-hover: #359881;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  
  --border-light: #e2e8f0;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

  /* Stat Card Accents */
  --bg-mint: #e6f7f2;
  --text-mint: #258a6d;
  --bg-lavender: #eae3fa;
  --text-lavender: #7c4dff;
  --bg-peach: #feeedb;
  --text-peach: #e67e22;
  --bg-blue: #dcf1fa;
  --text-blue: #0288d1;

  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Spacing & Sizes */
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --transition: 0.2s ease-in-out;
}

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text-dark); font-weight: 600; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Utility Classes */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--primary-green); font-weight: 600; }
.mt-4 { margin-top: var(--space-lg); }
.full-width { width: 100%; }

/* ── Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-logo {
  width: 36px; height: 36px;
  background: var(--primary-green);
  color: white;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
}

.sidebar-header h2 {
  color: white;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.user-profile {
  padding: 0 var(--space-xl);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.user-profile .avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
}

.user-info { flex: 1; }
.user-name { font-weight: 500; font-size: 0.9rem; }
.user-email { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

.sidebar-menu {
  flex: 1;
  padding: 0 var(--space-md);
}

.menu-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
  transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
  background: var(--bg-sidebar-hover);
  color: white;
}

.menu-item.active {
  background: var(--primary-green);
}

.menu-icon { margin-right: var(--space-sm); font-size: 1.1rem; }
.menu-item.disabled { opacity: 0.5; cursor: not-allowed; }

.badge-culture { display:inline-block; width:8px; height:8px; border-radius:50%; background:#f59e0b; }
.badge-change { display:inline-block; width:8px; height:8px; border-radius:50%; background:#3b82f6; }

.sidebar-promo {
  margin: var(--space-xl);
  padding: var(--space-lg);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  text-align: center;
}

.sidebar-promo h4 { color: white; font-size: 0.9rem; margin: var(--space-sm) 0; }
.sidebar-promo p { font-size: 0.75rem; color: rgba(255,255,255,0.6); }

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: var(--space-md); flex: 1; }

.menu-toggle {
  display: none;
  background: none; border: none; font-size: 1.5rem; color: var(--text-muted);
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: 0.5rem var(--space-md);
  width: max-width: 400px;
  flex: 0 1 300px;
}

.search-bar input {
  background: transparent; border: none; outline: none;
  margin-left: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  width: 100%;
}

.topbar-right { display: flex; align-items: center; gap: var(--space-md); }

.icon-btn {
  background: transparent; border: none; font-size: 1.25rem; color: var(--text-muted);
  position: relative;
}

.notify-dot {
  position: absolute; top: 0; right: 0; width: 8px; height: 8px;
  background: #ef4444; border-radius: 50%;
}

.primary-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  border: none;
  transition: var(--transition);
}

.green-btn { background: var(--primary-green); color: white; }
.green-btn:hover { background: var(--primary-green-hover); }
.dark-btn { background: var(--bg-sidebar); color: white; }
.dark-btn:hover { background: #23334d; }

/* ── Screens Container ── */
.screens-container {
  padding: var(--space-2xl);
  flex: 1;
}

.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Shared Page Header ── */
.page-header { margin-bottom: var(--space-2xl); }
.page-title { font-size: 2rem; margin-bottom: var(--space-xs); letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-muted); font-size: 1rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb .crumb { cursor: pointer; }
.breadcrumb .crumb:hover { color: var(--primary-green); text-decoration: underline; }
.breadcrumb .crumb-sep { margin: 0 var(--space-sm); }
.breadcrumb .crumb.active { color: var(--text-dark); font-weight: 500; pointer-events: none; text-decoration: none; }

/* ── Dashboard Stats Row (Reference Image specific) ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-header { display: flex; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-lg); }

.stat-icon-wrapper {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.stat-number { font-size: 1.75rem; font-weight: 700; font-family: var(--font-heading); line-height: 1.1; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.stat-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* Coloring specific cards */
.stat-mint { background: var(--bg-mint); border-color: rgba(66,184,157,0.2); }
.stat-mint .stat-icon-wrapper { background: rgba(255,255,255,0.6); }
.stat-mint .stat-number { color: var(--text-mint); }
.stat-mint .stat-footer { color: var(--text-mint); border-color: rgba(66,184,157,0.1); }

.stat-lavender { background: var(--bg-lavender); border-color: rgba(124,77,255,0.2); }
.stat-lavender .stat-icon-wrapper { background: rgba(255,255,255,0.6); }
.stat-lavender .stat-number { color: var(--text-lavender); }
.stat-lavender .stat-footer { color: var(--text-lavender); border-color: rgba(124,77,255,0.1); }

.stat-peach { background: var(--bg-peach); border-color: rgba(230,126,34,0.2); }
.stat-peach .stat-icon-wrapper { background: rgba(255,255,255,0.6); }
.stat-peach .stat-number { color: var(--text-peach); }
.stat-peach .stat-footer { color: var(--text-peach); border-color: rgba(230,126,34,0.1); }

.stat-blue { background: var(--bg-blue); border-color: rgba(2,136,209,0.2); }
.stat-blue .stat-icon-wrapper { background: rgba(255,255,255,0.6); }
.stat-blue .stat-number { color: var(--text-blue); }
.stat-blue .stat-footer { color: var(--text-blue); border-color: rgba(2,136,209,0.1); }

/* ── Section Titles ── */
.section-title-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--space-lg);
}
.view-all { color: var(--primary-green); font-size: 0.9rem; font-weight: 500; }
.view-all:hover { text-decoration: underline; }

/* ── Dashboard Banner ── */
.dashboard-banner {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.banner-content h2 { margin-bottom: var(--space-sm); font-size: 1.75rem; }
.banner-content p { color: var(--text-muted); max-width: 500px; }
.banner-image { font-size: 8rem; line-height: 1; opacity: 0.9; }

/* ── Grid Layouts (Subjects & Topics) ── */
.subject-grid, .topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-green);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: inline-block;
}

.card-title { font-size: 1.25rem; margin-bottom: var(--space-xs); line-height: 1.3; }
.card-subtitle { font-size: 0.85rem; color: var(--primary-green); font-weight: 500; margin-bottom: var(--space-md); }
.card-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: var(--space-lg); }

.card-meta {
  display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-lg);
  padding-top: var(--space-md); border-top: 1px solid var(--border-light);
}
.meta-chip {
  background: var(--bg-app); color: var(--text-dark);
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 500;
  border: 1px solid var(--border-light);
}

.card-footer { display: flex; justify-content: space-between; align-items: center; }
.progress-pill {
  height: 6px; width: 100px; background: var(--bg-app); border-radius: 3px; overflow: hidden;
}
.progress-pill-fill { height: 100%; background: var(--primary-green); }

/* ── Tags and Lenses ── */
.lens-tags { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-md); }
.lens-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 500;
}

/* ── Lesson Stepper (Top Area) ── */
.lesson-canvas {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.progress-bar-container { height: 4px; background: var(--border-light); width: 100%; }
.progress-bar-fill { height: 100%; background: var(--primary-green); transition: width 0.3s ease; }

.lesson-header-area {
  padding: var(--space-2xl) var(--space-2xl) var(--space-md);
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.lesson-tags { display: flex; justify-content: center; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); flex-wrap: wrap; }
.difficulty-chip {
  padding: 4px 12px; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600; color: white;
}

.lesson-title { font-size: 2.5rem; letter-spacing: -0.5px; margin-bottom: var(--space-xs); }
.lesson-title-en { color: var(--text-muted); font-size: 1.1rem; }

.lesson-stepper {
  display: flex; justify-content: center; align-items: center;
  padding: var(--space-lg) var(--space-2xl);
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.step-item {
  display: flex; align-items: center; gap: var(--space-sm);
  color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
  opacity: 0.5; transition: var(--transition);
}

.step-item.active { opacity: 1; color: var(--primary-green); }
.step-item.completed { opacity: 1; color: var(--text-dark); }

.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: white; border: 2px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
}

.step-item.active .step-circle { border-color: var(--primary-green); background: var(--primary-green); color: white; }
.step-item.completed .step-circle { border-color: var(--primary-green); background: var(--primary-green); color: white; }

.step-connector {
  width: 40px; height: 2px; background: var(--border-light); margin: 0 var(--space-md);
}
.step-connector.completed { background: var(--primary-green); }

/* ── Content Area & UI Elements ── */
.step-content-area { padding: var(--space-2xl); min-height: 400px; }
.step-content { display: none; animation: fadeIn 0.3s ease; max-width: 800px; margin: 0 auto; }
.step-content.active { display: block; }

.media-section-title { font-size: 1.25rem; margin-bottom: var(--space-md); border-bottom: 2px solid var(--bg-app); padding-bottom: var(--space-xs); }
.step-desc { font-size: 1rem; color: var(--text-muted); margin-bottom: var(--space-xl); }
.lesson-intro-text { font-size: 1.1rem; line-height: 1.8; margin-bottom: var(--space-2xl); }
.tamil-text { font-size: 1.25rem; display: block; margin-bottom: var(--space-sm); color: var(--text-dark); }

/* Grids inside lessons */
.video-grid, .image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-2xl); }

.video-card, .image-card {
  background: var(--bg-app); border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-light);
}
.video-placeholder, .image-placeholder {
  height: 200px; background: #e2e8f0; display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
}
.play-icon { width: 50px; height: 50px; background: rgba(0,0,0,0.6); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; padding-left: 4px; }
.media-caption { padding: var(--space-sm) var(--space-md); text-align: center; font-size: 0.9rem; font-weight: 500; }

/* AI Content */
.ai-content-section {
  background: #fdf8f6; border: 1px solid #fed7aa; border-radius: var(--radius-md);
  padding: var(--space-xl); position: relative;
}
.ai-content-section h3 { font-size: 1.1rem; color: #ea580c; margin-bottom: var(--space-md); }

/* Prior Knowledge */
.pk-flashcard {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: var(--space-lg); margin-bottom: var(--space-md); box-shadow: var(--shadow-sm);
}

/* Tasks */
.exploratory-section { background: var(--bg-app); padding: var(--space-xl); border-radius: var(--radius-md); }
.task-instructions { padding-left: var(--space-xl); line-height: 1.8; }
.task-instructions li { margin-bottom: var(--space-sm); }

/* Lens Cards */
.lens-analysis-cards { display: grid; gap: var(--space-lg); }
.lens-card { background: white; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: var(--space-lg); box-shadow: var(--shadow-sm); }
.lens-card textarea {
  width: 100%; min-height: 100px; background: var(--bg-app); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: var(--space-md); margin-top: var(--space-sm);
  font-family: inherit; resize: vertical; outline: none; transition: var(--transition);
}
.lens-card textarea:focus { border-color: var(--primary-green); background: white; }

/* Deliverable Selector */
.deliverable-selector { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-2xl); }
.deliverable-option {
  background: white; border: 2px solid var(--border-light); border-radius: var(--radius-md);
  padding: var(--space-lg); text-align: center; cursor: pointer; transition: var(--transition);
}
.deliverable-option:hover { border-color: var(--primary-green); background: var(--bg-app); }
.deliverable-option.selected { border-color: var(--primary-green); background: #f0fdf4; box-shadow: 0 0 0 2px rgba(66,184,157,0.2); }
.del-icon { font-size: 2rem; display: block; margin-bottom: var(--space-sm); }
.del-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.del-desc { font-size: 0.8rem; color: var(--text-muted); }

/* Submission Area */
.submission-section { background: var(--bg-app); padding: var(--space-xl); border-radius: var(--radius-md); }
.essay-input {
  width: 100%; min-height: 200px; border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: var(--space-lg); font-family: inherit; resize: vertical; outline: none; font-size: 1rem;
}
.essay-input:focus { border-color: var(--primary-green); box-shadow: 0 0 0 3px rgba(66,184,157,0.1); }
.word-count { text-align: right; font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

.file-upload-area {
  background: white; border: 2px dashed var(--border-light); border-radius: var(--radius-md);
  padding: var(--space-2xl); text-align: center; margin-bottom: var(--space-lg);
}
.upload-icon { font-size: 3rem; margin-bottom: var(--space-md); color: var(--text-muted); }
.outline-btn { background: transparent; border: 1px solid var(--primary-green); color: var(--primary-green); padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 500; margin-top: var(--space-md); }
.outline-btn:hover { background: #f0fdf4; }
.upload-filename { margin-top: var(--space-sm); font-weight: 500; font-size: 0.9rem; color: var(--primary-green); }

.success-alert { background: #dcfce7; border: 1px solid #86efac; color: #166534; padding: var(--space-md); border-radius: var(--radius-md); text-align: center; margin-top: var(--space-md); font-weight: 500; }

/* Step Navigation */
.step-nav {
  display: flex; justify-content: space-between; padding: var(--space-xl) var(--space-2xl);
  border-top: 1px solid var(--border-light); background: var(--bg-app);
}
.nav-btn { padding: 12px 24px; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem; transition: var(--transition); border: none; }
.prev-btn { background: white; border: 1px solid var(--border-light); color: var(--text-dark); }
.prev-btn:hover { background: #f8fafc; }
.next-btn { background: var(--primary-green); color: white; }
.next-btn:hover { background: var(--primary-green-hover); }

/* ── Completion Screen ── */
.completion-canvas { max-width: 900px; margin: 0 auto; }
.completion-hero { text-align: center; margin-bottom: var(--space-2xl); }
.completion-icon-large { font-size: 5rem; margin-bottom: var(--space-md); animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

.completion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); margin-bottom: var(--space-2xl); }
.completion-panel { background: white; border-radius: var(--radius-lg); padding: var(--space-2xl); text-align: center; box-shadow: var(--shadow-md); border: 1px solid var(--border-light); }
.completion-panel.dark-panel { background: var(--bg-sidebar); color: white; text-align: left; }

.score-circle-wrapper { position: relative; width: 160px; height: 160px; margin: 0 auto var(--space-xl); }
.score-circle-wrapper svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-circle-wrapper circle { fill: none; stroke-width: 10; }
.score-circle-wrapper .track { stroke: var(--bg-app); }
.score-circle-wrapper .fill { stroke: var(--primary-green); stroke-dasharray: 408; stroke-dashoffset: 408; transition: stroke-dashoffset 1.5s ease; stroke-linecap: round; }
.score-text { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 700; font-family: var(--font-heading); }

.mini-stats { display: flex; justify-content: center; gap: var(--space-xl); border-top: 1px solid var(--border-light); padding-top: var(--space-md); }
.mini-stat { display: flex; flex-direction: column; }
.mini-stat span { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.mini-stat strong { font-size: 1.25rem; }

.tracker-list { margin-bottom: var(--space-xl); }
.tracker-item { display: flex; justify-content: space-between; padding: var(--space-sm) 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.tracker-item:last-child { border-bottom: none; }
.tracker-item span { color: rgba(255,255,255,0.7); }
.tracker-item strong { font-weight: 600; }
.tracker-progress { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.tracker-progress-fill { height: 100%; background: var(--primary-green); }

.teacher-waiting-alert { display: flex; gap: var(--space-md); align-items: flex-start; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-md); padding: var(--space-lg); margin-bottom: var(--space-xl); }
.alert-icon { font-size: 2rem; }
.alert-content h4 { color: #1e3a8a; margin-bottom: 4px; }
.alert-content p { color: #3b82f6; font-size: 0.9rem; margin: 0; }

.badges-earned-section { text-align: center; margin-bottom: var(--space-xl); }
.completion-actions { text-align: center; }

/* ── Chatbot (Restyled for Light Theme) ── */
.chatbot-trigger {
  position: fixed; bottom: 30px; right: 30px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--bg-sidebar); border: none; font-size: 2rem; color: white;
  box-shadow: var(--shadow-lg); z-index: 1000; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chatbot-trigger:hover { transform: scale(1.1); }
.chatbot-trigger.has-notification::after {
  content: ''; position: absolute; top: 0; right: 0; width: 14px; height: 14px;
  background: #ef4444; border-radius: 50%; border: 2px solid white;
}

.chatbot-panel {
  position: fixed; bottom: 100px; right: 30px;
  width: 350px; height: 500px;
  background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  display: flex; flex-direction: column; z-index: 1000;
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all 0.3s ease;
}
.chatbot-panel.active { transform: translateY(0); opacity: 1; pointer-events: all; }

.chatbot-header {
  padding: var(--space-md); background: var(--bg-sidebar); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; justify-content: space-between; align-items: center; color: white;
}
.chatbot-header-info { display: flex; align-items: center; gap: var(--space-sm); }
.chatbot-avatar { font-size: 1.5rem; background: rgba(255,255,255,0.2); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chatbot-header-text h4 { color: white; font-size: 1rem; margin-bottom: 2px; }
.chatbot-header-text span { font-size: 0.75rem; color: rgba(255,255,255,0.7); }
.chatbot-close { background: none; border: none; color: white; font-size: 1.2rem; opacity: 0.7; }
.chatbot-close:hover { opacity: 1; }

.chatbot-messages { flex: 1; padding: var(--space-md); overflow-y: auto; background: #fdfdfd; }
.chatbot-msg { margin-bottom: var(--space-md); max-width: 85%; font-size: 0.9rem; line-height: 1.5; }
.chatbot-msg.ai { float: left; clear: both; }
.chatbot-msg.user { float: right; clear: both; }

.msg-bubble { padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.chatbot-msg.ai .msg-bubble { background: #f1f5f9; color: var(--text-dark); border-bottom-left-radius: 2px; }
.chatbot-msg.user .msg-bubble { background: var(--primary-green); color: white; border-bottom-right-radius: 2px; }

.chatbot-input-area { padding: var(--space-md); border-top: 1px solid var(--border-light); display: flex; gap: var(--space-sm); background: white; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.chatbot-input { flex: 1; border: 1px solid var(--border-light); border-radius: var(--radius-full); padding: 8px 16px; font-family: inherit; font-size: 0.9rem; outline: none; background: var(--bg-app); }
.chatbot-input:focus { border-color: var(--primary-green); }
.chatbot-send { width: 40px; height: 40px; background: var(--primary-green); color: white; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .stats-row, .subject-grid, .topic-grid { grid-template-columns: 1fr; }
  .completion-grid { grid-template-columns: 1fr; }
  .lesson-header-area { padding: var(--space-xl) var(--space-md) var(--space-md); }
  .step-content-area { padding: var(--space-xl) var(--space-md); }
  .step-item span { display: none; } /* Hide stepper text on mobile */
  .step-connector { margin: 0 var(--space-sm); width: 20px; }
}
