/* AI with Rahish — Course Player & Overview Design System (Purple/Black) */
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&family=Geist+Mono:wght@400;500;600&family=Geist:wght@400;500;600;700;800&display=swap");

:root,
[data-theme="dark"],
[data-theme="light"] {
  color-scheme: dark;
  --background: #060609;
  --foreground: #f4f4f5;
  --muted: #a1a1aa;
  --surface: #0e0e14;
  --surface-elevated: #15151f;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #c8a2ff;
  --accent-strong: #a855f7;
  --accent-dim: rgba(200, 162, 255, 0.14);
  --accent-ink: #09090b;
}

.course-app {
  --course-rail: 320px;
  --course-top: 62px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
  font-family: "Geist", "Figtree", system-ui, -apple-system, sans-serif;
}

.course-app.site-noise::before {
  z-index: 1;
  opacity: 0.018;
  mix-blend-mode: soft-light;
}

.course-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  min-height: 0;
}

@media (min-width: 1024px) {
  .course-shell {
    grid-template-columns: var(--course-rail) minmax(0, 1fr);
  }
}

/* ── Topbar ─────────────────────────────────────── */

.course-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: var(--course-top);
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 6, 9, 0.84);
  backdrop-filter: blur(18px);
}

.course-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.course-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: url("/logo-transparent.svg") center/cover no-repeat;
  box-shadow: 0 0 0 1px rgba(200, 162, 255, 0.35);
}

.course-brand-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f4f4f5;
}

.course-stack {
  display: none;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  margin-left: 0.5rem;
  padding-left: 0.85rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

@media (min-width: 960px) {
  .course-stack {
    display: inline-flex;
  }
}

.course-stack span {
  flex-shrink: 0;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 162, 255, 0.24);
  background: rgba(200, 162, 255, 0.08);
  color: #e9d5ff;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.course-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.course-icon-btn,
.course-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #d4d4d8;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.course-icon-btn {
  width: 2.25rem;
  padding: 0;
}

@media (min-width: 1024px) {
  .course-topbar [data-rail-toggle] {
    display: none;
  }
}

.course-text-btn {
  padding: 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.course-icon-btn:hover,
.course-text-btn:hover,
.course-icon-btn[aria-expanded="true"] {
  color: #fff;
  border-color: rgba(200, 162, 255, 0.45);
  background: rgba(200, 162, 255, 0.12);
}

.course-pct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 162, 255, 0.32);
  background: rgba(200, 162, 255, 0.12);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: #c8a2ff;
  font-variant-numeric: tabular-nums;
}

/* ── Left Curriculum Rail ───────────────────────── */

.course-rail-backdrop {
  position: fixed;
  inset: var(--course-top) 0 0 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.course-rail-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.course-rail {
  position: fixed;
  inset: var(--course-top) auto 0 0;
  z-index: 45;
  width: min(var(--course-rail), 90vw);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(168, 85, 247, 0.08), transparent 55%),
    #09090f;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
}

.course-rail.open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .course-rail {
    position: sticky;
    top: var(--course-top);
    height: calc(100vh - var(--course-top));
    width: auto;
    transform: none;
    z-index: 1;
  }

  .course-rail-backdrop {
    display: none;
  }
}

.course-rail-head {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.course-rail-head a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #c8a2ff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.course-rail-head a:hover {
  color: #e9d5ff;
}

.course-rail-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.course-rail-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #d4d4d8;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.course-rail-nav a:hover {
  color: #fff;
  border-color: rgba(200, 162, 255, 0.45);
  background: rgba(200, 162, 255, 0.12);
}

@media (min-width: 640px) {
  .course-rail-nav {
    display: none;
  }
}

.course-rail-scroll {
  overflow-y: auto;
  padding: 0.85rem 0.7rem 2rem;
  flex: 1;
  scrollbar-width: thin;
}

.course-section {
  margin-bottom: 0.65rem;
}

.course-section-title {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: #a1a1aa;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
}

.course-section-title:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.course-section-chevron {
  width: 0.85rem;
  height: 0.85rem;
  color: #71717a;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.course-section.collapsed .course-section-chevron {
  transform: rotate(-90deg);
}

.course-section.collapsed .course-lesson-list {
  display: none;
}

.course-section-label {
  flex: 1;
  min-width: 0;
}

