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

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #0f172a;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.section { padding: 48px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ── Navigation ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 60px;
  background: #ffffff; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  font-weight: 700; font-size: 1rem; color: #0f172a;
  letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px;
}
.nav-brand i { color: #3b82f6; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  padding: 6px 12px; border-radius: 5px; font-size: 0.875rem;
  color: #64748b; text-decoration: none; cursor: pointer;
  background: none; border: none; font-family: inherit;
}
.nav-link:hover { background: #f1f5f9; color: #0f172a; }

/* ── Typography ── */
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { color: #64748b; line-height: 1.7; }
.text-muted { color: #64748b; font-size: 0.875rem; }
.label {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: #3b82f6;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; font-size: 0.875rem; font-weight: 500; font-family: inherit;
  border-radius: 5px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s; white-space: nowrap; text-decoration: none;
}
.btn-primary { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn-primary:hover { background: #1e293b; }
.btn-ghost { background: transparent; color: #64748b; border-color: transparent; }
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.btn-sm { padding: 7px 13px; font-size: 0.8rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }

/* ── Cards ── */
.card {
  background: #ffffff; border: 1px solid #e2e8f0;
  border-radius: 8px; overflow: hidden; transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.card-img {
  width: 100%; height: 180px; object-fit: cover; display: block;
}
.card-body { padding: 24px; }
.card-meta {
  display: flex; gap: 16px; margin-top: 12px; font-size: 0.8rem; color: #94a3b8;
}
.card-meta i { margin-right: 4px; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.85rem; font-weight: 500; color: #0f172a; }
input {
  width: 100%; padding: 10px 14px; font-size: 0.9rem; font-family: inherit;
  color: #0f172a; background: #ffffff;
  border: 1px solid #e2e8f0; border-radius: 5px; transition: border-color 0.15s;
}
input:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
input::placeholder { color: #94a3b8; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 5px; font-size: 0.85rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 99px; font-size: 0.75rem; font-weight: 500;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #15803d; }

/* ══════════════════════════════════════
   AUTH VIEW
   ══════════════════════════════════════ */
.auth-view {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 48px 16px; background: #f8fafc;
}
.auth-container {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 40px 32px;
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-icon { font-size: 2.5rem; color: #3b82f6; margin-bottom: 12px; }
.auth-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: #f1f5f9; border-radius: 6px; padding: 4px;
}
.auth-tab {
  flex: 1; padding: 8px; border: none; background: transparent;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  color: #64748b; border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.auth-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* ══════════════════════════════════════
   HERO / LANDING
   ══════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff; padding: 80px 0;
}
.hero-content { max-width: 600px; }
.hero h1 { font-size: 2.8rem; color: #fff; margin: 12px 0 16px; }
.hero p { color: #94a3b8; font-size: 1.1rem; line-height: 1.7; }
.hero p strong { color: #fff; }
.hero-actions { margin-top: 32px; display: flex; align-items: center; gap: 20px; }
.hero .btn-primary { background: #3b82f6; border-color: #3b82f6; }
.hero .btn-primary:hover { background: #2563eb; border-color: #2563eb; }
.hero .text-muted { color: #64748b; font-size: 0.85rem; }

/* ══════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════ */
.dashboard-header { margin-bottom: 32px; }
.dashboard-header h2 { margin-bottom: 4px; }

.course-card { cursor: pointer; }
.course-card .card-body h3 { margin-bottom: 8px; }
.course-card .card-body p { font-size: 0.875rem; }

/* ══════════════════════════════════════
   COURSE VIEW
   ══════════════════════════════════════ */
.course-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px;
  margin-top: 24px;
}
.course-sidebar {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px; align-self: start; position: sticky; top: 80px;
}
.lesson-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
  border: none; background: none; width: 100%;
  text-align: left; font-family: inherit; font-size: 0.875rem;
  color: #64748b;
}
.lesson-item:hover { background: #f1f5f9; color: #0f172a; }
.lesson-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 500; }
.lesson-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; flex-shrink: 0;
}
.lesson-item.active .lesson-number { background: #3b82f6; color: #fff; }
.lesson-duration { margin-left: auto; font-size: 0.75rem; color: #94a3b8; }

.course-content {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 40px; min-height: 400px;
}
.course-content h2 { margin-bottom: 8px; }

/* Lesson content markdown */
.lesson-body h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.lesson-body h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.lesson-body p { margin-bottom: 16px; }
.lesson-body ul, .lesson-body ol { margin-bottom: 16px; padding-left: 24px; color: #475569; }
.lesson-body li { margin-bottom: 6px; }
.lesson-body strong { color: #0f172a; }
.lesson-body blockquote {
  border-left: 3px solid #3b82f6; padding: 12px 16px; margin: 16px 0;
  background: #eff6ff; border-radius: 0 6px 6px 0; color: #1e40af;
}
.lesson-body pre {
  background: #1e293b; color: #e2e8f0; padding: 20px;
  border-radius: 8px; overflow-x: auto; margin: 16px 0;
  font-size: 0.85rem; line-height: 1.6;
}
.lesson-body code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
  font-size: 0.85rem; color: #e11d48;
}
.lesson-body pre code { background: none; padding: 0; color: inherit; }
.lesson-body table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
}
.lesson-body th, .lesson-body td {
  padding: 10px 14px; border: 1px solid #e2e8f0; text-align: left;
}
.lesson-body th { background: #f8fafc; font-weight: 600; }

.lesson-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 300px; color: #94a3b8;
}
.lesson-placeholder i { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }

.lesson-nav {
  display: flex; justify-content: space-between; margin-top: 40px;
  padding-top: 24px; border-top: 1px solid #e2e8f0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 48px 0; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar { position: static; }
  .course-content { padding: 24px; }
  .nav { padding: 0 16px; }
  .auth-container { padding: 28px 20px; }
}