/* ============================================================
   chapter-learning.css  —  Premium Single-Card Wizard
   ============================================================ */

:root {
    --cl-primary: #7c3aed;
    --cl-primary-light: rgba(124, 58, 237, .12);
    --cl-primary-dark: #a78bfa;
    --cl-success: #10b981;
    --cl-success-light: rgba(16, 185, 129, .12);
    --cl-success-dark: #6ee7b7;
    --cl-warn: #f59e0b;
    --cl-warn-light: rgba(245, 158, 11, .1);
    --cl-danger: #ef4444;
    --cl-danger-light: rgba(239, 68, 68, .1);
    --cl-orange: #f97316;
    --cl-text: #e0e0e0;
    --cl-text-soft: #9ca3af;
    --cl-muted: #6b7280;
    --cl-bg: #121212;
    --cl-card: #1e1e1e;
    --cl-border: #2a2a2a;
    --cl-radius: 16px;
    --cl-shadow: 0 2px 8px rgba(0, 0, 0, .3), 0 4px 20px rgba(0, 0, 0, .15);
    --cl-transition: .3s cubic-bezier(.4, 0, .2, 1);
}

.cl-page-body {
    background: var(--cl-bg);
}

/* ══════════ HERO ══════════ */
.ch-hero {
    background: linear-gradient(135deg, #6c3483 0%, #7B1FA2 50%, #8E44AD 100%);
    color: #fff;
    padding: 14px 16px 28px;
    text-align: center;
    position: relative;
}

.ch-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--cl-bg);
    border-radius: 20px 20px 0 0;
}

.ch-hero .breadcrumbs {
    font-size: .68rem;
    opacity: .7;
    margin-bottom: 4px;
}

.ch-hero .breadcrumbs a {
    color: #e0e7ff;
    text-decoration: none;
}

.ch-hero .ch-chapter-tag {
    display: inline-block;
    background: rgba(255, 255, 255, .18);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}

.ch-hero h1 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.3;
}

.ch-hero .ch-subtitle {
    display: none;
}

/* ══════════ PROGRESS CARD (sticky) ══════════ */
.cl-progress-wrap {
    max-width: 560px;
    margin: -12px auto 0;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.cl-progress-card {
    background: var(--cl-card);
    border-radius: 14px;
    padding: 12px 14px 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .03);
}

/* ── Progress bar ── */
.cl-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cl-progress-top span {
    font-size: .72rem;
    font-weight: 600;
    color: var(--cl-text-soft);
}

.cl-progress-top .cl-pct {
    color: var(--cl-primary);
    font-weight: 800;
    font-size: .82rem;
}

.progress-bar-bg {
    height: 4px;
    background: var(--cl-border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cl-primary), #7c3aed, var(--cl-success));
    border-radius: 10px;
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ── Concept Roadmap ── */
.cl-roadmap-wrap {
    margin-top: 10px;
}

.rm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--cl-primary-light);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.rm-header-left {
    font-size: .78rem;
    font-weight: 700;
    color: var(--cl-primary-dark);
}

.rm-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rm-counter {
    font-size: .65rem;
    font-weight: 700;
    color: var(--cl-primary);
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}

.rm-chevron {
    font-size: .55rem;
    color: var(--cl-muted);
    transition: transform .25s;
}

.rm-chev-up {
    transform: rotate(180deg);
}

.rm-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.rm-list.rm-open {
    max-height: 360px;
}

.rm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--cl-muted);
    border-bottom: 1px solid var(--cl-bg);
}

.rm-row:last-child {
    border-bottom: none;
}

.rm-icon {
    width: 16px;
    text-align: center;
    font-size: .7rem;
    flex-shrink: 0;
}

.rm-name {
    flex: 1;
}

.rm-row.rm-done {
    color: var(--cl-success-dark);
}

.rm-row.rm-done .rm-icon {
    color: var(--cl-success);
}

.rm-row.rm-active {
    color: var(--cl-primary-dark);
    font-weight: 700;
    background: #fff;
    border-radius: 6px;
}