.course-section-meta {
  color: #71717a;
  font-weight: 600;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.course-lesson-list {
  list-style: none;
  margin: 0.2rem 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.18rem;
}

.course-lesson-list a {
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.58rem 0.65rem;
  border-radius: 0.8rem;
  text-decoration: none;
  color: #a1a1aa;
  font-size: 0.83rem;
  line-height: 1.35;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.course-lesson-list a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f4f4f5;
}

.course-lesson-list a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(200, 162, 255, 0.18), rgba(168, 85, 247, 0.08));
  border-color: rgba(200, 162, 255, 0.38);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 24px -12px rgba(168, 85, 247, 0.45);
}

.course-lesson-list a[aria-current="page"] .course-lesson-num {
  border-color: rgba(200, 162, 255, 0.65);
  color: #c8a2ff;
  background: rgba(200, 162, 255, 0.15);
}

.course-lesson-list a.done .course-lesson-num {
  background: #10b981;
  border-color: transparent;
  color: #052e16;
  font-size: 0;
}

.course-lesson-list a.done .course-lesson-num::after {
  content: "✓";
  font-size: 0.72rem;
  font-weight: 800;
}

.course-lesson-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
}

.course-lesson-mins {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: #71717a;
  white-space: nowrap;
}

/* ── Main Content Area ──────────────────────────── */

.course-main {
  position: relative;
  min-width: 0;
  padding: 1.75rem 1.25rem 5rem;
  background:
    radial-gradient(ellipse 65% 40% at 50% 0%, rgba(168, 85, 247, 0.13), transparent 65%),
    var(--background);
}

@media (min-width: 640px) {
  .course-main {
    padding: 2.25rem 2rem 5.5rem;
  }
}

@media (min-width: 1200px) {
  .course-main {
    padding: 2.5rem 3.25rem 6rem;
  }
}

.course-article {
  max-width: 50rem;
  margin: 0 auto;
}

/* ── Progress & XP Bento Card ───────────────────── */

.course-progress-card {
  margin-bottom: 2.25rem;
  padding: 1.35rem 1.45rem;
  border: 1px solid rgba(200, 162, 255, 0.22);
  border-radius: 1.35rem;
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(200, 162, 255, 0.14), transparent 58%),
    linear-gradient(165deg, rgba(24, 22, 34, 0.9), rgba(11, 11, 16, 0.96));
  box-shadow:
    0 24px 60px -22px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.course-progress-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.course-progress-top .course-level {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  .course-progress-top {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr) minmax(0, 1.15fr);
    gap: 0;
    align-items: center;
  }

  .course-progress-top .course-level {
    grid-column: auto;
  }

  .course-progress-top .course-stat {
    padding-left: 1.25rem;
    margin-left: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 3.6rem;
    justify-content: center;
  }
}

.course-level {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.course-level-ring {
  --p: 0;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background:
    radial-gradient(circle at center, #13121c 64%, transparent 65%),
    conic-gradient(
      #c8a2ff calc(var(--p) * 1%),
      rgba(255, 255, 255, 0.1) 0
    );
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 24px rgba(200, 162, 255, 0.22);
}

.course-level-copy strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 750;
  color: #fff;
  letter-spacing: -0.02em;
}

.course-level-copy span {
  display: block;
  margin-top: 0.2rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  color: #a1a1aa;
}

.course-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.course-stat strong {
  font-size: 0.95rem;
  font-weight: 750;
  color: #fff;
}

.course-stat > span,
.course-stat .course-stat-hint {
  font-size: 0.74rem;
  color: #a1a1aa;
}

.course-badges {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0.35rem 0 0.15rem;
}

.course-badge-dot {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

.course-badge-dot.on {
  border-style: solid;
  border-color: #c8a2ff;
  background: linear-gradient(135deg, #e9d5ff, #a855f7);
  box-shadow: 0 0 12px rgba(200, 162, 255, 0.5);
}

.course-progress-bottom {
  display: grid;
  gap: 0.9rem;
  padding-top: 1.1rem;
}

@media (min-width: 760px) {
  .course-progress-bottom {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.35rem;
  }
}

.course-wins-label {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  color: #a1a1aa;
}

.course-wins-bar {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.course-wins-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a855f7, #c8a2ff, #e9d5ff);
  transition: width 0.25s ease;
}

.course-next-btn,
.course-article a.course-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.6rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid #c8a2ff;
  background: linear-gradient(to bottom right, #e9d5ff, #c8a2ff, #a855f7);
  color: #09090b !important;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 30px -10px rgba(200, 162, 255, 0.75);
  transition: all 0.18s ease;
}

.course-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px -8px rgba(200, 162, 255, 0.95);
}

.course-next-btn[hidden] {
  display: none !important;
}

/* ── Course / Lesson Header ─────────────────────── */

.course-title-row {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1rem;
}

.course-title-icon {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 0.95rem;
  border: 1px solid rgba(200, 162, 255, 0.38);
  background:
    radial-gradient(circle at 30% 25%, rgba(200, 162, 255, 0.28), transparent 60%),
    #12111a;
  display: grid;
  place-items: center;
  color: #c8a2ff;
  box-shadow: 0 12px 30px -12px rgba(168, 85, 247, 0.45);
}

.course-title-row h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.95rem, 4.4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #e4e4e7 65%, #c8a2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.course-share {
  flex-shrink: 0;
  width: auto;
  height: 2.3rem;
  padding: 0 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.course-lede {
  font-size: 1.12rem;
  line-height: 1.72;
  color: #d4d4d8;
  margin: 0 0 0.85rem;
}

.course-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-style: normal;
  color: #a1a1aa;
  margin: 0 0 1.75rem;
}

.course-meta::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #c8a2ff;
}

