/* ═══════════════════════════════════════════════════════════════════════════
   LMS — Design System & Global Styles (v2 — Boxy, Modern, Structured)
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ───────────────────────────────────────────────────────── */
:root {
  --bg-primary: #09090b;
  --bg-secondary: #111113;
  --bg-tertiary: #18181b;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: #1a1a1f;
  --bg-input-focus: #1f1f26;
  --bg-sidebar: #0f0f12;

  --border-color: #27272a;
  --border-subtle: #1f1f23;
  --border-active: #3f3f46;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  /* Accent */
  --accent-1: #7c3aed;
  --accent-2: #a78bfa;
  --accent-3: #c084fc;
  --gradient-primary: linear-gradient(135deg, #7c3aed, #a78bfa);
  --gradient-subtle: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(167, 139, 250, 0.08));

  /* Status */
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --info: #3b82f6;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius — intentionally tight/boxy */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 0.7rem;
  --font-sm: 0.8125rem;
  --font-md: 0.9375rem;
  --font-lg: 1.0625rem;
  --font-xl: 1.1875rem;
  --font-2xl: 1.375rem;
  --font-3xl: 1.75rem;

  --transition-fast: 120ms ease;
  --transition-normal: 200ms ease;

  --navbar-h: 48px;
  --sidebar-w: 240px;
}

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

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

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent-3); }
img, video { max-width: 100%; display: block; }

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ─── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
h1 { font-size: var(--font-3xl); }
h2 { font-size: var(--font-2xl); }
h3 { font-size: var(--font-xl); }
h4 { font-size: var(--font-lg); }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═════════════════════════════════════════════════════════════════════════════
   NAVBAR — compact, 48px, clean
   ═════════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.navbar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-md);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.navbar-brand .brand-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.navbar-brand .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-sm);
}

.navbar-user .user-name {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ═════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent-1);
  color: white;
}
.btn-primary:hover { background: #6d28d9; }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-active); }

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: var(--font-xs); }

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: var(--font-md);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ═════════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═════════════════════════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-md);
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-1);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

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

/* Password wrapper with eye toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* File upload */
.file-upload-zone {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.04);
  color: var(--text-secondary);
}

.file-upload-zone .upload-icon { font-size: 1.5rem; margin-bottom: var(--space-xs); }
.file-upload-zone .file-name { margin-top: var(--space-sm); font-size: var(--font-xs); color: var(--accent-2); font-weight: 500; }

/* ═════════════════════════════════════════════════════════════════════════════
   CARDS — boxy, tight radius
   ═════════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all var(--transition-fast);
}

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

.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-1px); }

/* ═════════════════════════════════════════════════════════════════════════════
   BADGE
   ═════════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary { background: rgba(124, 58, 237, 0.12); color: var(--accent-2); }
.badge-success { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.badge-warning { background: rgba(234, 179, 8, 0.12); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.12); color: var(--info); }

/* ═════════════════════════════════════════════════════════════════════════════
   AUTH PAGE
   ═════════════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
}

/* Left panel / sidebar branding */
.auth-sidebar {
  width: 380px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-2xl);
  flex-shrink: 0;
}

.auth-sidebar .logo-area {
  margin-bottom: var(--space-2xl);
}

.auth-sidebar .logo-area .logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.auth-sidebar .logo-area .logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-sidebar h1 {
  font-size: var(--font-3xl);
  margin-bottom: var(--space-sm);
}

.auth-sidebar p {
  color: var(--text-muted);
  font-size: var(--font-sm);
  line-height: 1.6;
}

.auth-sidebar .features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.auth-sidebar .feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.auth-sidebar .feature-item .fi-icon {
  color: var(--accent-2);
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Right panel — form */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.auth-container {
  width: 100%;
  max-width: 380px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
}

.auth-tab:hover { color: var(--text-secondary); }

.auth-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-form .btn-primary {
  margin-top: var(--space-xs);
  padding: 10px;
  font-size: var(--font-md);
}

.role-selector {
  display: flex;
  gap: var(--space-sm);
}

.role-option {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--font-sm);
}

