:root {
  --yellow: #F3C52A;
  --yellow-dark: #D4A820;
  --purple: #6B4FFF;
  --purple-hover: #5A3FEE;
  --purple-light: #EDE9FF;
  --quiz-border: #C4B5FD;
  --green: #22C55E;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-link: #1D4ED8;
  --border: #E5E7EB;
  --bg-light: #F9FAFB;
  --white: #FFFFFF;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  margin: 0;
  background: var(--white);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-logo {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-right: auto;
}

.navbar-logo strong {
  font-weight: 700;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-links a {
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.navbar-links a:hover { color: var(--purple); }

.navbar-btn {
  background: var(--purple);
  color: var(--white) !important;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.navbar-btn:hover { background: var(--purple-hover) !important; color: var(--white) !important; }

.navbar-icon {
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
}

/* ── Course Header ── */
.course-header {
  background: var(--yellow);
  padding: 28px 48px 32px;
}

.course-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.course-header-breadcrumb {
  font-size: 13px;
  color: #374151;
}

.course-header-plan-link {
  font-size: 13px;
  color: #374151;
  text-decoration: underline;
  cursor: pointer;
}

.course-header-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
  line-height: 1.2;
}

.course-header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.progress-bar-track {
  background: rgba(0,0,0,0.15);
  height: 8px;
  border-radius: 4px;
  width: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-bar-fill {
  background: #16A34A;
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  min-width: 32px;
}

.course-header-meta {
  font-size: 14px;
  color: #374151;
}

.btn-primary {
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--purple-hover); }

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-secondary:hover { border-color: #9CA3AF; }

.btn-gold {
  background: transparent;
  color: #92660A;
  border: 2px solid var(--yellow-dark);
  border-radius: 4px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-gold:hover { background: rgba(212,168,32,0.1); }

.course-header-continue {
  margin-left: auto;
}

/* ── Main Layout ── */
.course-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px 64px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* ── Module Sections ── */
.module-section {
  margin-bottom: 36px;
}

.module-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 3px;
}

.module-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

/* ── Lesson Cards ── */
.lesson-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
}

.lesson-card:hover {
  box-shadow: var(--card-shadow);
  border-color: #D1D5DB;
}

.lesson-card-icon {
  width: 20px;
  height: 20px;
  border: 2px solid #D1D5DB;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lesson-card-icon.done {
  border-color: var(--green);
  background: var(--green);
}

.lesson-card-icon.done::after {
  content: '';
  width: 6px;
  height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.lesson-card-body {
  flex: 1;
  min-width: 0;
}

.lesson-type-badge {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.lesson-title {
  font-size: 15px;
  color: var(--text-link);
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.4;
}

.lesson-card:hover .lesson-title {
  text-decoration: underline;
}

.lesson-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson-progress-track {
  background: #E5E7EB;
  height: 4px;
  border-radius: 2px;
  width: 120px;
  overflow: hidden;
}

.lesson-progress-fill {
  background: var(--green);
  height: 100%;
  border-radius: 2px;
}

.lesson-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-sort {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: color 0.15s;
}

.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { color: var(--purple); }

.sidebar-item input[type="radio"] {
  accent-color: var(--purple);
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* ── Lesson Overview Page ── */
.lesson-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 48px 64px;
}

.lesson-page-back {
  font-size: 13px;
  color: var(--text-link);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  cursor: pointer;
  text-decoration: none;
}

.lesson-page-back:hover { text-decoration: underline; }

.lesson-page-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px;
  line-height: 1.25;
}

.lesson-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-bookmark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: border-color 0.15s;
}

.btn-bookmark:hover { border-color: #9CA3AF; }

.lesson-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.lesson-meta-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}

.lesson-meta-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.lesson-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.lesson-about-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
}

.lesson-about-text {
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 24px;
}

.speaker-section {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.speaker-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #7A5D00;
  flex-shrink: 0;
}

.speaker-info {}
.speaker-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.speaker-name { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.speaker-role { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.speaker-bio { font-size: 14px; color: #374151; line-height: 1.5; }
.speaker-bio p { margin: 4px 0; }

/* ── Content / Longread Page ── */
.content-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px 64px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 48px;
  align-items: start;
}

.content-body {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
}

.content-body h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.content-body h2:first-child { margin-top: 0; }

.content-body p {
  font-size: 15px;
  color: #374151;
  line-height: 1.65;
  margin: 0 0 14px;
}

.content-body strong {
  color: var(--text-primary);
}

.content-body figure {
  margin: 16px 0;
}

.content-body figure img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.content-body figcaption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0;
}

.content-body th {
  background: var(--bg-light);
  font-weight: 600;
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.content-body td {
  padding: 9px 14px;
  border: 1px solid var(--border);
  color: #374151;
}

.content-body tr:hover td { background: #FAFAFA; }

.content-sidebar {
  position: sticky;
  top: 80px;
}

.content-sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.content-sidebar-item {
  display: block;
  font-size: 13px;
  color: #374151;
  padding: 7px 0;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
  transition: color 0.15s;
}

.content-sidebar-item:hover,
.content-sidebar-item.active { color: var(--purple); }

/* ── Navbar link class (used in video/lesson pages) ── */
.navbar-link {
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
  text-decoration: none;
}
.navbar-link:hover { color: var(--purple); }

/* ── Video lesson specific ── */
.video-header-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: flex-start;
}

.lesson-page-wrap.video-page { max-width: 1100px; }

.video-preview-wrap { flex-shrink: 0; }

.video-preview {
  position: relative;
  background: #1F2937;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
}

.video-slides-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  padding: 16px;
}

.video-slide-inner {
  text-align: center;
  color: white;
}

.video-slide-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #F1F5F9;
  margin-bottom: 4px;
}

.video-slide-sub {
  display: block;
  font-size: 11px;
  color: #94A3B8;
}

.video-slide-thumb {
  display: none;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-overlay-text {
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
}

.video-playing-msg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.video-meta-disclaimer {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .video-header-layout { grid-template-columns: 1fr; }
}

/* ── Video Lesson Page ── */
.video-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px 64px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

.video-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #1F2937;
  aspect-ratio: 16/9;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
}

.video-play-btn {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.15s;
}

.video-play-btn:hover { transform: scale(1.08); }

.video-sound-label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.video-disclaimer {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.5;
}

.video-disclaimer a { color: var(--text-link); text-decoration: underline; }

/* ── Quiz Page ── */
.quiz-page {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 48px;
  max-width: 1000px;
  margin: 0 auto;
}

.quiz-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
}

.quiz-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  flex: 1;
  align-items: start;
}

