:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #161616;
  --bg-card: #1e1e1e;
  --bg-hover: #252525;
  --accent: #00d68f;
  --accent-dark: #00b378;
  --accent-glow: rgba(0, 214, 143, 0.15);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #606060;
  --border: #2a2a2a;
  --border-accent: rgba(0, 214, 143, 0.3);
  --danger: #ff4d4d;
  --warning: #ffb347;
  --info: #4da6ff;
  --success: #00d68f;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-accent: 0 4px 24px rgba(0, 214, 143, 0.2);
  --transition: all 0.2s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; }

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

/* ─── NAVBAR ─────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: 68px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.navbar-brand .logo-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

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

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

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #000;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-accent);
  color: #000;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #e03333;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── HERO ───────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 5% 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 60% 40%, rgba(0, 214, 143, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(77, 166, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero-title .highlight {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 500px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.hero-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

.hero-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.hero-card-icon.green { background: rgba(0, 214, 143, 0.15); }
.hero-card-icon.blue  { background: rgba(77, 166, 255, 0.15); }
.hero-card-icon.orange{ background: rgba(255, 179, 71, 0.15); }

.hero-card-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.hero-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── SECTIONS ───────────────────────────────────────── */
.section {
  padding: 80px 5%;
}

.section-sm { padding: 48px 5%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ─── FEATURES ───────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-accent);
}

.feature-icon {
  width: 52px; height: 52px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── COURSES GRID ───────────────────────────────────── */
.courses-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.filter-btn.active, .filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-accent);
}

.course-thumbnail {
  height: 160px;
  background: linear-gradient(135deg, #1a2a1a 0%, #0d1f0d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.course-thumbnail.has-image {
  background: #0d1f0d;
}

.course-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.course-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(30, 30, 30, 0.8));
  pointer-events: none;
}

.course-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.course-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.course-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.course-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.price-tag {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.price-free {
  font-size: 1rem;
  font-weight: 700;
  color: var(--success);
}

/* ─── COURSE DETAIL ──────────────────────────────────── */
.course-detail-header {
  padding: 100px 5% 60px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.course-detail-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); }

.course-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.course-detail-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.course-detail-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.enroll-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 84px;
}

.enroll-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 20px;
}

.enroll-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-bottom: 16px;
}

.enroll-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.enroll-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.enroll-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── MODULES ACCORDION ──────────────────────────────── */
.modules-section { margin-top: 40px; }

.modules-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.module-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
}

.module-header:hover { background: var(--bg-hover); }

.module-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.module-number {
  width: 32px; height: 32px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.module-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.module-chevron {
  transition: var(--transition);
  color: var(--text-muted);
}

.module-item.open .module-chevron { transform: rotate(180deg); }

.module-body {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.module-item.open .module-body {
  max-height: 500px;
  padding: 0 20px 16px;
}

/* ─── AUTH PAGES ─────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  position: relative;
}

.auth-page .bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0, 214, 143, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 32px;
  justify-content: center;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

/* ─── FORMS ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-control.is-invalid { border-color: var(--danger); }

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

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23606060' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}

.form-error.show { display: block; }

.form-submit { width: 100%; padding: 13px; font-size: 0.95rem; margin-top: 8px; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-btn {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  font-family: var(--font);
}

.oauth-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── DASHBOARD ──────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 68px;
}

.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  position: fixed;
  top: 68px;
  left: 0;
  height: calc(100vh - 68px);
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
  text-decoration: none;
}

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

.sidebar-item.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

.sidebar-icon { font-size: 1.1rem; width: 20px; text-align: center; }

.dashboard-main {
  flex: 1;
  margin-left: 240px;
  padding: 36px 40px;
  min-height: calc(100vh - 68px);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── STAT CARDS ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-accent);
}

.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card-icon.green { background: rgba(0, 214, 143, 0.15); }
.stat-card-icon.blue  { background: rgba(77, 166, 255, 0.15); }
.stat-card-icon.orange{ background: rgba(255, 179, 71, 0.15); }
.stat-card-icon.red   { background: rgba(255, 77, 77, 0.15); }

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── TABLES ─────────────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.table-title {
  font-size: 1rem;
  font-weight: 700;
}

.table-responsive { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 24px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 14px 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ─── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(0, 214, 143, 0.15); color: var(--success); }
.badge-danger  { background: rgba(255, 77, 77, 0.15); color: var(--danger); }
.badge-warning { background: rgba(255, 179, 71, 0.15); color: var(--warning); }
.badge-info    { background: rgba(77, 166, 255, 0.15); color: var(--info); }
.badge-muted   { background: var(--bg-hover); color: var(--text-muted); }

/* ─── MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.2s;
}

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

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

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  width: 30px; height: 30px;
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
  font-family: var(--font);
}

.modal-close:hover { color: var(--text-primary); background: var(--border); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-body .media-preview {
  display: block;
  margin-top: 10px;
  max-width: 100%;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg-hover, #0e0e0e);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ─── TOAST NOTIFICATIONS ────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  font-size: 0.875rem;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ─── LOADING ────────────────────────────────────────── */
.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-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state .empty-icon { font-size: 3rem; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-secondary); }
.empty-state p { font-size: 0.875rem; max-width: 280px; }

/* ─── ENROLLED COURSE CARD ───────────────────────────── */
.enrolled-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.enrolled-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}

.enrolled-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
}

.enrolled-card-header {
  height: 100px;
  background: linear-gradient(135deg, #0d1f14 0%, #132819 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.enrolled-card-body { padding: 18px; }

.enrolled-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.enrolled-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ─── TABS ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font);
}

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

.tab-btn:hover:not(.active) { color: var(--text-secondary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── SEARCH ─────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 1rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: var(--font);
  outline: none;
}

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

/* ─── FOOTER ─────────────────────────────────────────── */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 5% 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 40px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar { padding: 0 16px; gap: 8px; }
  .navbar-actions { gap: 8px; }
  .navbar-user span { display: none; } /* hide first name to save space; avatar stays */
  .navbar-actions .btn { padding: 8px 12px; font-size: 0.8rem; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }

  .course-detail-grid { grid-template-columns: 1fr; }
  .enroll-card { position: static; }

  .dashboard-main { margin-left: 0; padding: 20px; }

  /* Sidebar collapses into a horizontal scrollable tab strip pinned under the navbar */
  .dashboard-layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 999;
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
  }
  .sidebar::-webkit-scrollbar { height: 0; }
  .sidebar-section {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .sidebar-label { display: none; }
  .sidebar-item {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 50px;
    border-left: none;
    font-size: 0.82rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
  }
  .sidebar-item.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
  }
  .dashboard-main { margin-top: 56px; }

  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .hero-title { font-size: 2rem; }
  .navbar-brand { font-size: 1.1rem; }
  .navbar-actions .btn { padding: 6px 10px; font-size: 0.75rem; }
}
