/* ==========================================================================
   LEARNFLOW STUDY OS - PREMIUM "COCKPIT" REDESIGN V3 (Final)
   Obsidian & Aurora Material System.
   ========================================================================== */

/* --- 1. CORE DESIGN TOKENS & ATMOSPHERE --- */
:root {
  /* The Void - Deep, physical obsidian */
  --bg-base: #030304;
  
  /* Surfaces - Frosted glass opacities instead of solid colors */
  --surface-0: rgba(10, 10, 12, 0.4);
  --surface-1: rgba(20, 20, 24, 0.35);
  --surface-2: rgba(30, 30, 36, 0.5);
  --surface-solid: #121216;
  --surface-elevated: rgba(24, 24, 30, 0.65);
  
  /* Borders - Metallic and sharp */
  --border-subtle: rgba(255, 255, 255, 0.03);
  --border-light: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.15);
  
  /* Typography - High contrast, slightly warm silver */
  --text-title: #FFFFFF;
  --text-primary: #F0F0F4;
  --text-secondary: #9A9CA3;
  --text-muted: #65676E;
  
  /* Illumination - Expensive hues (Premium Indigo & Aurora) */
  --accent-light: #A3A1FF;
  --accent-core: #635BFF; 
  --accent-deep: #4338CA;
  --accent-blue: #5B8CFF;
  
  /* Status */
  --success: #34D399;
  --danger: #F87171;
  
  /* Physics & Depth */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --shadow-elevation: 0 16px 40px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.4);
  --bezier-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --bezier-smooth: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* --- 2. THE ENVIRONMENT (Background & Canvas) --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* The Cinematic Aurora Background */
.cockpit-ambient-light {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 15% -10%, rgba(99, 91, 255, 0.18), transparent 40%),
    radial-gradient(circle at 85% 110%, rgba(255, 91, 153, 0.1), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(99, 91, 255, 0.04), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

/* High-End Film Grain Overlay */
.cockpit-ambient-light::after {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- 3. ARCHITECTURE & SHELL --- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--surface-0);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.main {
  margin-left: 260px;
  width: calc(100% - 260px);
  padding: 0 56px 100px;
  position: relative;
}

.topbar {
  height: 88px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(to bottom, var(--bg-base) 20%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.view {
  display: none;
  max-width: 1300px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(12px) scale(0.99);
}

.view.active {
  display: block;
  animation: viewEnter 600ms var(--bezier-snappy) forwards;
}

@keyframes viewEnter {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- 4. BRAND & NAVIGATION (The Rail) --- */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 8px 40px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--text-title), var(--text-secondary));
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--bg-base);
  box-shadow: 0 4px 16px rgba(255,255,255,0.1);
}

.brand strong { font-family: "Space Grotesk"; font-size: 16px; color: var(--text-title); letter-spacing: -0.02em; }
.brand small { display: block; color: var(--accent-blue); font-size: 9px; letter-spacing: 0.2em; font-weight: 700; margin-top: 2px; text-transform: uppercase; }

.sidebar nav { display: grid; gap: 6px; }

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  transition: all 250ms var(--bezier-snappy);
  position: relative;
  overflow: hidden;
}

.nav-item span { width: 20px; text-align: center; font-size: 16px; transition: transform 250ms; }

.nav-item:hover { color: var(--text-title); background: var(--surface-1); }
.nav-item:hover span { transform: scale(1.1); }

/* The "Illuminated Surface" active state */
.nav-item.active {
  color: var(--text-title);
  background: linear-gradient(90deg, rgba(99,91,255,0.1) 0%, transparent 100%);
  border: 1px solid var(--border-light);
  border-left: 2px solid var(--accent-core);
  box-shadow: inset 20px 0 40px -20px rgba(99,91,255,0.2);
}

.sidebar-bottom { margin-top: auto; display: grid; gap: 6px; }

.mini-tip {
  margin: 32px 0 0;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: var(--shadow-inset-top);
}
.mini-tip b { font-size: 10px; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }
.mini-tip p { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }

/* --- 5. TYPOGRAPHY & HIERARCHY --- */
h1, h2, h3 { font-family: "Space Grotesk", sans-serif; color: var(--text-title); letter-spacing: -0.03em; }

.page-title { margin: 24px 0 48px; }
.page-title h1, .player-top h1 { font-weight: 700; font-size: 42px; margin: 8px 0; }
.page-title p:not(.eyebrow) { color: var(--text-secondary); font-size: 16px; max-width: 600px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-blue);
  font-weight: 700;
  margin: 0 0 8px;
}

.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 0 0 24px; }
.section-head h2, .panel h2, .queue h2 { font-size: 20px; font-weight: 600; }