/* Lesson video clips (only shown when real video IDs exist) */
.course-videos {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}

.course-videos[hidden] {
  display: none !important;
}

/* ── Syllabus / Overview Cards ──────────────────── */

.course-syllabus-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0 1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8a2ff;
}

.course-syllabus-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(200, 162, 255, 0.35), transparent);
}

.course-overview-list {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 2.5rem;
}

.course-overview-list a {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.1rem;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(200, 162, 255, 0.07), transparent 58%),
    linear-gradient(180deg, rgba(22, 22, 30, 0.85), rgba(12, 12, 17, 0.95));
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.course-overview-list a:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 162, 255, 0.45);
  box-shadow: 0 18px 45px -18px rgba(168, 85, 247, 0.3);
}

.course-overview-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(200, 162, 255, 0.28);
  background: rgba(200, 162, 255, 0.1);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: #c8a2ff;
  font-variant-numeric: tabular-nums;
}

.course-overview-list a.done .course-overview-num {
  background: #10b981;
  border-color: transparent;
  color: #052e16;
  font-size: 0;
}

.course-overview-list a.done .course-overview-num::after {
  content: "✓";
  font-size: 0.85rem;
  font-weight: 800;
}

.course-overview-copy strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}

.course-overview-copy span {
  display: block;
  margin-top: 0.2rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: #a1a1aa;
}

.course-overview-mins {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #d4d4d8;
  white-space: nowrap;
}

/* ── Article Prose, Lists & Cards ───────────────── */

.course-article h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 2.25rem 0 0.9rem;
}

.course-article h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: #f4f4f5;
  margin: 1.6rem 0 0.6rem;
}

.course-article p,
.course-article li {
  font-size: 1.03rem;
  line-height: 1.75;
  color: #d4d4d8;
}

.course-article p {
  margin: 0 0 1.1rem;
}

.course-article ul,
.course-article ol {
  margin: 0 0 1.35rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  list-style: none;
}

.course-article ul > li,
.course-article ol > li {
  position: relative;
  padding-left: 1.5rem;
}

.course-article ul > li + li,
.course-article ol > li + li {
  margin-top: 0.65rem;
}

.course-article ul > li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.6rem;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: #c8a2ff;
  box-shadow: 0 0 0 3px rgba(200, 162, 255, 0.2);
}

.course-article ol {
  counter-reset: course-ol;
}

.course-article ol > li {
  counter-increment: course-ol;
}

