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

/* ============================================
   DESIGN SYSTEM — EDGELEARN LMS
   Dark editorial aesthetic, amber accents
   ============================================ */
:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --bg3:       #1a1a24;
  --border:    #2a2a38;
  --accent:    #f5a623;
  --accent2:   #ff6b35;
  --text:      #f0f0f8;
  --text2:     #9090b0;
  --text3:     #5a5a78;
  --success:   #22c55e;
  --danger:    #ef4444;
  --info:      #3b82f6;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================ TYPOGRAPHY */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p  { color: var(--text2); }
a  { color: var(--accent); text-decoration: none; }

/* ============================================ LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ============================================ NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.nav-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.4rem; font-weight: 800;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--text2); padding: 8px 16px;
  border-radius: 8px; font-size: 0.9rem;
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--accent); }

/* ============================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 24px;
  border-radius: var(--radius); border: none;
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.95rem; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #000;
}
.btn-primary:hover { background: #e8961a; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,166,35,0.3); }
.btn-secondary {
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============================================ CARDS */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.card-flat { background: var(--bg3); border: none; }

/* ============================================ FORMS */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.85rem;
  font-weight: 600; color: var(--text2);
  margin-bottom: 8px; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: 0.95rem;
  transition: all var(--transition); outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.1);
}
.form-control::placeholder { color: var(--text3); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ============================================ BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 600;
}
.badge-accent { background: rgba(245,166,35,0.15); color: var(--accent); }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-muted { background: var(--bg3); color: var(--text2); }

/* ============================================ PROGRESS BAR */
.progress-bar {
  width: 100%; height: 6px;
  background: var(--bg3); border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px; transition: width 0.6s ease;
}

/* ============================================ SIDEBAR LAYOUT */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 65px);
}
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky; top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text3); letter-spacing: 0.1em;
  text-transform: uppercase; padding: 8px 12px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--text2); font-size: 0.9rem;
  transition: all var(--transition); cursor: pointer;
}
.sidebar-link:hover { background: var(--bg3); color: var(--text); }
.sidebar-link.active {
  background: rgba(245,166,35,0.12);
  color: var(--accent);
}
.sidebar-link .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.main-content { padding: 32px; overflow-y: auto; }

/* ============================================ STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-label { font-size: 0.8rem; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--text); }
.stat-sub { font-size: 0.82rem; color: var(--text3); margin-top: 4px; }
.stat-card.accent { border-color: var(--accent); background: rgba(245,166,35,0.05); }
.stat-card.accent .stat-value { color: var(--accent); }

/* ============================================ TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--bg3); padding: 12px 16px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.06em; text-align: left;
}
td { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 0.9rem; }
tr:hover td { background: var(--bg3); }

/* ============================================ MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  width: 100%; max-width: 560px; max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 24px;
}
.modal-close {
  background: var(--bg3); border: none; color: var(--text2);
  width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ============================================ VIDEO PLAYER */
.video-container {
  position: relative; padding-top: 56.25%;
  border-radius: var(--radius-lg); overflow: hidden;
  background: #000;
}
.video-container iframe,
.video-container video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

/* ============================================ QUIZ */
.quiz-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg3);
  cursor: pointer; transition: all var(--transition);
  margin-bottom: 10px;
}
.quiz-option:hover { border-color: var(--accent); background: rgba(245,166,35,0.05); }
.quiz-option.selected { border-color: var(--accent); background: rgba(245,166,35,0.1); }
.quiz-option.correct { border-color: var(--success); background: rgba(34,197,94,0.1); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(239,68,68,0.1); }
.quiz-letter {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--border); display: flex;
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}

/* ============================================ TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; font-weight: 500;
  z-index: 9999; transform: translateY(20px);
  opacity: 0; transition: all var(--transition);
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info { border-color: var(--info); }
.toast-info .toast-icon { color: var(--info); }

/* ============================================ AUTH PAGE */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(245,166,35,0.08) 0%, transparent 70%);
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px; width: 100%; max-width: 440px;
  position: relative; z-index: 1;
}
.auth-logo {
  font-family: var(--font-head); font-size: 1.2rem;
  font-weight: 800; margin-bottom: 8px;
  text-align: center;
}
.auth-logo span { color: var(--accent); font-size: 0.5rem}
.auth-subtitle {
  text-align: center; color: var(--text2);
  font-size: 0.9rem; margin-bottom: 32px;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text3); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-switch {
  text-align: center; margin-top: 24px;
  font-size: 0.9rem; color: var(--text2);
}

/* ============================================ COURSE CARD */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.course-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.course-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.course-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg3), var(--border));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; position: relative; overflow: hidden;
}
.course-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.5));
}
.course-body { padding: 20px; }
.course-title {
  font-family: var(--font-head); font-size: 1.05rem;
  font-weight: 700; margin-bottom: 6px; color: var(--text);
}
.course-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.8rem; color: var(--text3); margin-bottom: 12px;
}
.course-price {
  font-family: var(--font-head); font-size: 1.3rem;
  font-weight: 800; color: var(--accent);
}

/* ============================================ LESSON LIST */
.lesson-list { display: flex; flex-direction: column; gap: 4px; }
.lesson-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
  border: 1px solid transparent;
}
.lesson-item:hover { background: var(--bg3); }
.lesson-item.active {
  background: rgba(245,166,35,0.1);
  border-color: rgba(245,166,35,0.3);
}
.lesson-item.completed .lesson-check { color: var(--success); }
.lesson-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; flex-shrink: 0;
  transition: all var(--transition);
}
.lesson-item.completed .lesson-check {
  background: var(--success); border-color: var(--success);
  color: #fff;
}
.lesson-item.active .lesson-check {
  border-color: var(--accent);
}
.lesson-title-text { font-size: 0.88rem; flex: 1; }
.lesson-duration { font-size: 0.78rem; color: var(--text3); }

/* ============================================ MISC */
.page-header { margin-bottom: 32px; }
.page-header h2 { margin-bottom: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-muted { color: var(--text2); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.loading-page .spinner { width: 40px; height: 40px; border-width: 3px; }
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text3);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }

/* ============================================ RESPONSIVE */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 4px; }
  .nav-link { padding: 8px 10px; font-size: 0.82rem; }
}

/* ============================================ ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease forwards; }
.fade-up-1 { animation-delay: 0.05s; opacity: 0; }
.fade-up-2 { animation-delay: 0.1s;  opacity: 0; }
.fade-up-3 { animation-delay: 0.15s; opacity: 0; }
.fade-up-4 { animation-delay: 0.2s;  opacity: 0; }