.quiz-image-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.quiz-image-wrap img {
  width: 100%;
  display: block;
}

.quiz-image-caption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.quiz-image-caption a { color: var(--text-link); text-decoration: underline; }

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-btn {
  background: var(--white);
  border: 2px solid var(--quiz-border);
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
  width: 100%;
}

.quiz-option-btn:hover {
  background: var(--purple-light);
  border-color: var(--purple);
}

.quiz-option-btn.selected {
  background: var(--purple-light);
  border-color: var(--purple);
  font-weight: 600;
}

.quiz-option-btn.correct {
  background: #DCFCE7;
  border-color: var(--green);
  color: #166534;
}

.quiz-option-btn.incorrect {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #991B1B;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.quiz-result-msg {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Lesson page wrappers (used by lesson.html) ── */
.lesson-outer { background: var(--white); }

.lesson-page-wrap,
.lesson-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 48px 64px;
}

.lesson-page-header { margin-bottom: 24px; }

.lesson-page-header-left h1 { margin: 0 0 16px; }

.btn-start {
  background: var(--yellow);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-start:hover { background: var(--yellow-dark); }

.lesson-about-section { margin-bottom: 28px; }

.eduson-credit {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 20px;
}

/* ── Content page (longread, used by lesson.html content mode) ── */
.content-page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px 64px;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
  margin-top: 20px;
}

.content-main {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 36px;
}

.sidebar-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav-item {
  border-bottom: 1px solid #F3F4F6;
}

.sidebar-nav-item a {
  display: block;
  font-size: 13px;
  color: #374151;
  padding: 7px 0;
  transition: color 0.15s;
  text-decoration: none;
}

.sidebar-nav-item a:hover { color: var(--purple); }

.content-block { margin-bottom: 32px; }

.content-h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.content-p {
  font-size: 15px;
  color: #374151;
  line-height: 1.65;
  margin: 0 0 12px;
}

.content-img-wrap { margin: 16px 0; }

.content-img-placeholder {
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.content-img-caption {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ── Utility ── */
.back-link {
  font-size: 13px;
  color: var(--text-link);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  text-decoration: none;
  padding: 8px 0;
}

.back-link:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .course-layout,
  .content-page,
  .video-layout {
    grid-template-columns: 1fr;
    padding: 20px 20px 48px;
  }
  .course-header { padding: 20px 20px 24px; }
  .sidebar { display: none; }
  .quiz-layout { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }
  .lesson-meta-grid { grid-template-columns: 1fr; }
}