.course-article ol > li::before {
  content: counter(course-ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #c8a2ff;
}

.course-article a:not(.course-next-btn):not(.course-overview-card) {
  color: #c8a2ff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.course-overview-list a,
.course-nav-footer a {
  text-decoration: none !important;
}
.course-nav-footer a {
  color: #fff !important;
}

.course-article strong {
  color: #fff;
  font-weight: 700;
}

.course-article code {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.86em;
  padding: 0.15em 0.42em;
  border-radius: 0.35rem;
  border: 1px solid rgba(200, 162, 255, 0.22);
  background: rgba(200, 162, 255, 0.1);
  color: #e9d5ff;
}

/* ── Code Blocks & Output ───────────────────────── */

.course-code {
  position: relative;
  margin: 1.25rem 0 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 1.05rem;
  background: #08080d;
  box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.course-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  color: #a1a1aa;
}

.course-code-bar > span::before {
  content: "● ● ●";
  margin-right: 0.65rem;
  letter-spacing: 0.15em;
  color: rgba(200, 162, 255, 0.55);
  font-size: 0.65rem;
}

.course-code pre {
  margin: 0;
  padding: 1.1rem 1.15rem 1.2rem;
  overflow-x: auto;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #e4e4e7;
}

.course-code pre code {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.course-copy {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  border-radius: 0.5rem;
  padding: 0.24rem 0.65rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.course-copy:hover {
  color: #fff;
  border-color: rgba(200, 162, 255, 0.45);
  background: rgba(200, 162, 255, 0.14);
}

.course-output {
  margin: -0.6rem 0 1.45rem;
  border: 1px dashed rgba(200, 162, 255, 0.35);
  border-radius: 0.95rem;
  background: rgba(200, 162, 255, 0.06);
  padding: 0.95rem 1.1rem;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #d4d4d8;
  white-space: pre-wrap;
}

.course-output::before {
  content: "EXPECTED OUTPUT";
  display: block;
  margin-bottom: 0.4rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #c8a2ff;
}

/* ── Callouts (Watch out / Note / Try it) ───────── */

.callout {
  margin: 1.45rem 0;
  padding: 1.1rem 1.2rem;
  border-radius: 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.callout ul,
.callout ol {
  border: 0;
  background: transparent;
  padding: 0.25rem 0 0;
}

.callout.watch {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(15, 15, 20, 0.9));
}

.callout.watch .callout-label {
  color: #fbbf24;
}

.callout.note {
  border-color: rgba(200, 162, 255, 0.4);
  background: linear-gradient(135deg, rgba(200, 162, 255, 0.12), rgba(15, 15, 20, 0.9));
}

.callout.note .callout-label {
  color: #c8a2ff;
}

.callout.tryit {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(15, 15, 20, 0.9));
}

.callout.tryit .callout-label {
  color: #34d399;
}

.callout-label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

/* ── Comparison Tables ──────────────────────────── */

.course-compare {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.9rem;
  border-radius: 0.9rem;
  overflow: hidden;
}

.course-compare th,
.course-compare td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.course-compare th {
  background: rgba(200, 162, 255, 0.1);
  color: #fff;
  font-weight: 700;
}

.course-table-wrap {
  margin: 1.25rem 0 1.6rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.55;
}

.course-table th,
.course-table td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #d4d4d8;
}

.course-table th {
  background: rgba(200, 162, 255, 0.1);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.course-table tbody tr:last-child td {
  border-bottom: 0;
}

.course-table tbody tr:hover td {
  background: rgba(200, 162, 255, 0.04);
}

.course-table code {
  white-space: nowrap;
}

.course-table td:first-child {
  color: #f4f4f5;
  font-weight: 600;
}

/* ── Definitions & Key Takeaways ────────────────── */

.course-def,
.course-takeaways {
  margin: 1.1rem 0 1.4rem;
  padding: 1rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid rgba(200, 162, 255, 0.28);
  border-left: 3px solid #c8a2ff;
  background: linear-gradient(135deg, rgba(200, 162, 255, 0.09), rgba(12, 12, 18, 0.9));
}

.course-def p {
  margin: 0 !important;
  color: #e4e4e7 !important;
}

.course-def-term {
  display: block;
  margin-bottom: 0.4rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c8a2ff;
}

.course-takeaways {
  margin-top: 2rem;
  border-color: rgba(16, 185, 129, 0.3);
  border-left-color: #34d399;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(12, 12, 18, 0.9));
}

.course-takeaways .course-def-term {
  color: #34d399;
}

.course-takeaways ul {
  margin: 0;
  padding: 0.2rem 0 0;
  border: 0;
  background: transparent;
}

.course-takeaways ul > li::before {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.callout ol:last-child {
  margin-bottom: 0;
}

/* ── Lesson Footer Navigation ───────────────────── */

.course-nav-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.course-nav-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.course-nav-footer a:hover {
  border-color: rgba(200, 162, 255, 0.45);
  background: rgba(200, 162, 255, 0.1);
}

.course-nav-footer a[hidden] {
  display: none !important;
}

.course-done-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.78rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #c8a2ff;
  background: linear-gradient(to bottom right, #e9d5ff, #c8a2ff, #a855f7);
  color: #09090b;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 32px -10px rgba(200, 162, 255, 0.75);
  transition: all 0.18s ease;
}

.course-done-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px -8px rgba(200, 162, 255, 0.95);
}

@media (max-width: 639px) {
  .course-topbar {
    gap: 0.6rem;
    padding: 0 0.85rem;
  }

  .course-top-actions .course-text-btn {
    display: none;
  }

  .course-brand {
    flex: 1;
  }

  .course-brand-title {
    font-size: 0.9rem;
  }

  .course-share span {
    display: none;
  }
}

@media (max-width: 1023px) {
  body.course-rail-open {
    overflow: hidden;
  }
}
