/* ===== COURSE PLATFORM LAYOUT ===== */

/* Overall body — no extra background gradient so sidebar can anchor */
body.course-layout {
  background: var(--bg);
}

/* ===== TWO-COLUMN WRAPPER ===== */
.course-layout .course-shell {
  display: flex;
  min-height: 100vh;
  padding-top: 60px; /* nav height */
}

/* ===== STICKY SIDEBAR ===== */
.course-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.course-sidebar::-webkit-scrollbar {
  width: 4px;
}
.course-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.course-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* Sidebar header */
.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-course-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  margin-bottom: 6px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.sidebar-logo:hover {
  color: var(--accent-2);
}

/* Module navigation list */
.module-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.module-nav-item {
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.module-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}

.module-nav-link:hover {
  background: rgba(124, 58, 237, 0.06);
}

.module-nav-link.active {
  background: rgba(124, 58, 237, 0.12);
  border-left: 2px solid var(--accent);
}

.module-nav-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.6;
  margin-top: 2px;
  flex-shrink: 0;
}

.module-nav-link.active .module-nav-num {
  opacity: 1;
}

.module-nav-text {
  flex: 1;
}

.module-nav-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2px;
  line-height: 1.3;
}

.module-nav-link.active .module-nav-title {
  color: var(--accent-2);
}

.module-nav-sub {
  font-size: 0.72rem;
  color: var(--fg-muted);
  line-height: 1.3;
}

.module-nav-arrow {
  font-size: 0.8rem;
  color: var(--fg-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Lesson sub-list */
.lesson-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 40px;
  display: none;
}

.module-nav-item.open .lesson-nav-list {
  display: block;
}

.lesson-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  text-decoration: none;
  font-size: 0.78rem;
  color: var(--fg-muted);
  border-radius: 6px;
  transition: all 0.15s;
}

.lesson-nav-link:hover {
  color: var(--fg);
  background: rgba(124, 58, 237, 0.08);
}

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

.lesson-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  flex-shrink: 0;
}

.lesson-nav-link.active .lesson-nav-dot {
  background: var(--accent);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 20px 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-link:hover {
  color: var(--accent-2);
}

/* ===== MAIN CONTENT ===== */
.course-main {
  flex: 1;
  overflow: hidden;
}

/* Top bar (mobile breadcrumb / progress) */
.course-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 10, 30, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.topbar-breadcrumb a {
  color: var(--accent-2);
  text-decoration: none;
}

.topbar-breadcrumb a:hover {
  text-decoration: underline;
}

.topbar-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.progress-track {
  display: flex;
  gap: 4px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.progress-dot.done {
  background: var(--accent);
}

.progress-dot.current {
  background: var(--accent-warm);
}

.topbar-nav-btns {
  display: flex;
  gap: 8px;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
}

.topbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(124, 58, 237, 0.06);
}

.topbar-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.topbar-btn.primary:hover {
  background: #6d28d9;
}

/* ===== LESSON CONTENT ===== */
.lesson-viewer {
  padding: 48px 48px 80px;
  max-width: 760px;
  margin: 0 auto;
}

/* Lesson header */
.lesson-header {
  margin-bottom: 40px;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.lesson-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-warm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 100px;
  padding: 4px 10px;
}

.lesson-reading-time {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.lesson-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  color: var(--fg);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.lesson-hero-subtitle {
  font-size: 1.1rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* Learning objectives */
.objectives-card {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 32px 0;
}

.objectives-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.objectives-label-icon {
  font-size: 1rem;
}

.objectives-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.objectives-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.5;
}

.obj-check {
  color: var(--accent-warm);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Lesson sections */
.lesson-section-divider {
  margin: 48px 0 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.lesson-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  margin-bottom: 16px;
}

.lesson-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.lesson-body-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg-muted);
}

.lesson-body-text p {
  margin-bottom: 16px;
}

.lesson-body-text p:last-child {
  margin-bottom: 0;
}

.lesson-body-text strong {
  color: var(--fg);
  font-weight: 600;
}

.lesson-body-text ul,
.lesson-body-text ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.lesson-body-text li {
  margin-bottom: 8px;
}

.lesson-body-text code {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.88rem;
  color: var(--accent-3);
  font-family: 'Courier New', monospace;
}

/* Content blocks */
.wise-analogy {
  display: flex;
  gap: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
}

.analogy-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.wise-analogy strong {
  color: var(--accent-warm);
  display: block;
  margin-bottom: 4px;
}

.wise-tip {
  display: flex;
  gap: 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
}

.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.wise-tip p { margin: 0; }

.wise-warning {
  display: flex;
  gap: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
}

.warning-icon { font-size: 1.4rem; flex-shrink: 0; }
.wise-warning p { margin: 0; }

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.tool-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 2px;
}

.tool-maker {
  font-size: 0.72rem;
  color: var(--fg-muted);
  font-weight: 400;
}