.rm-row.rm-active .rm-icon {
    color: var(--cl-primary);
}

.rm-row.rm-locked {
    color: #cbd5e1;
}

/* ── Text Stepper (replaces dots) ── */
.cl-stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--cl-bg);
}

.cl-stepper-item {
    font-size: .65rem;
    font-weight: 600;
    color: var(--cl-muted);
    padding: 3px 8px;
    border-radius: 6px;
    transition: all .2s;
}

.cl-stepper-item.st-done {
    color: var(--cl-success);
}

.cl-stepper-item.st-active {
    color: #fff;
    background: var(--cl-primary);
    font-weight: 800;
    border-radius: 6px;
}

.cl-stepper-sep {
    color: var(--cl-border);
    font-size: .5rem;
}

/* ══════════ WIZARD ══════════ */
.cl-wizard {
    max-width: 560px;
    margin: 10px auto 60px;
    padding: 0 12px;
}

.cl-wizard .path-module {
    display: none;
    background: var(--cl-card);
    border-radius: var(--cl-radius);
    padding: 18px 16px;
    box-shadow: var(--cl-shadow);
    animation: cl-in .3s ease;
}

.cl-wizard .path-module.active-module {
    display: block;
}

@keyframes cl-in {
    0% {
        opacity: 0;
        transform: translateY(10px)
    }

    100% {
        opacity: 1;
        transform: translateY(0)
    }
}

.concept-divider {
    display: none;
}

/* ══════════ MODULE HEADER ══════════ */
.module-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cl-border);
}

.module-header h2 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--cl-text);
    margin: 0;
}

.step-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--cl-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-badge i {
    font-size: .8rem;
}

/* ══════════ CONTENT ══════════ */
.content-area {
    font-size: .88rem;
    line-height: 1.7;
    color: var(--cl-text);
}

.content-area p {
    margin: 0 0 8px;
}

.content-area code {
    background: var(--cl-primary-light);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .85em;
    color: var(--cl-primary-dark);
}

.box-tip,
.box-info,
.box-success,
.box-warning {
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: .82rem;
    line-height: 1.55;
}

.box-tip {
    background: var(--cl-warn-light);
    border-left: 3px solid var(--cl-warn);
}

.box-info {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.box-success {
    background: var(--cl-success-light);
    border-left: 3px solid var(--cl-success);
}

.box-warning {
    background: var(--cl-danger-light);
    border-left: 3px solid var(--cl-danger);
}

/* Number tree */
.number-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0;
}

.nt-level {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--cl-bg);
    border-radius: 8px;
}

.nt-chip {
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: .7rem;
    white-space: nowrap;
    min-width: 64px;
    text-align: center;
}

.nt-desc {
    font-size: .76rem;
    color: var(--cl-text-soft);
    line-height: 1.3;
}

.nt-N {
    background: #eef2ff;
    color: #4338ca;
}

.nt-W {
    background: #eff6ff;
    color: #1d4ed8;
}

.nt-Z {
    background: #ecfdf5;
    color: #047857;
}

.nt-Q {
    background: #fffbeb;
    color: #b45309;
}

.nt-R {
    background: #fdf2f8;
    color: #be185d;
}

/* Formula grid */
.formula-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 10px 0;
}

.formula-card {
    background: var(--cl-bg);
    border-radius: 8px;
    padding: 8px 10px;
}

