/* ==========================================================================
   AI MASTERY LMS - SKAARVI-INSPIRED CENTERED VIDEO THEATER & DESIGN SYSTEM
   Center-Stage Cinema Layout, High-Contrast Typography, Frictionless Navigation
   ========================================================================== */

:root {
  /* Premium Dark Slate Palette (Skaarvi / Luxury EdTech Aesthetic) */
  --bg-app: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #131d34;
  --bg-card-hover: #1a2744;
  --bg-elevated: #1e2c4d;
  --bg-input: #0b1222;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-active: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-accent: #38bdf8;

  --brand-primary: #0284c7;
  --brand-primary-hover: #0369a1;
  --brand-glow: rgba(56, 189, 248, 0.2);

  --gold-accent: #f59e0b;
  --gold-surface: rgba(245, 158, 11, 0.12);
  --gold-border: rgba(245, 158, 11, 0.28);

  --success: #10b981;
  --success-surface: rgba(16, 185, 129, 0.12);
  --danger: #f43f5e;
  --danger-surface: rgba(244, 63, 94, 0.12);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.7);
  --shadow-player: 0 24px 60px rgba(0, 0, 0, 0.85);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Light Theme Mode */
[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-input: #f8fafc;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-active: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --text-accent: #0284c7;

  --brand-primary: #0284c7;
  --brand-primary-hover: #0369a1;
  --brand-glow: rgba(2, 132, 199, 0.15);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
  --shadow-player: 0 16px 40px rgba(0, 0, 0, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Top Navigation Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-center-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-curriculum-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s var(--ease-smooth);
}

.nav-curriculum-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-accent);
}

.pill-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pill-gold {
  background: var(--gold-surface);
  color: var(--gold-accent);
  border: 1px solid var(--gold-border);
}

.pill-green {
  background: var(--success-surface);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.pill-blue {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.28);
}

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

.streak-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-accent);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-accent);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-accent);
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Global Progress Header Strip */
.progress-strip {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.82rem;
}

.progress-stats-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.progress-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.progress-stat strong {
  color: var(--text-main);
  font-weight: 700;
}

.course-progress-bar-wrap {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-smooth);
  width: 0%;
}

.progress-percent-label {
  font-weight: 700;
  color: var(--text-accent);
  min-width: 42px;
  font-size: 0.82rem;
}

/* ==========================================================================
   CENTER STAGE VIDEO THEATER & WORKSPACE (CENTERED LAYOUT)
   ========================================================================== */

.main-center-stage {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  transition: max-width 0.3s var(--ease-smooth);
}

.main-center-stage.theater-mode {
  max-width: 100%;
  padding: 1.25rem;
}

/* Video Player Card */
.player-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-player);
  transition: all 0.3s var(--ease-smooth);
}

.player-top-toolbar {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.player-status-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--success);
  font-weight: 600;
}

.player-status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}

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

.player-quick-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-quick-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.player-quick-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-accent);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000000;
}

.video-wrapper iframe, .video-wrapper #youtubePlayerContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-fallback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  z-index: 10;
}

.video-fallback-overlay.show {
  display: flex;
}

.video-fallback-thumb {
  max-width: 340px;
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
}

/* Custom Player Action Strip */
.player-controls-strip {
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.player-controls-left, .player-controls-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.speed-selector {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}

.speed-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-btn.active, .speed-btn:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

/* Lesson Header & Info Box */
.lesson-header-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lesson-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lesson-tags {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.lesson-main-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
}

.lesson-telugu-title {
  font-size: 1.1rem;
  color: var(--gold-accent);
  font-weight: 500;
}

/* ==========================================================================
   SLIDE-OVER CURRICULUM DRAWER (SKAARVI STYLE)
   ========================================================================== */

.curriculum-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.7);
  z-index: 250;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.curriculum-drawer.open {
  transform: translateX(0);
}

.curriculum-drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-card);
}

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

.drawer-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-box-wrap {
  position: relative;
}

.search-box-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem 0.6rem 2.2rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box-wrap input:focus {
  border-color: var(--border-active);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.filter-chips {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease-smooth);
}

.filter-chip.active, .filter-chip:hover {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.syllabus-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Module Group Cards in Drawer */
.module-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.module-header {
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.module-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.module-badge {
  background: var(--bg-elevated);
  color: var(--text-accent);
  font-size: 0.75rem;
  font-weight: 700;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-header h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.module-header span.telugu-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.module-chevron {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: transform 0.25s var(--ease-smooth);
}

.module-group.collapsed .module-chevron {
  transform: rotate(-90deg);
}

.module-group.collapsed .module-lessons {
  display: none;
}

.module-lessons {
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Lesson Items */
.lesson-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.lesson-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.lesson-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--border-active);
}

.lesson-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.lesson-item.completed .lesson-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.lesson-meta {
  flex: 1;
  min-width: 0;
}

.lesson-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.lesson-item.active .lesson-title {
  color: var(--text-accent);
}

.lesson-subtext {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Drawer Backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 240;
  display: none;
}

.drawer-backdrop.active {
  display: block;
}

/* ==========================================================================
   TABBED LEARNING DECK (CENTERED)
   ========================================================================== */

.tabs-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--text-accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-accent);
  border-radius: var(--radius-full);
}

.tab-pane {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.2s ease;
}

.tab-pane.active {
  display: block;
}

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

.content-section {
  margin-bottom: 1.75rem;
}

.content-section:last-child {
  margin-bottom: 0;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.takeaway-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.takeaway-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.takeaway-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 800;
}

/* Prompt Card & Copy */
.prompts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.prompt-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-accent);
}

.prompt-content {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  line-height: 1.6;
  user-select: all;
}

