/* 3-Column Lesson Application Layout */
* {
    scrollbar-gutter: stable;
}

/* Allow page scroll on lesson page */
body.lesson-page {
    overflow-y: auto !important;
}

/* Sits naturally at the bottom of the scrolled page */
body.lesson-page #footer-placeholder {
    display: block !important;
    width: 100%;
    margin-top: 24px;
}

body.lesson-page .minimal-footer {
    padding: 8px 0 !important;
    border-top: 1px solid var(--border);
}

/* ── Outer wrapper — normal flow, lets page scroll the middle content ── */
.course-app-layout {
    display: flex;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-main);
    box-sizing: border-box;
    align-items: flex-start; /* Allows sidebars to size naturally and stick */
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── Right column wrapper — sticky to viewport ── */
.right-column {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    flex-grow: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 88px; /* 76px navbar/banner + 12px padding gap */
    align-self: flex-start;
}

/* ── Shared box style for all three panels ── */
.curriculum-sidebar,
.lesson-main-area,
.modules-sidebar {
    border-radius: 12px;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.dark-mode .curriculum-sidebar,
.dark-mode .lesson-main-area,
.dark-mode .modules-sidebar {
    background-color: rgba(17, 24, 39, 0.85);
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* ── Left Column - Curriculum Sidebar ── */
.curriculum-sidebar {
    width: 260px;
    min-width: 260px;
    position: sticky;
    top: 88px; /* 76px navbar/banner + 12px padding gap */
    height: calc(100vh - 100px);
    overflow-y: auto;
    flex-shrink: 0;
    flex-grow: 0;
    padding: 0;
    box-sizing: border-box;
    align-self: flex-start;
}

/* ── Middle Column - Lesson View ── */
.lesson-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-width: 0;
}

.lesson-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 16px;
}

.lesson-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0;
    overflow: visible;
}

.lesson-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-main);
}

.embedded-ide-card {
    height: 350px;
    display: flex;
    flex-direction: column;
    margin-top: 16px;
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: calc(100% + 32px);
    max-width: calc(100% + 32px);
    box-sizing: border-box;
    min-width: 0;
}

.embedded-tab-btn {
    border-bottom: 2px solid transparent !important;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
}


.embedded-tab-btn:hover {
    color: var(--primary) !important;
    opacity: 0.9;
}

.embedded-tab-btn.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
    font-weight: 600;
}

.embedded-action-btn-secondary {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    font-size: 12px;
}

.embedded-action-btn-secondary:hover {
    color: var(--primary);
}

.embedded-action-btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.embedded-action-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

.embedded-action-btn-primary:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.3);
}

.embedded-action-btn-success {
    background: #10b981;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.embedded-action-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    filter: brightness(1.1);
}

.embedded-action-btn-success:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
}

/* CodeMirror overrides inside embedded container */
#embedded-editor-container {
    height: 100%;
}

#embedded-editor-container .CodeMirror {
    height: 100% !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: var(--bg-main) !important;
}

#embedded-editor-container .CodeMirror-scroll {
    overflow-y: auto !important;
    overflow-x: auto !important;
}

/* Monokai styling overrides for site consistency */
.cm-s-monokai.CodeMirror {
    background: var(--bg-main) !important;
}

.cm-s-monokai .CodeMirror-gutters {
    background: var(--bg-main) !important;
    border-right: 1px solid var(--border) !important;
}

.cm-s-monokai .CodeMirror-linenumber {
    color: var(--text-muted) !important;
    opacity: 0.5;
}

.cm-s-monokai .cm-keyword {
    color: #3b82f6 !important;
    font-weight: 600 !important;
}

/* Console Text Colors */
.result-success {
    color: #10b981;
}

.result-error {
    color: #ef4444;
}

.result-warning {
    color: #f59e0b;
}

.result-info {
    color: #60a5fa;
}

.cm-error-line {
    background: rgba(239, 68, 68, 0.12) !important;
    border-left: 3px solid #ef4444;
}

.cm-error-text {
    text-decoration: underline wavy #ef4444;
}

/* Waveform Simulation */
.embedded-sim-toolbar {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
}