/* --- 6. BUTTON SYSTEM (Tactile & Luminous) --- */
.primary-btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  background: var(--text-title);
  color: var(--bg-base);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(255,255,255,0.15);
  transition: all 250ms var(--bezier-snappy);
  position: relative;
  overflow: hidden;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,255,255,0.25);
}

/* Helper to perfectly align SVG icons in buttons */
.flex-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.ghost-btn {
  border: 1px solid var(--border-light);
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 250ms var(--bezier-snappy);
  box-shadow: var(--shadow-inset-top);
}
.ghost-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.icon-btn, .text-btn, .back-btn {
  border: 0; background: transparent; color: var(--text-secondary); font-size: 14px; transition: color 200ms;
}
.icon-btn {
  width: 40px; height: 40px; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  background: var(--surface-1); display: grid; place-items: center; box-shadow: var(--shadow-inset-top);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-title); }
.text-btn:hover, .back-btn:hover { color: var(--text-title); }

.danger-btn { border: 1px solid rgba(232, 93, 117, 0.2); color: var(--danger); background: transparent; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; }
.complete-btn { border: 1px solid var(--border-light); color: var(--text-title); background: var(--surface-1); padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; transition: all 200ms; }
.complete-btn.done { background: var(--success); color: var(--bg-base); border-color: var(--success); box-shadow: 0 0 20px rgba(46, 202, 146, 0.3); }

/* --- 7. DASHBOARD HERO (The Centerpiece) --- */
.hero {
  min-height: 320px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  /* Frosted Glass */
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-inset-top), var(--shadow-elevation);
  margin-bottom: 48px;
}

.hero h1 { font-size: 52px; letter-spacing: -0.04em; margin-bottom: 16px; line-height: 1.1; }
.hero h1 span {
  background: linear-gradient(90deg, #FFFFFF, var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text; /* Standard property to fix linter warning */
  color: transparent;
}
.hero-copy { max-width: 500px; color: var(--text-secondary); font-size: 16px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; }

/* Glowing Orbital Element */
.hero-orbit {
  width: 180px; height: 180px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 0 60px rgba(99,91,255,0.1);
}
.hero-orbit:before, .hero-orbit:after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
}
.hero-orbit:before { inset: 15px; border-color: rgba(99,91,255,0.2); }
.hero-orbit:after { inset: 35px; border-top-color: var(--accent-core); transform: rotate(45deg); }
.orbit-core {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--border-bright);
  display: grid; place-items: center;
  font-family: "Space Grotesk"; font-weight: 700; color: var(--text-title);
  box-shadow: 0 0 30px var(--accent-core), inset 0 1px 0 rgba(255,255,255,0.2);
  z-index: 2;
}

/* --- 8. DASHBOARD BENTO CARDS --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0 0 56px;
}

.stat {
  padding: 24px;
  border: 1px solid var(--border-light);
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset-top), 0 4px 12px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
  transition: all 300ms var(--bezier-snappy);
}

.stat:hover { 
  transform: translateY(-2px); 
  border-color: var(--border-bright); 
  background: rgba(255, 255, 255, 0.04); 
}
.stat::after {
  content: ""; position: absolute; top: 0; right: 0; width: 100px; height: 100px;
  background: radial-gradient(circle top right, rgba(255,255,255,0.03), transparent); pointer-events: none;
}

.stat .value { font: 700 36px "Space Grotesk"; margin: 4px 0; color: var(--text-title); letter-spacing: -0.02em; }
.stat .label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- 9. PREMIUM PROJECT CARDS --- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.project-card {
  border: 1px solid var(--border-light);
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  transition: all 400ms var(--bezier-snappy);
  cursor: pointer;
  box-shadow: var(--shadow-inset-top), 0 8px 24px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

/* Subtle gradient hover mask */
.project-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), rgba(255,255,255,0.06), transparent 40%);
  opacity: 0; transition: opacity 400ms; pointer-events: none;
}

.project-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-bright);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-inset-top), var(--shadow-elevation);
}
.project-card:hover::before { opacity: 1; }

.project-card .color-bar { height: 4px; width: 32px; border-radius: 2px; margin-bottom: 24px; background: var(--accent-core); box-shadow: 0 0 12px var(--accent-core); }
.project-card h3 { font-size: 20px; font-weight: 600; margin: 0 0 6px; line-height: 1.3; }
.project-card .subject { font-size: 13px; color: var(--text-secondary); }
.project-card .bottom { margin-top: auto; }

.progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-top: 24px; font-weight: 500; }
.progress { height: 4px; background: rgba(255,255,255,0.05); border-radius: 99px; overflow: hidden; margin-top: 8px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.5); }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent-core)); border-radius: 99px; transition: width 600ms var(--bezier-smooth); box-shadow: 0 0 10px rgba(99,91,255,0.5); }
.card-date { font-size: 11px; color: var(--text-muted); margin-top: 12px; font-family: monospace; }

.empty {
  border: 1px dashed var(--border-light); border-radius: var(--radius-lg); padding: 64px;
  text-align: center; color: var(--text-secondary); grid-column: 1 / -1; background: var(--surface-0);
}

/* --- 10. TOOLBAR & INPUTS (Glassy & Tactile) --- */
.toolbar { display: flex; gap: 16px; margin-bottom: 32px; }
.search, .toolbar select, .form input, .form textarea, .form select, .ai-source {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-light);
  color: var(--text-title);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 250ms;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.search { flex: 1; }
.search:focus, .toolbar select:focus, .form input:focus, .form textarea:focus, .ai-source:focus {
  border-color: var(--accent-core);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 0 0 3px rgba(99,91,255,0.15);
  outline: none; background: rgba(0,0,0,0.4);
}

/* --- 11. PLANNER & TASKS (Productivity System) --- */
.planner-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel {
  border: 1px solid var(--border-light);
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-inset-top), 0 8px 24px rgba(0,0,0,0.4);
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; }

.pill { border: 1px solid var(--border-bright); background: var(--surface-2); border-radius: 99px; padding: 4px 12px; color: var(--text-secondary); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* The Glowing Timer Instrument */
.timer-ring {
  width: 240px; height: 240px; border-radius: 50%;
  margin: 48px auto 40px; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--border-bright) 100%, transparent 0);
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.5), 0 0 40px rgba(0,0,0,0.2);
}
.timer-ring:after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%;
  background: var(--surface-solid); box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
}
.timer-ring > div { position: relative; z-index: 1; text-align: center; }
.timer-ring strong { font: 700 56px "Space Grotesk"; color: var(--text-title); letter-spacing: -0.05em; text-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.timer-ring small { font-size: 11px; letter-spacing: 0.25em; color: var(--accent-blue); text-transform: uppercase; font-weight: 700; margin-top: 4px; display: block; }

/* Elegant Task Interactions */
.task { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-subtle); align-items: center; transition: background 250ms; border-radius: var(--radius-sm); }
.task:hover { background: rgba(255,255,255,0.02); padding-left: 8px; padding-right: 8px; margin: 0 -8px; border-bottom-color: transparent; }

.task input[type="checkbox"] {
  appearance: none; width: 20px; height: 20px;
  border: 1px solid var(--border-bright); border-radius: 6px;
  background: rgba(0,0,0,0.2); cursor: pointer; position: relative;
  transition: all 250ms var(--bezier-snappy);
}
.task input[type="checkbox"]:checked { background: var(--success); border-color: var(--success); box-shadow: 0 0 12px rgba(52, 211, 153, 0.4); }
.task input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 3px;
  width: 5px; height: 10px; border: solid var(--bg-base); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task span { font-size: 15px; color: var(--text-primary); transition: color 250ms; }
.task.done span { text-decoration: line-through; color: var(--text-muted); }

/* --- 12. CINEMATIC PLAYER EXPERIENCE --- */
.player-top { display: flex; align-items: center; gap: 24px; margin: 16px 0 40px; }
.player-top h1 { font-size: 32px; margin: 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; }
.video-column { display: flex; flex-direction: column; gap: 16px; }

/* The Core Video Frame */
.video-frame {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,0,0,1);
}
/* Ambient backlight for video */
.video-frame::before {
  content: ""; position: absolute; inset: -20px; z-index: -1;
  background: var(--accent-core); filter: blur(40px); opacity: 0.15;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; position: relative; z-index: 2; }
.video-placeholder { height: 100%; display: grid; place-items: center; color: var(--text-muted); font-size: 15px; }

.video-meta { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 4px; }
.video-meta h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; }

.progress-line { height: 3px; background: rgba(255,255,255,0.05); border-radius: 99px; margin-top: 8px; }
.progress-line span { display: block; height: 100%; background: var(--text-title); width: 0; transition: width 600ms var(--bezier-smooth); box-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* Focused Study Tabs */
.study-tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--border-light); margin-top: 24px; }
.tab {
  background: none; border: 0; color: var(--text-secondary);
  padding: 16px 0; font-size: 15px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: all 250ms;
  transform: translateY(1px);
}
.tab:hover { color: var(--text-title); }
.tab.active { color: var(--text-title); border-color: var(--text-title); }