.tool-card p {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0;
  margin-top: 8px;
  line-height: 1.5;
}

/* Rules grid */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.rule-card {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  align-items: flex-start;
}

.rule-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.3);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-2);
  flex-shrink: 0;
}

.rule-card h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 4px;
}

.rule-card p {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

/* Technique list */
.technique-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

.technique {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
}

.technique h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.technique-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warm);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 100px;
  padding: 2px 8px;
}

.technique p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0;
}

.technique code {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.8rem;
  color: var(--accent-3);
  font-family: 'Courier New', monospace;
}

/* Code of conduct list */
.code-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.code-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.code-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.code-item h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 4px;
}
.code-item p {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== TRY IT NOW ===== */
.tryit-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  margin: 48px 0;
}

.tryit-header {
  text-align: center;
  margin-bottom: 28px;
}

.tryit-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }

.tryit-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 6px;
}

.tryit-desc {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tier-card {
  border-radius: 14px;
  padding: 24px;
  border: 2px solid;
}

.tier-simple {
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.3);
}

.tier-complex {
  background: rgba(124, 58, 237, 0.05);
  border-color: rgba(124, 58, 237, 0.3);
}

.tier-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 100px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.tier-simple .tier-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tier-complex .tier-badge {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-2);
  border: 1px solid var(--border);
}

.tier-description {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.tier-prompt { margin-bottom: 10px; }

.prompt-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 8px;
}

.prompt-box {
  background: rgba(15, 10, 30, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.8rem;
  color: var(--fg);
  line-height: 1.5;
  white-space: pre-line;
}

.tier-note {
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-style: italic;
  margin: 0;
}

/* ===== REFLECTION ===== */
.reflection-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  margin: 40px 0;
  text-align: center;
}

.reflection-icon { font-size: 1.8rem; margin-bottom: 10px; }

.reflection-heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 6px;
}

.reflection-subheading {
  color: var(--fg-muted);
  font-size: 0.88rem;
  margin-bottom: 22px;
}

.reflection-list {
  text-align: left;
  list-style: none;
  padding: 0;
  counter-reset: reflection-counter;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reflection-list li {
  counter-increment: reflection-counter;
  display: flex;
  gap: 14px;
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
  line-height: 1.55;
  padding: 14px 18px;
  background: rgba(30, 20, 64, 0.5);
  border-radius: 10px;
}

.reflection-list li::before {
  content: counter(reflection-counter);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-top: 1px;
}

/* ===== MINI PROJECT ===== */
.miniproject-section {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 18px;
  padding: 28px 32px;
  margin: 40px 0;
}

.miniproject-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.miniproject-icon { font-size: 1.4rem; }

.miniproject-heading {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-warm);
}

.miniproject-desc {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* ===== CAPSTONE ===== */
.capstone-section {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(245, 158, 11, 0.08));
  border: 2px solid var(--accent);
  border-radius: 22px;
  padding: 36px 32px;
  margin: 40px 0;
}

.capstone-header {
  text-align: center;
  margin-bottom: 22px;
}

.capstone-icon { font-size: 2.2rem; display: block; margin-bottom: 8px; }

.capstone-heading {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--fg);
  margin-bottom: 6px;
}

.capstone-desc {
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.capstone-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 26px;
  font-size: 0.92rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

.capstone-content strong { color: var(--fg); }
.capstone-content p { margin-bottom: 12px; }
.capstone-content ul { padding-left: 24px; margin-bottom: 14px; }
.capstone-content li { margin-bottom: 8px; }

/* ===== BOTTOM NAV ===== */
.course-bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 22px;
  text-decoration: none;
  transition: all 0.2s;
  flex: 1;
}

.nav-btn:hover {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
}

.nav-btn-prev { max-width: 240px; }
.nav-btn-next { justify-content: flex-end; text-align: right; }

.nav-btn-arrow {
  font-size: 1.1rem;
  color: var(--accent-2);
  font-weight: 700;
}

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

.nav-btn-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

.nav-btn-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--fg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .course-layout .course-shell {
    flex-direction: column;
    padding-top: 56px;
  }

  .course-sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }

  .course-main {
    width: 100%;
  }

  .lesson-viewer {
    padding: 32px 24px 60px;
  }

  .tier-grid,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .course-bottom-nav {
    flex-direction: column;
  }

  .nav-btn-prev,
  .nav-btn-next {
    max-width: 100%;
  }

  .course-topbar {
    padding: 10px 16px;
  }

  .topbar-progress {
    display: none;
  }

  .module-nav-list {
    display: flex;
    overflow-x: auto;
    padding: 0 16px;
    gap: 8px;
  }

  .module-nav-item {
    border: none;
    flex-shrink: 0;
  }

  .module-nav-link {
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .module-nav-sub {
    display: none;
  }

  .module-nav-arrow {
    display: none;
  }

  .lesson-nav-list {
    display: none !important;
  }

  .sidebar-header,
  .sidebar-footer {
    display: none;
  }
}