/* Tools Directory Cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.tool-meta h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.tool-meta span {
  font-size: 0.75rem;
  color: var(--text-accent);
  font-weight: 600;
  text-transform: uppercase;
}

.tool-meta p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Homework Box */
.homework-box {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px dashed var(--text-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Interactive Quiz */
.quiz-box {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-question-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.quiz-option-label:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--text-main);
}

.quiz-option-label.correct {
  background: var(--success-surface);
  border-color: var(--success);
  color: var(--success);
  font-weight: 600;
}

.quiz-option-label.wrong {
  background: var(--danger-surface);
  border-color: var(--danger);
  color: var(--danger);
}

.quiz-explanation {
  font-size: 0.85rem;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  color: var(--text-accent);
  display: none;
}

/* Notes & Bookmarks */
.notes-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
}

.notes-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notes-textarea {
  width: 100%;
  min-height: 250px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}

.notes-textarea:focus {
  border-color: var(--border-active);
}

.bookmarks-panel {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.bookmark-item:hover {
  color: var(--text-accent);
}

/* Floating AI Tutor Drawer */
.ai-tutor-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
  z-index: 99;
  border: none;
  transition: transform 0.2s ease;
}

.ai-tutor-fab:hover {
  transform: scale(1.08);
}

.ai-tutor-drawer {
  position: fixed;
  bottom: 6rem;
  right: 1.75rem;
  width: 400px;
  max-width: calc(100vw - 3.5rem);
  height: 540px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s var(--ease-smooth);
}

.ai-tutor-drawer.open {
  display: flex;
}

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

.ai-tutor-header {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-tutor-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-bubble.ai {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--brand-primary);
  color: #ffffff;
}

.ai-quick-prompts {
  padding: 0.6rem 1.25rem;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--border-subtle);
}

.quick-prompt-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.quick-prompt-btn:hover {
  border-color: var(--border-active);
  color: var(--text-main);
}

.ai-chat-input-row {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.6rem;
}

.ai-chat-input-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
}

.ai-chat-input-row input:focus {
  border-color: var(--border-active);
}

/* Certificate Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.certificate-canvas-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #000000;
}

.certificate-canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
}

.certificate-form-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.certificate-form-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastPop 0.3s var(--ease-spring);
}

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

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 120;
  padding: 0.35rem 0.5rem;
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
}

.mobile-nav-item:active, .mobile-nav-item.active {
  color: var(--text-accent);
  transform: scale(0.96);
}

.mobile-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .notes-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
  }

  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }

  .app-header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-text p {
    display: none;
  }

  .header-center-nav {
    display: none;
  }

  .streak-pill {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .progress-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 1rem;
    gap: 0.5rem;
  }

  .progress-stats-group {
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .course-progress-bar-wrap {
    max-width: 100%;
    width: 100%;
  }

  .main-center-stage {
    padding: 1rem 0.85rem;
    gap: 1.25rem;
  }

  .player-card {
    border-radius: var(--radius-md);
  }

  .player-top-toolbar {
    padding: 0.6rem 0.85rem;
    gap: 0.4rem;
  }

  .player-quick-links {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .player-controls-strip {
    padding: 0.85rem;
    gap: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }

  .player-controls-left, .player-controls-right {
    width: 100%;
    justify-content: space-between;
  }

  .speed-selector {
    width: 100%;
    justify-content: space-around;
  }

  .speed-btn {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0.2rem;
  }

  .lesson-header-box {
    padding: 1.1rem;
    border-radius: var(--radius-md);
  }

  .lesson-main-title {
    font-size: 1.25rem;
  }

  .lesson-telugu-title {
    font-size: 0.98rem;
  }

  .tabs-nav {
    gap: 0.35rem;
    padding-bottom: 0.4rem;
  }

  .tab-btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
  }

  .tab-pane {
    padding: 1.15rem;
    border-radius: var(--radius-md);
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .quiz-option-label {
    min-height: 48px;
    padding: 0.75rem;
  }

  .ai-tutor-fab {
    bottom: 4.8rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .ai-tutor-drawer {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    border-radius: 20px 20px 0 0;
    z-index: 300;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-card {
    padding: 1.15rem;
    max-height: 95vh;
    border-radius: var(--radius-md);
  }

  .certificate-form-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   AUTHENTICATION & LOGIN SCREEN STYLES (EXECUTIVE AUTH GATE)
   ========================================================================== */

.auth-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top center, rgba(2, 132, 199, 0.12) 0%, var(--bg-app) 70%);
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow-y: auto;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.6);
  max-width: 460px;
  width: 100%;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: authFadeIn 0.3s var(--ease-spring);
  position: relative;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.auth-brand-center .brand-icon {
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  border-radius: var(--radius-md);
}

.auth-brand-center h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.auth-brand-center p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-demo-box {
  background: var(--bg-input);
  border: 1px dashed var(--gold-accent);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-demo-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-demo-info strong {
  color: var(--gold-accent);
}

.auth-demo-btn {
  background: var(--gold-surface);
  border: 1px solid var(--gold-border);
  color: var(--gold-accent);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.auth-demo-btn:hover {
  background: var(--gold-accent);
  color: #000000;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 2.5rem 0.75rem 2.4rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-input-wrap input:focus {
  border-color: var(--border-active);
}

.auth-field-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.auth-password-toggle {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-password-toggle:hover {
  color: var(--text-main);
}

.auth-error-alert {
  background: var(--danger-surface);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.user-badge-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.user-badge-avatar {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
}

@media (max-width: 480px) {
  .header-actions .btn-gold {
    display: none;
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .pill-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.45rem;
  }

  .auth-card {
    padding: 1.5rem;
  }
}