.role-option:hover { border-color: var(--border-active); color: var(--text-secondary); }

.role-option.selected {
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.08);
  color: var(--text-primary);
}

.role-option .role-icon { font-size: 1.25rem; display: block; margin-bottom: 2px; }

/* ═════════════════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT — sidebar + main
   ═════════════════════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: calc(100vh - var(--navbar-h));
}

/* Dashboard sidebar */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: var(--space-md);
}

.sidebar-section-title {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
  padding: 0 var(--space-sm);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
}

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

.sidebar-link.active {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-2);
}

.sidebar-link .sl-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-sm) var(--space-md);
}

.sidebar-user {
  padding: var(--space-md);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-user .su-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--accent-2);
  flex-shrink: 0;
}

.sidebar-user .su-info { flex: 1; min-width: 0; }
.sidebar-user .su-name { font-size: var(--font-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .su-role { font-size: var(--font-xs); color: var(--text-muted); }

/* Dashboard main area */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--bg-primary);
}

/* ═════════════════════════════════════════════════════════════════════════════
   DASHBOARD CONTENT
   ═════════════════════════════════════════════════════════════════════════════ */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-header h2 { font-size: var(--font-xl); }

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.stat-card {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-card .stat-value {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--accent-2);
}

.stat-card .stat-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ═════════════════════════════════════════════════════════════════════════════
   COURSE GRID
   ═════════════════════════════════════════════════════════════════════════════ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.course-card { position: relative; }

.course-card .course-thumbnail {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 1px solid var(--border-subtle);
}

.course-card .course-title {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card .course-desc {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-card .course-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 11px;
  color: var(--text-muted);
}

.course-card .course-meta span { display: flex; align-items: center; gap: 3px; }

.course-card .course-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

/* ═════════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═════════════════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 2rem; margin-bottom: var(--space-sm); opacity: 0.4; }
.empty-state h3 { font-size: var(--font-md); color: var(--text-secondary); margin-bottom: var(--space-xs); }
.empty-state p { font-size: var(--font-sm); max-width: 320px; margin: 0 auto var(--space-md); }

/* ═════════════════════════════════════════════════════════════════════════════
   MODAL
   ═════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-md) 0;
}

.modal-header h3 { font-size: var(--font-md); }

.modal-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  padding: 0 var(--space-md) var(--space-md);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ═════════════════════════════════════════════════════════════════════════════
   COURSE DETAIL (Admin manage view)
   ═════════════════════════════════════════════════════════════════════════════ */
.course-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.course-detail-header h2 { font-size: var(--font-xl); }
.course-detail-header .course-info p { color: var(--text-muted); font-size: var(--font-sm); margin-top: 2px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.section-title h3 { font-size: var(--font-md); font-weight: 600; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
}

.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent-1); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* ═════════════════════════════════════════════════════════════════════════════
   LESSON LIST
   ═════════════════════════════════════════════════════════════════════════════ */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.lesson-item:hover { border-color: var(--border-color); }

.lesson-item .lesson-number {
  width: 26px;
  height: 26px;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-2);
  flex-shrink: 0;
}