.embedded-sim-btn {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.embedded-sim-btn:hover {
    background: var(--bg-nav);
    border-color: var(--primary);
    color: var(--primary);
}

.embedded-sim-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    background: var(--bg-main);
}

#embedded-sim-signal-list {
    width: 140px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
}

#embedded-sim-canvas-container {
    flex: 1;
    overflow: auto;
    position: relative;
    background: var(--bg-main);
}

/* Tab header bar */
.embedded-tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-nav);
    height: 38px;
    flex-shrink: 0;
}

/* Tab contents wrapper */
.embedded-tab-contents {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100% - 38px);
    box-sizing: border-box;
    overflow: hidden;
}

/* Individual tab panels — hidden by default */
.embedded-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Show only the active panel */
.embedded-panel.active {
    display: flex;
}


/* IDE tab panel – hosts the CodeMirror element */
#embedded-panel-ide {
    overflow: hidden;
}

#embedded-editor-container {
    height: 100%;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

#embedded-editor-container .CodeMirror {
    height: 100% !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: var(--bg-main) !important;
}

/* Console output panel */
#embedded-panel-console {
    background: var(--bg-main);
    overflow: hidden;
}


#embedded-console-output-area {
    flex: 1;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
    color: #1e293b;
    overflow-y: auto;
}


/* Simulation panel */
#embedded-panel-simulation {
    background: var(--bg-main);
}

/* Empty state for waveform simulation */
#embedded-sim-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    pointer-events: none;
}

/* Status info in sim toolbar */
#embedded-sim-status {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================================ */
/* DARK MODE OVERRIDES FOR EMBEDDED PLAYGROUND */
/* ============================================================ */

.dark-mode .embedded-ide-card {
    background: #0d1117;
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .embedded-tabs-header {
    background: #161b22;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .embedded-tab-btn {
    color: #94a3b8;
}

.dark-mode .embedded-tab-btn.active {
    color: #3b82f6 !important;
    border-bottom-color: #3b82f6 !important;
}

.dark-mode #embedded-panel-console {
    background: #0d1117;
}

.dark-mode #embedded-console-output-area {
    color: #cbd5e1 !important;
    background: #0d1117;
}

.dark-mode #embedded-panel-simulation {
    background: #0d1117;
}

.dark-mode .embedded-sim-toolbar {
    background: #161b22;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark-mode .embedded-sim-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.dark-mode .embedded-sim-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.dark-mode #embedded-sim-signal-list {
    background: #0d1117;
    border-right-color: rgba(255, 255, 255, 0.08);
}

.dark-mode #embedded-sim-canvas-container {
    background: #0d1117;
}

.dark-mode #embedded-sim-status {
    color: #64748b;
}

/* ============================================================ */
/* CUSTOM SYNTAX HIGHLIGHTING (Brand Blue Keywords) */
/* ============================================================ */
/* This ensures consistency across both Dark (Monokai) and Light (Default) themes */

.cm-s-monokai .cm-keyword,
.cm-s-default .cm-keyword,
.cm-keyword {
    color: #3b82f6 !important;
    /* Brand Blue */
    font-weight: 600 !important;
}

.cm-s-monokai .cm-def,
.cm-s-default .cm-def,
.cm-def {
    color: #60a5fa !important;
}

.cm-s-monokai .cm-comment,
.cm-s-default .cm-comment,
.cm-comment {
    color: #94a3b8 !important;
    font-style: italic !important;
}

.cm-s-monokai .cm-string,
.cm-s-default .cm-string,
.cm-string {
    color: #10b981 !important;
    /* Emerald Green */
}

.cm-s-monokai .cm-number,
.cm-s-default .cm-number,
.cm-number {
    color: #f59e0b !important;
    /* Amber */
}

.lesson-header {
    margin-bottom: 12px;
}

.lesson-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.lesson-meta {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.lesson-body h2 {
    font-size: 1.1rem;
    margin: 16px 0 10px;
    font-weight: 700;
    color: var(--text-main);
}

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

.lesson-body ul,
.lesson-body ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

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

/* ── Right Column - Modules Panel ── */
.modules-sidebar {
    padding: 10px;
    overflow: hidden;
    flex: 0 0 auto;
}

.right-ad-container {
    flex-shrink: 0;
    padding: 0 16px 16px;
    text-align: center;
}

.modules-header {
    margin-bottom: 20px;
}

.module-chapter-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.module-difficulty {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.module-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

.modules-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.module-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.module-card:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary);
}

