/* ============================================
   EDUVERSE — DESIGN SYSTEM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* === CSS VARIABLES === */
:root {
  /* Colors */
  --primary: #FF8F00;
  --primary-light: #FFA040;
  --primary-dark: #E65100;
  --accent: #2E7D32;
  --accent-secondary: #43A047;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  /* Backgrounds */
  --bg-base: #07071A;
  --bg-surface: #0D0D2B;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 143, 0, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #F0F0FF;
  --text-secondary: #A0A0C0;
  --text-muted: #6060A0;
  --text-accent: #2E7D32;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(255, 143, 0, 0.4);
  --border-glow: rgba(46, 125, 50, 0.3);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #FF8F00, #2E7D32);
  --grad-card: linear-gradient(135deg, rgba(255, 143, 0,0.15), rgba(46, 125, 50,0.08));
  --grad-hero: radial-gradient(ellipse at 30% 50%, rgba(255, 143, 0,0.3) 0%, transparent 60%),
               radial-gradient(ellipse at 80% 20%, rgba(46, 125, 50,0.2) 0%, transparent 50%),
               linear-gradient(180deg, #07071A 0%, #0D0D2B 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(255, 143, 0,0.3);
  --shadow-accent: 0 0 30px rgba(46, 125, 50,0.2);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;
  --z-toast: 2000;
}

[data-theme="light"] {
  /* Backgrounds */
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: rgba(0, 0, 0, 0.02);
  --bg-card-hover: rgba(0, 0, 0, 0.04);
  --bg-glass: rgba(255, 143, 0, 0.05);
  --bg-input: rgba(0, 0, 0, 0.04);

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);

  /* Gradients */
  --grad-hero: radial-gradient(ellipse at 30% 50%, rgba(255, 143, 0,0.1) 0%, transparent 60%),
               radial-gradient(ellipse at 80% 20%, rgba(46, 125, 50,0.08) 0%, transparent 50%),
               linear-gradient(180deg, #F8FAFC 0%, #E2E8F0 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.12);
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { color: var(--text-secondary); }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent); }

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-3xl) 0;
}

.grid { display: grid; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* === GLASS CARD === */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-spring);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 24px rgba(255, 143, 0,0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(255, 143, 0,0.6);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-accent {
  background: linear-gradient(135deg, #2E7D32, #FFA040);
  color: #07071A;
  font-weight: 700;
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-icon { padding: 0.75rem; border-radius: var(--radius-md); }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
}

.badge-primary { background: rgba(255, 143, 0,0.2); color: var(--primary-light); border: 1px solid rgba(255, 143, 0,0.3); }
.badge-accent { background: rgba(46, 125, 50,0.15); color: var(--accent); border: 1px solid rgba(46, 125, 50,0.3); }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* === INPUTS === */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
  width: 100%;
}

.input:focus {
  border-color: var(--primary);
  background: rgba(255, 143, 0,0.06);
  box-shadow: 0 0 0 3px rgba(255, 143, 0,0.15);
}

.input::placeholder { color: var(--text-muted); }

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input { padding-left: 2.75rem; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* === PROGRESS BAR === */
.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 30px;
  background: rgba(255,255,255,0.4);
  filter: blur(4px);
}

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: 1rem 0;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(7,7,26,0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
  transition: width var(--transition-base);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: var(--space-sm); }

/* === SIDEBAR === */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 70px;
}

.sidebar {
  width: 260px;
  min-height: calc(100vh - 70px);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: var(--space-xl) 0;
  position: fixed;
  top: 70px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  transition: transform var(--transition-base);
}

.sidebar-logo {
  padding: 0 var(--space-xl) var(--space-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.sidebar-menu {
  list-style: none;
  padding: 0 var(--space-md);
}

.sidebar-menu li { margin-bottom: 0.25rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.75rem var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(255, 143, 0,0.15);
  color: var(--primary-light);
  border-left: 3px solid var(--primary);
  margin-left: -1px;
}

.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-section-label {
  padding: var(--space-md) var(--space-xl) var(--space-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: var(--space-2xl);
  min-height: calc(100vh - 70px);
}

/* === STAT CARDS === */
.stat-card {
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.1;
}

.stat-card.purple::before { background: var(--primary); }
.stat-card.cyan::before { background: var(--accent); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === LESSON CARDS === */
.lesson-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.lesson-card-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}

.lesson-card-body { padding: var(--space-lg); }
.lesson-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

/* === MODALS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,7,26,0.8);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-spring);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body { padding: var(--space-xl); }
.modal-footer {
  padding: var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.3s var(--transition-spring);
}

.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(46, 125, 50,0.4); }

/* === TABS === */
.tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 12px rgba(255, 143, 0,0.4);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* === UTILS === */
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.hidden { display: none !important; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.w-full { width: 100%; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

@media (max-width: 768px) {
  .container { padding: 0 var(--space-lg); }
  .main-content { padding: var(--space-lg); }
  .nav-links { display: none; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}