.fc-name {
    font-size: .55rem;
    font-weight: 700;
    color: var(--cl-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fc-formula {
    font-size: .88rem;
    font-weight: 800;
    color: var(--cl-primary);
    font-family: Georgia, serif;
    line-height: 1.3;
}

.fc-example {
    font-size: .7rem;
    color: var(--cl-text-soft);
}

/* ══════════ QUIZ ══════════ */
.quiz-block {
    margin-top: 10px;
}

.quiz-q {
    font-weight: 700;
    font-size: .9rem;
    color: var(--cl-text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.quiz-hint {
    font-size: .74rem;
    color: var(--cl-muted);
    font-style: italic;
    margin-bottom: 6px;
}

.quiz-divider {
    height: 1px;
    background: var(--cl-border);
    margin: 14px 0;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.opt-item {
    padding: 11px 14px;
    background: var(--cl-bg);
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: .85rem;
    line-height: 1.4;
    transition: all .15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.opt-item:active {
    transform: scale(.98);
}

.opt-item.opt-correct {
    border-color: var(--cl-success);
    background: var(--cl-success-light);
    color: var(--cl-success-dark);
    font-weight: 600;
}

.opt-item.opt-wrong {
    border-color: var(--cl-danger);
    background: var(--cl-danger-light);
    color: #b91c1c;
    animation: cl-shake .3s;
}

.opt-item.opt-precheck {
    border-color: var(--cl-primary);
    background: var(--cl-primary-light);
    color: var(--cl-primary-dark);
    font-weight: 600;
}

@keyframes cl-shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-4px)
    }

    50% {
        transform: translateX(4px)
    }

    75% {
        transform: translateX(-2px)
    }
}

.opt-feedback {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .8rem;
    display: none;
}

.opt-feedback.show {
    display: block;
}

.opt-feedback.fb-ok {
    background: var(--cl-success-light);
    color: var(--cl-success-dark);
}

.opt-feedback.fb-err {
    background: var(--cl-danger-light);
    color: #b91c1c;
}

.opt-feedback.fb-pre {
    background: var(--cl-primary-light);
    color: var(--cl-primary-dark);
}

/* ══════════ SOLUTION ══════════ */
.quiz-solution {
    margin-top: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--cl-primary-dark);
    border-radius: 12px;
    display: none;
    animation: cl-in 0.4s ease;
}

.quiz-solution.show {
    display: block;
}

.sol-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--cl-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sol-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--cl-text);
}

.sol-content p {
    margin-bottom: 6px;
}

.sol-content p:last-child {
    margin-bottom: 0;
}

/* ══════════ BUTTONS ══════════ */
.action-btn {
    margin-top: 16px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--cl-primary);
    color: #fff;
}

.btn-primary:active {
    transform: scale(.97);
    opacity: .9;
}

.btn-orange {
    background: var(--cl-orange);
    color: #fff;
}

.btn-orange:active {
    transform: scale(.97);
    opacity: .9;
}

.btn-green {
    background: var(--cl-success);
    color: #fff;
    pointer-events: none;
}

/* ══════════ COMPLETION ══════════ */
.completion-banner {
    display: none;
    text-align: center;
    padding: 28px 18px;
    background: var(--cl-card);
    border-radius: var(--cl-radius);
    box-shadow: var(--cl-shadow);
    animation: cl-pop .4s ease;
}

.completion-banner.show {
    display: block;
}

.completion-banner h2 {
    color: var(--cl-success-dark);
    font-size: 1.2rem;
    margin: 0 0 4px;
}

.completion-banner p {
    color: var(--cl-text-soft);
    font-size: .85rem;
    margin: 0 0 14px;
}

.completion-banner .next-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: var(--cl-primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    font-size: .85rem;
    text-decoration: none;
}

@keyframes cl-pop {
    0% {
        opacity: 0;
        transform: scale(.92)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

#cl-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.cl-loading {
    text-align: center;
    padding: 50px 20px;
    color: var(--cl-muted);
    font-size: .85rem;
}

.cl-loading i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
    color: var(--cl-primary);
    animation: cl-spin .8s linear infinite;
}

@keyframes cl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════ DESKTOP ══════════ */
@media (min-width: 640px) {
    .ch-hero {
        padding: 24px 24px 32px;
    }

    .ch-hero h1 {
        font-size: 1.6rem;
    }

    .ch-hero .ch-subtitle {
        display: block;
        font-size: .88rem;
        opacity: .85;
        margin-top: 4px;
    }

    .cl-wizard .path-module {
        padding: 24px 24px;
    }

    .module-header h2 {
        font-size: 1.1rem;
    }

    .content-area {
        font-size: .95rem;
    }

    .opt-item:hover {
        border-color: var(--cl-primary);
        background: var(--cl-primary-light);
    }

    .btn-primary:hover {
        opacity: .9;
        transform: translateY(-1px);
    }

    .cl-stepper-item {
        font-size: .72rem;
        padding: 3px 10px;
    }
}