.tab-panel { display: none; padding-top: 24px; animation: viewEnter 400ms var(--bezier-snappy); }
.tab-panel.active { display: block; }
.tab-panel textarea {
  width: 100%; min-height: 280px; resize: vertical;
  background: rgba(0,0,0,0.2); border: 1px solid transparent; border-radius: var(--radius-md);
  color: var(--text-primary); padding: 24px; font-size: 15px; line-height: 1.7;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3); transition: border-color 250ms;
}
.tab-panel textarea:focus { border-color: var(--border-light); background: rgba(0,0,0,0.4); }

/* Premium Queue (Right Sidebar) */
.queue {
  border: 1px solid var(--border-light); background: var(--surface-1);
  border-radius: var(--radius-lg); padding: 24px;
  height: fit-content; max-height: calc(100vh - 140px); overflow-y: auto;
  box-shadow: var(--shadow-inset-top);
}
.queue-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

.video-item {
  padding: 16px; border-radius: var(--radius-md); border: 1px solid transparent;
  margin-bottom: 8px; cursor: pointer; transition: all 250ms;
  background: rgba(0,0,0,0.2);
}
.video-item:hover { background: var(--surface-2); border-color: var(--border-light); transform: translateX(2px); }
.video-item.active {
  background: var(--surface-2); border-color: var(--border-bright);
  box-shadow: inset 4px 0 0 var(--accent-core);
}
.video-item .v-title { font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text-title); }
.video-item .v-meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 11px; margin-top: 10px; }
.video-item .mini-progress { height: 2px; background: rgba(255,255,255,0.05); margin-top: 12px; border-radius: 99px; }
.video-item .mini-progress span { display: block; height: 100%; background: var(--text-secondary); }
.video-item.done .v-title:before { content: "✓ "; color: var(--success); }

/* --- 13. MODALS (Glass & Depth) --- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 3, 4, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 300ms;
}

.modal-card {
  position: relative; z-index: 1; width: min(520px, calc(100% - 32px));
  max-height: 90vh; overflow-y: auto;
  background: var(--surface-elevated); border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl); padding: 40px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 24px 64px rgba(0,0,0,0.8);
  animation: viewEnter 400ms var(--bezier-snappy);
}

.modal-close {
  position: absolute; right: 24px; top: 24px; border: 0; background: rgba(255,255,255,0.05);
  color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px; transition: all 200ms;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-title); transform: scale(1.05); }
.modal-header h2 { font-size: 28px; margin: 0 0 8px; }

/* --- 14. FORMS & INPUT LAYOUT FIX --- */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
  width: 100%;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  width: 100%;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.form input, .form textarea, .form select {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-title);
  padding: 12px 14px;
  transition: all 250ms;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}

/* --- 15. RESPONSIVE DESIGN --- */
@media (max-width: 1100px) {
  .sidebar { width: 80px; padding: 32px 12px; }
  .brand div, .nav-item span + *, .mini-tip { display: none; }
  .brand { padding: 0 0 40px; justify-content: center; }
  .nav-item { justify-content: center; padding: 14px 0; }
  .nav-item span { margin: 0; font-size: 22px; }
  .nav-item.active { box-shadow: none; border-left: 2px solid var(--accent-core); background: var(--surface-1); }
  .main { margin-left: 80px; width: calc(100% - 80px); padding: 0 40px 100px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace, .planner-layout, .ai-grid, .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .main { padding: 0 20px 80px; }
  .topbar { height: 72px; }
  .hero { padding: 40px 24px; }
  .hero-orbit { display: none; }
  .hero h1 { font-size: 36px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 40px; }
  .project-grid { grid-template-columns: 1fr; }
  .page-title { flex-direction: column; align-items: flex-start; gap: 16px; }
  .player-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .player-top h1 { font-size: 26px; }
}

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

/* --- 16. LIGHT THEME OVERRIDES --- */
body.light {
  --bg-base: #F7F8FA;
  --surface-0: rgba(255,255,255,0.6);
  --surface-1: rgba(255,255,255,0.85);
  --surface-2: #F0F2F5;
  --surface-solid: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --border-subtle: rgba(0,0,0,0.04);
  --border-light: rgba(0,0,0,0.08);
  --border-bright: rgba(0,0,0,0.15);
  --text-title: #050505;
  --text-primary: #1A1D24;
  --text-secondary: #5A6070;
  --text-muted: #8A92A3;
  --shadow-inset-top: inset 0 1px 0 rgba(255,255,255,1);
  --shadow-elevation: 0 12px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}
.light .video-frame { background: #000; box-shadow: 0 24px 64px rgba(0,0,0,0.3); }
.light .primary-btn { background: #050505; color: #FFFFFF; }