.module-card.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.module-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

.module-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.module-card-btn {
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
}

.module-card-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.module-card-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Curriculum Chapter Header (Accordion style) ── */
.cur-chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    cursor: pointer;
    background: rgba(59, 130, 246, 0.02);
    border-bottom: 1px solid rgba(59, 130, 246, 0.06);
    transition: background 0.15s;
    user-select: none;
}

.cur-chapter-header:hover {
    background: rgba(59, 130, 246, 0.06);
}

.cur-chapter-header.open {
    background: rgba(59, 130, 246, 0.08);
}

.cur-chapter-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-main);
    letter-spacing: 0.05em;
}

.cur-chapter-header.open .cur-chapter-title {
    color: var(--primary);
}

.cur-chap-chevron {
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.cur-chapter-header.open .cur-chap-chevron {
    color: var(--primary);
}

/* ── Subchapter Sub-labels inside Expanded Chapters ── */
.cur-subchapter-label {
    padding: 10px 14px 4px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cur-chapter-group {
    border-bottom: 1px solid rgba(59, 130, 246, 0.05);
}

/* ── Lesson Items inside group ── */
.cur-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.cur-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.cur-item.active {
    background: rgba(59, 130, 246, 0.1);
}

.cur-item.active .cur-item-title {
    color: var(--primary);
    font-weight: 600;
}

.cur-item.active .cur-item-dot {
    background: var(--primary);
    border-color: var(--primary);
}

.cur-item-icon {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.cur-item-title {
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.3;
    flex: 1;
    /* stretch to fill row, pushing dot to far right */
}

.cur-item-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    flex-shrink: 0;
    transition: all 0.15s;
}

/* Locked items visual treatment */
.cur-item.locked {
    opacity: 0.45;
    cursor: not-allowed !important;
}

.cur-item.locked:hover {
    background: transparent !important;
}

.cur-item.locked .cur-item-title {
    color: var(--text-muted) !important;
    font-weight: normal !important;
}

.cur-item.locked .cur-item-dot {
    border-color: var(--border) !important;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ── Progress Tracker (right sidebar) ── */
.tracker-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 2px 6px 2px;
}

.tracker-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.12);
    animation: goldPulseGlow 2.5s infinite ease-in-out;
}

@keyframes goldPulseGlow {
    0%,
    100% {
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.12);
    }

    50% {
        box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
    }
}

.tracker-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tracker-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.tracker-subtitle {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.tracker-bar-wrap {
    height: 4px;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 10px;
    overflow: hidden;
    margin: 2px 4px;
}

.tracker-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.tracker-chapters {
    padding: 12px 0;
}

.tracker-ch-label {
    padding: 8px 16px 4px;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.08em;
}

.tracker-sub {
    padding: 6px 16px;
}

.tracker-sub-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.tracker-sub-name {
    font-size: 0.75rem;
    color: var(--text-main);
    font-weight: 500;
}

.tracker-sub-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.tracker-sub-bar-wrap {
    height: 3px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 50px;
    overflow: hidden;
}

.tracker-sub-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 50px;
    transition: width 0.3s ease;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .modules-sidebar {
        display: none;
    }
}

/* ── Premium Course Specs & Dynamic Exercises ── */
.concept-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.dark-mode .concept-card {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.05);
}

.concept-card h3 {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.concept-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.concept-card.bg-alt {
    background: rgba(59, 130, 246, 0.02);
}

.spec-pre {
    background: #0e121a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px;
    margin: 0;
    overflow-x: auto;
}

.spec-pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: #f8fafc;
}

.spec-list {
    margin: 0;
    padding-left: 20px;
}

.spec-list li {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 3px;
}

/* ── Solve Action Bar ── */
.lesson-action-bar {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.solve-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.solve-action-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    opacity: 0.95;
}

.solve-action-btn:active:not(.disabled) {
    transform: translateY(0);
}