.lesson-item .lesson-info { flex: 1; min-width: 0; }
.lesson-item .lesson-title { font-weight: 500; font-size: var(--font-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-item .lesson-type { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.lesson-item .lesson-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ═════════════════════════════════════════════════════════════════════════════
   STUDENT LIST
   ═════════════════════════════════════════════════════════════════════════════ */
.student-list { display: flex; flex-direction: column; gap: 4px; }

.student-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.student-item .student-info { display: flex; align-items: center; gap: var(--space-sm); }

.student-item .student-avatar {
  width: 28px;
  height: 28px;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-2);
}

.student-item .student-name { font-weight: 500; font-size: var(--font-sm); }
.student-item .student-mobile { font-size: 11px; color: var(--text-muted); }

.enroll-form { display: flex; gap: var(--space-sm); }
.enroll-form .form-input { flex: 1; }

/* ═════════════════════════════════════════════════════════════════════════════
   COURSE VIEWER (Student) — sidebar + content
   ═════════════════════════════════════════════════════════════════════════════ */
.course-viewer {
  display: flex;
  height: calc(100vh - var(--navbar-h));
}

.course-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.course-sidebar-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.course-sidebar-header h3 { font-size: var(--font-md); margin-bottom: 2px; }
.course-sidebar-header p { font-size: 11px; color: var(--text-muted); }

.sidebar-lesson-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

.sidebar-lesson {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 7px var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.sidebar-lesson:hover { background: var(--bg-tertiary); color: var(--text-secondary); }

.sidebar-lesson.active {
  background: rgba(124, 58, 237, 0.1);
  color: var(--text-primary);
  border-left: 2px solid var(--accent-1);
}

.sidebar-lesson .lesson-num {
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.sidebar-lesson.active .lesson-num {
  background: var(--accent-1);
  color: white;
}

.sidebar-lesson .lesson-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sidebar-lesson .type-icon { font-size: 11px; opacity: 0.4; }

/* ─── Content Area ────────────────────────────────────────────────────────── */
.course-content {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

.content-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.content-header h2 { font-size: var(--font-xl); margin-bottom: 4px; }
.content-header .content-type-badge { display: inline-flex; align-items: center; gap: 3px; }

.content-display { max-width: 100%; }

.content-display video {
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-md);
  background: #000;
  object-fit: contain;
}

.content-display iframe {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
}

.content-display img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.content-display .text-content {
  font-size: var(--font-md);
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-width: 720px;
}

.content-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  text-align: center;
  color: var(--text-muted);
}

.content-placeholder .placeholder-icon { font-size: 2.5rem; margin-bottom: var(--space-sm); opacity: 0.3; }

/* ═════════════════════════════════════════════════════════════════════════════
   TOAST
   ═════════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.25s ease;
  min-width: 220px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toast-success { background: var(--bg-tertiary); border: 1px solid rgba(34,197,94,0.2); color: var(--success); }
.toast-error { background: var(--bg-tertiary); border: 1px solid rgba(239,68,68,0.2); color: var(--error); }
.toast-info { background: var(--bg-tertiary); border: 1px solid rgba(59,130,246,0.2); color: var(--info); }

/* ═════════════════════════════════════════════════════════════════════════════
   SPINNER
   ═════════════════════════════════════════════════════════════════════════════ */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
}

.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

.page-loading { display: flex; align-items: center; justify-content: center; height: 50vh; }

/* ═════════════════════════════════════════════════════════════════════════════
   BACK BUTTON
   ═════════════════════════════════════════════════════════════════════════════ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-muted);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-family);
  padding: var(--space-xs) 0;
  margin-bottom: var(--space-sm);
  transition: color var(--transition-fast);
}

.back-btn:hover { color: var(--text-primary); }

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 200;
  width: 42px;
  height: 42px;
  background: var(--accent-1);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-lg);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
}

/* ═════════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═════════════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn 0.25s ease; }

/* ═════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .auth-page { flex-direction: column; }
  .auth-sidebar { width: 100%; padding: var(--space-lg); border-right: none; border-bottom: 1px solid var(--border-color); }
  .auth-sidebar .features { display: none; }
  .auth-main { padding: var(--space-lg); }

  .app-sidebar {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  .app-sidebar.open { transform: translateX(0); }

  .course-grid { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }

  .course-viewer { flex-direction: column; }
  .course-sidebar {
    width: 100%;
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  .course-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .course-content { padding: var(--space-md); }
  .content-display iframe { height: 60vh; }
  .content-display video { max-height: 50vh; }

  .modal { max-width: 100%; }
  .course-detail-header { flex-direction: column; }
  .enroll-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .role-selector { flex-direction: column; }
  .course-card .course-actions { flex-direction: column; }
  .course-card .course-actions .btn { width: 100%; }
}

/* ═════════════════════════════════════════════════════════════════════════════
   UTILITY
   ═════════════════════════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