@media (min-width: 900px) {

    .cl-wizard,
    .cl-progress-wrap {
        max-width: 640px;
    }
}

/* ══════════ CHAPTER TEST ══════════ */
.chapter-test-card .module-header .step-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ct-desc {
    color: var(--cl-text-soft);
    font-size: .9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.ct-score-bar {
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 18px;
    text-align: center;
}

.ct-answered {
    color: #f59e0b;
    font-weight: 700;
    font-size: .88rem;
}

.ct-concept-tag {
    display: inline-block;
    background: var(--cl-primary-light);
    color: var(--cl-primary-dark);
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.ct-result {
    border-radius: var(--cl-radius);
    padding: 24px;
    text-align: center;
    margin: 18px 0;
}

.ct-pass {
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .3);
}

.ct-fail {
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .3);
}

.ct-result-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.ct-result-score {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.ct-pass .ct-result-score {
    color: var(--cl-success);
}

.ct-fail .ct-result-score {
    color: #f59e0b;
}

.ct-result-msg {
    color: var(--cl-text-soft);
    font-size: .9rem;
}

/* ══════════ LEARN SECTION TYPOGRAPHY & SPACING ══════════ */
.path-module .content-area p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--cl-text);
    letter-spacing: 0.2px;
}

.path-module .content-area p strong {
    color: #fff;
    font-weight: 600;
    position: relative;
}

/* Custom list styling inside paragraphs */
.path-module .content-area p:has(br) {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Special styling for step-by-step instructions */
.path-module .content-area p strong:contains("Step") {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.1em;
    margin-right: 5px;
}

/* ══════════ INFO BOXES (Glassmorphism & Gradients) ══════════ */
.path-module [class^="box-"] {
    position: relative;
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--cl-text);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.path-module [class^="box-"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Subtle gradient background instead of flat solid color */
.path-module .box-info {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-left: 4px solid #3b82f6;
}

.path-module .box-tip {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.02));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-left: 4px solid #f59e0b;
}

.path-module .box-success {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left: 4px solid #10b981;
}

.path-module .box-warning {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.02));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left: 4px solid #ef4444;
}

/* ══════════ MATH EQUATION STYLING ══════════ */
.path-module .katex-display {
    background: rgba(15, 23, 42, 0.6);
    padding: 18px 20px;
    border-radius: 12px;
    margin: 1.5em 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    overflow-y: hidden;
}

.path-module .katex {
    font-size: 1.15em;
    /* Slightly larger math for readability */
}

/* Better spacing around inline math */
.path-module p .katex {
    margin: 0 3px;
    color: #e2e8f0;
}

/* ══════════ HIGHLIGHTS & INLINE CODE ══════════ */
.path-module code {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    color: #d8b4fe;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 0.02em;
    border: 1px solid rgba(139, 92, 246, 0.2);

}

/* ══════════ LEARN SECTION IMPROVEMENTS ══════════ */
.path-module .content-area p {
    line-height: 1.8;
    margin-bottom: 14px;
    color: var(--cl-text);
    font-size: .92rem;
}

.path-module .content-area p strong {
    color: #c4b5fd;
    font-weight: 700;
}

.path-module .content-area p br {
    display: block;
    content: '';
    margin-top: 6px;
}

/* ══════════ QUIZ & HINT STYLES ══════════ */
.quiz-hint {
    background: rgba(245, 158, 11, .08);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px 0 12px;
    font-size: .84rem;
    color: #fbbf24;
    line-height: 1.6;
    animation: hintReveal .3s ease;
}

@keyframes hintReveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════ KaTeX MATH OVERRIDES ══════════ */
.katex {
    font-size: 1.05em !important;
    color: #ddd6fe !important;
}