.solve-action-btn.disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Coming Soon Banner ── */
.coming-soon-banner {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.01);
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    margin-bottom: 24px;
}

.coming-soon-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    animation: pulse 2s infinite ease-in-out;
}

.coming-soon-banner h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.coming-soon-banner p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.coming-soon-subtext {
    font-size: 0.78rem !important;
    color: var(--primary) !important;
    font-weight: 600;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* ── Difficulty Badges ── */
.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.difficulty-badge.beginner {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.difficulty-badge.easy {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.difficulty-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.difficulty-badge.intermediate {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.difficulty-badge.advanced {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.difficulty-badge.expert {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

/* ── Theory Markdown Content Styling ── */
.lesson-theory-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.dark-mode .lesson-theory-card {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.05);
}

.lesson-theory-content h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--primary);
}

.lesson-theory-content h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 14px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.lesson-theory-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.lesson-theory-content ul,
.lesson-theory-content ol {
    margin-left: 18px;
    margin-bottom: 10px;
}

.lesson-theory-content li {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.lesson-theory-content pre {
    background: #0e121a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px;
    margin: 8px 0;
    overflow-x: auto;
}

.lesson-theory-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.lesson-theory-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: #f8fafc;
    font-weight: 400;
}

/* ── Verilog Syntax Highlighting (Greater UI Tokens) ── */
.hl-keyword {
    color: #60a5fa !important;
    font-weight: 600;
}

.hl-comment {
    color: #8ba490 !important;
    font-style: italic;
}

.hl-number {
    color: #f59e0b !important;
}

.hl-string {
    color: #10b981 !important;
}

.hl-system {
    color: #a78bfa !important;
}

/* Premium Markdown Table Styling */
.lesson-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.01);
}

.dark-mode .lesson-body table {
    background: rgba(255, 255, 255, 0.005);
    border-color: rgba(255, 255, 255, 0.08);
}

.lesson-body th {
    background: rgba(59, 130, 246, 0.06);
    color: var(--primary);
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.dark-mode .lesson-body th {
    background: rgba(59, 130, 246, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.lesson-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    opacity: 0.95;
}

.dark-mode .lesson-body td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.lesson-body tr:last-child td {
    border-bottom: none;
}

.lesson-body tr:hover td {
    background: rgba(59, 130, 246, 0.02);
}

.dark-mode .lesson-body tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Premium Blockquote Styling */
.lesson-body blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: var(--text-main);
}

.lesson-body blockquote p {
    margin: 0;
}

/* Premium List Item Styling */
.lesson-body ul, .lesson-body ol {
    padding-left: 20px;
    margin-bottom: 14px;
}

.lesson-body li {
    margin-bottom: 6px;
    position: relative;
}

/* Premium Intro Roadmap Grid */
.lesson-lead-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 24px;
    font-weight: 400;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0 24px;
}

.roadmap-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dark-mode .roadmap-card {
    background: rgba(255, 255, 255, 0.008);
    border-color: rgba(255, 255, 255, 0.05);
}

.roadmap-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.roadmap-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
}

.roadmap-card h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.roadmap-card p {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Premium Methodology 1x3 Grid */
.methodology-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.methodology-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 16px 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
    height: 100%;
}

.dark-mode .methodology-item {
    background: rgba(255, 255, 255, 0.005);
    border-color: rgba(255, 255, 255, 0.04);
}

.methodology-item:hover {
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.02);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.methodology-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    flex-shrink: 0;
}

.methodology-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.methodology-info h5 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.methodology-info p {
    margin: 0;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .roadmap-grid {
        grid-template-columns: 1fr;
    }
    .methodology-container {
        grid-template-columns: 1fr;
    }
}

/* Premium Intro Points styling */
.lesson-lead-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.intro-point {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-main);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.012);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-mode .intro-point {
    background: rgba(255, 255, 255, 0.006);
    border-color: rgba(255, 255, 255, 0.04);
}

.intro-point:hover {
    background: rgba(59, 130, 246, 0.02);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* --- Chapter Badge --- */
.chapter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.dark-mode .chapter-badge {
    background: rgba(255, 255, 255, 0.03);
}