.path-module .katex-display {
    margin: 12px 0;
    overflow-x: auto;
}

/* ══════════ FORMULA GRID IMPROVEMENTS ══════════ */
.formula-grid {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.formula-card {
    background: rgba(124, 58, 237, .06);
    border: 1px solid rgba(124, 58, 237, .15);
    border-radius: 10px;
    padding: 12px 16px;
}

.formula-card .fc-rule {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--cl-primary-dark);
    font-weight: 700;
    margin-bottom: 5px;
}

.formula-card .fc-formula {
    color: var(--cl-text);
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.formula-card .fc-example {
    font-size: .82rem;
    color: var(--cl-text-soft);
}

/* ══════════ NUMBER TREE IMPROVEMENTS ══════════ */
.number-tree {
    margin: 16px 0;
    padding-left: 8px;
    border-left: 2px solid rgba(124, 58, 237, .2);
}

.nt-level {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nt-chip {
    font-size: .82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
    min-width: 90px;
    text-align: center;
}

.nt-desc {
    font-size: .84rem;
    color: var(--cl-text-soft);
}

.nt-N {
    background: rgba(59, 130, 246, .12);
    color: #60a5fa;
}

.nt-W {
    background: rgba(16, 185, 129, .12);
    color: #6ee7b7;
}

.nt-Z {
    background: rgba(245, 158, 11, .12);
    color: #fbbf24;
}

.nt-Q {
    background: rgba(168, 85, 247, .12);
    color: #c084fc;
}

/* ══════════ STEPPER CLICKABLE ══════════ */
.cl-stepper-item {
    cursor: pointer;
    transition: color .2s, transform .15s;
}

.cl-stepper-item:hover {
    transform: scale(1.08);
}

/* ══════════ ROADMAP CLICKABLE ══════════ */
.rm-row {
    transition: background .2s, transform .15s;
}

.rm-row[style*="cursor: pointer"]:hover {
    background: rgba(124, 58, 237, .08);
    transform: translateX(4px);
}

/* ══════════ INTERACTIVE GRAPH ══════════ */
.cl-graph-container {
    background: #0f172a;
    border-radius: 16px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cl-interactive-graph {
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cl-graph-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin-top: 16px;
    gap: 12px;
}

.cl-graph-info {
    flex-grow: 1;
    font-size: 0.9rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.cl-graph-info.info-active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border-left: 3px solid #38bdf8;
}

.cl-graph-info.info-success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10b981;
}

.cl-graph-controls .action-btn {
    margin: 0;
    font-size: 0.85rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
}

.cl-graph-controls .action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 500px) {
    .cl-graph-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .cl-graph-info {
        text-align: center;
        margin-bottom: 8px;
    }

    .cl-graph-controls .action-btn {
        width: 100%;
    }

    .nt-level {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cl-roadmap-wrap {
        padding: 10px;
    }
}

/* ══════════ COMPUTATIONAL THINKING (CG-9) BLOCKS ══════════ */
.path-module .box-decomposition {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.1), rgba(124, 58, 237, 0.02));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-left: 4px solid var(--cl-primary);
}

.box-decomposition::before {
    content: '\f12e'; /* Puzzle piece icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    opacity: 0.1;
    color: var(--cl-primary);
}

.algorithm-block {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #94a3b8;
    position: relative;
    overflow: hidden;
}

.algorithm-block::after {
    content: 'ALGO';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--cl-primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-bottom-left-radius: 4px;
    opacity: 0.8;
}

.algo-step {
    display: flex;
    gap: 12px;
    padding: 4px 0;
}

.algo-num {
    color: var(--cl-primary-dark);
    font-weight: 800;
    min-width: 1.5em;
}

.algo-text {
    flex: 1;
}

/* ══════════ SPIRAL & DENSITY SPECIFIC ══════════ */
.spiral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.stat-item {
    background: rgba(255,255,255,0.03);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--cl-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cl-primary-dark);
}
