/* ============================================================
   Resource Template CSS — Modern Age Coders
   Design tokens: #a855f7 purple, #06b6d4 cyan, #000002 bg,
   #f1f5f9 text, Syne headings, Inter body, Fira Code mono

   NOTE: Uses !important where global style.css overrides must
   be defeated (main flex layout, heading sizes, paragraph color).
   ============================================================ */

/* === BASE LAYOUT ============================================ */
/* The global main rule sets display:flex, align-items:center,
   gap:6rem — all of which break article layouts. Override all. */
.resource-main {
    display: block !important;
    max-width: 820px !important;
    margin: 0 auto !important;
    padding: 120px 28px 60px !important;
    color: #f1f5f9 !important;
    gap: 0 !important;
    align-items: stretch !important;
    width: 100% !important;
}

/* Ensure children of resource-main are not treated as flex items */
.resource-main > * {
    max-width: 100% !important;
    width: 100% !important;
}

/* === BREADCRUMB ============================================== */
.resource-main .breadcrumb {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.85rem !important;
    margin-bottom: 28px;
    color: #94a3b8;
    padding: 0;
    background: none;
    border: none;
}

.resource-main .breadcrumb a {
    color: #a855f7;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.85rem !important;
}

.resource-main .breadcrumb a:hover {
    color: #c084fc;
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #475569;
    font-size: 0.8rem;
    user-select: none;
}

.breadcrumb-current {
    color: #f1f5f9;
    font-weight: 500;
}

/* === PAGE HEADER ============================================= */
.resource-header {
    margin-bottom: 36px;
}

.resource-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* Reset any global badge styles from style.css */
.resource-main .badge {
    display: inline-flex !important;
    align-items: center;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid !important;
    background: transparent;
    line-height: 1.4;
    /* Kill global card styles that match .badge */
    box-shadow: none !important;
    transform: none !important;
    overflow: visible !important;
    position: static !important;
    transition: none !important;
}

.resource-main .badge:hover {
    transform: none !important;
    box-shadow: none !important;
}

.badge-chapter {
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.4) !important;
    background: rgba(168, 85, 247, 0.1) !important;
}

.badge-beginner {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4) !important;
    background: rgba(74, 222, 128, 0.1) !important;
}

.badge-intermediate {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4) !important;
    background: rgba(251, 191, 36, 0.1) !important;
}

.badge-advanced {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4) !important;
    background: rgba(248, 113, 113, 0.1) !important;
}

.badge-time,
.badge-updated {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.3) !important;
    background: rgba(148, 163, 184, 0.08) !important;
}

.badge-questions {
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.4) !important;
    background: rgba(6, 182, 212, 0.1) !important;
}

.badge-free {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4) !important;
    background: rgba(74, 222, 128, 0.15) !important;
}

/* Title — override global h1 sizing */
.resource-main .resource-title {
    font-family: 'Syne', sans-serif !important;
    font-weight: 800 !important;
    font-size: 2.2rem !important;
    line-height: 1.2 !important;
    color: #f1f5f9 !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
}

.resource-subtitle {
    font-size: 1.1rem !important;
    color: #94a3b8 !important;
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 12px;
}

.practice-link,
.notes-link {
    display: inline-block;
    color: #a855f7 !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
    margin-top: 4px;
}

.practice-link:hover,
.notes-link:hover {
    color: #c084fc !important;
    text-decoration: underline;
}

/* === INDEX STATS ============================================= */
.index-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.index-intro {
    color: #cbd5e1 !important;
    line-height: 1.75;
    margin-bottom: 16px;
}

.resource-main .index-intro p {
    margin-bottom: 12px;
    color: #cbd5e1 !important;
    font-size: 1rem !important;
    line-height: 1.75 !important;
}

/* === TABLE OF CONTENTS ======================================= */
.toc-box {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.15) !important;
    border-left: 4px solid #a855f7 !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 24px 28px !important;
    margin-bottom: 40px !important;
    /* Kill any global card styles */
    box-shadow: none !important;
    transform: none !important;
    overflow: visible !important;
    position: static !important;
}

.toc-box:hover {
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

/* Override global h2 size inside TOC */
.toc-box .toc-heading {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: #c084fc !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
    line-height: 1.3 !important;
}

.toc-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-list li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    display: inline-block;
    padding: 2px 0;
}

.toc-list li a:hover {
    color: #a855f7;
}

.toc-list li a::before {
    content: '#';
    color: #475569;
    margin-right: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* === CONTENT SECTIONS ======================================== */
.resource-content {
    width: 100%;
}

.content-section {
    margin-bottom: 48px;
    padding-bottom: 8px;
}

/* Override global h2 { font-size: clamp(2rem,4vw,3rem) } */
.resource-main .content-section h2 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
    color: #f1f5f9 !important;
    margin: 0 0 16px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid rgba(168, 85, 247, 0.2) !important;
    text-align: left !important;
}

/* Override global h3 { font-size: clamp(1.5rem,3vw,2rem) } */
.resource-main .content-section h3 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    color: #e2e8f0 !important;
    margin: 28px 0 12px !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
}

.resource-main .content-section h4 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    line-height: 1.35 !important;
    color: #e2e8f0 !important;
    margin: 22px 0 10px !important;
    text-align: left !important;
}

/* Override global p { font-size: var(--body-regular); color: var(--text-secondary) } */
.resource-main .content-section p {
    color: #cbd5e1 !important;
    line-height: 1.75 !important;
    font-size: 1rem !important;
    margin-bottom: 14px !important;
    text-align: left !important;
}

.resource-main .content-section ul,
.resource-main .content-section ol {
    color: #cbd5e1 !important;
    line-height: 1.75;
    padding-left: 24px !important;
    margin-bottom: 16px !important;
}

.resource-main .content-section li {
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.75;
}

/* Inline code */
.resource-main .content-section code {
    font-family: 'Fira Code', monospace !important;
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    font-size: 0.88em !important;
    border: none !important;
}

/* Code blocks */
.resource-main .content-section pre {
    background: #0d1117 !important;
    border: 1px solid rgba(168, 85, 247, 0.15) !important;
    border-radius: 8px !important;
    padding: 18px 20px !important;
    overflow-x: auto;
    margin-bottom: 18px !important;
    position: relative;
    width: 100%;
}

.resource-main .content-section pre code {
    background: none !important;
    padding: 0 !important;
    color: #e6edf3 !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    border-radius: 0 !important;
}

/* Strong tags inside content */
.resource-main .content-section strong {
    color: #f1f5f9;
    font-weight: 600;
}

/* === CODE EXAMPLES =========================================== */
.code-example {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 10px;
    margin-bottom: 28px;
    overflow: hidden;
    width: 100%;
}

.code-example-title {
    background: rgba(168, 85, 247, 0.1);
    padding: 12px 18px;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #c084fc;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.code-example pre {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #0d1117 !important;
}

.code-example pre code {
    background: none !important;
    color: #e6edf3 !important;
}

.code-example-explanation {
    padding: 14px 18px;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.65;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
}

.code-example-explanation code {
    font-family: 'Fira Code', monospace !important;
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-size: 0.88em !important;
}

.code-example-output {
    padding: 12px 18px;
    background: rgba(6, 182, 212, 0.05);
    border-top: 1px solid rgba(6, 182, 212, 0.15);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #22d3ee;
    white-space: pre-wrap;
    line-height: 1.5;
}

.code-example-output::before {
    content: 'Output: ';
    font-weight: 700;
    color: #06b6d4;
}

/* === CODE COPY BUTTON ======================================== */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.code-copy-btn:hover {
    background: rgba(168, 85, 247, 0.3);
}

.code-copy-btn.copied {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.15);
}

/* === COMMON MISTAKES ========================================= */
.mistake-card {
    background: rgba(248, 113, 113, 0.03);
    border: 1px solid rgba(248, 113, 113, 0.1);
    border-left: 4px solid #f87171 !important;
    border-radius: 0 10px 10px 0;
    padding: 22px 24px;
    margin-bottom: 24px;
}

.resource-main .mistake-card h3 {
    color: #f87171 !important;
    margin: 0 0 14px !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    border: none !important;
}

.mistake-card .wrong-code {
    border-left: 3px solid #f87171;
    padding-left: 14px;
    margin-bottom: 12px;
}

.mistake-card .wrong-code::before {
    content: 'Wrong:';
    display: block;
    color: #f87171;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.mistake-card .error-message {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 6px;
    padding: 10px 14px;
    color: #fca5a5;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    margin-bottom: 14px;
    line-height: 1.5;
}

.mistake-card .correct-code {
    border-left: 3px solid #4ade80;
    padding-left: 14px;
    margin-bottom: 12px;
}

.mistake-card .correct-code::before {
    content: 'Correct:';
    display: block;
    color: #4ade80;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.mistake-card .mistake-explanation {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.65;
    margin-top: 10px;
}

/* === SUMMARY BOX ============================================= */
.summary-box {
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-left: 4px solid #a855f7 !important;
    border-radius: 0 10px 10px 0;
    padding: 22px 26px;
    margin-top: 8px;
}

.resource-main .summary-box h2 {
    font-size: 1.2rem !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
    color: #c084fc !important;
}

.summary-box ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.summary-box li {
    padding: 6px 0 6px 0;
    color: #cbd5e1;
    line-height: 1.6;
    font-size: 0.95rem;
}

.summary-box li::before {
    content: '\2713';
    color: #a855f7;
    font-weight: 700;
    margin-right: 10px;
}

/* === RELATED TOPICS ========================================== */
.related-topics {
    margin-bottom: 40px;
}

.resource-main .related-topics h2 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.3rem !important;
    color: #f1f5f9 !important;
    margin-bottom: 16px !important;
    padding: 0 !important;
    border: none !important;
}

.related-topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-topic-link {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    color: #c084fc !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.related-topic-link:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #e9d5ff !important;
}

/* === CHAPTER NAVIGATION ====================================== */
.chapter-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.chapter-nav-card {
    display: flex !important;
    flex-direction: column;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(168, 85, 247, 0.15) !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.2s;
    /* Kill global card hover transform */
    box-shadow: none !important;
    overflow: visible !important;
    position: relative !important;
}

.chapter-nav-card:hover {
    background: rgba(168, 85, 247, 0.08) !important;
    border-color: rgba(168, 85, 247, 0.35) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1) !important;
}

.chapter-nav-card.prev {
    text-align: left;
}

.chapter-nav-card.next {
    text-align: right;
    grid-column: 2;
}

.chapter-nav-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.chapter-nav-title {
    color: #c084fc;
    font-weight: 600;
    font-size: 0.95rem;
}

/* === CTA SECTIONS ============================================ */
.cta-section {
    text-align: center;
    padding: 36px 28px;
    margin-bottom: 36px;
    border-radius: 12px;
    background: rgba(168, 85, 247, 0.04);
    border: 1px solid rgba(168, 85, 247, 0.12);
}

.resource-main .cta-section h2 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    color: #f1f5f9 !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: none !important;
    text-align: center !important;
}

.resource-main .cta-section p {
    color: #94a3b8 !important;
    margin: 0 0 20px !important;
    font-size: 0.95rem !important;
    text-align: center !important;
}

.cta-button-primary {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #a855f7, #06b6d4) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    border: none !important;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.cta-button-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3) !important;
}

.cta-button-outline {
    display: inline-block;
    padding: 12px 32px;
    background: transparent !important;
    color: #a855f7 !important;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid rgba(168, 85, 247, 0.4) !important;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.cta-button-outline:hover {
    background: rgba(168, 85, 247, 0.08) !important;
    border-color: #a855f7 !important;
}

.cta-course {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* === PRACTICE PAGE: STATS BAR ================================ */
.practice-stats-bar {
    display: flex !important;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.practice-stats-bar .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    padding: 18px 16px;
    text-align: center;
    position: relative;
}

/* Divider between stats */
.practice-stats-bar .stat + .stat {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.practice-stats-bar .stat-count {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1;
}

.practice-stats-bar .stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.stat-easy .stat-count { color: #4ade80; }
.stat-medium .stat-count { color: #fbbf24; }
.stat-hard .stat-count { color: #f87171; }

/* === PRACTICE PAGE: QUESTION CARDS =========================== */
.practice-section {
    margin-bottom: 48px;
}

.resource-main .practice-section h2 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    color: #f1f5f9 !important;
    margin-bottom: 24px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid rgba(168, 85, 247, 0.15) !important;
    text-align: left !important;
}

.question-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 18px;
    transition: border-color 0.2s;
}

.question-card:hover {
    border-color: rgba(168, 85, 247, 0.2);
}

.question-card .question-number {
    display: inline-block;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    margin-right: 10px;
}

.question-card .question-difficulty {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    vertical-align: middle;
}

.question-difficulty.easy {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.question-difficulty.medium {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.question-difficulty.hard {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.question-card .question-text {
    color: #e2e8f0;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 14px;
}

.question-card .question-text code {
    font-family: 'Fira Code', monospace !important;
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-size: 0.88em !important;
}

/* === COLLAPSIBLE TOGGLE / CONTENT ============================ */
.collapsible-toggle {
    display: inline-block;
    padding: 7px 18px;
    background: rgba(168, 85, 247, 0.08);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
    margin-top: 6px;
}

.collapsible-toggle:hover {
    background: rgba(168, 85, 247, 0.18);
    border-color: rgba(168, 85, 247, 0.4);
}

.collapsible-content {
    display: none;
    margin-top: 14px;
    padding: 16px 18px;
    background: rgba(168, 85, 247, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.1);
    color: #cbd5e1;
    line-height: 1.7;
    font-size: 0.95rem;
}

.collapsible-content.is-open {
    display: block;
}

.collapsible-content pre {
    background: #0d1117 !important;
    border: 1px solid rgba(168, 85, 247, 0.15) !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
    margin: 10px 0 4px !important;
}

.collapsible-content pre code {
    background: none !important;
    color: #e6edf3 !important;
    font-family: 'Fira Code', monospace !important;
    font-size: 0.9rem !important;
    padding: 0 !important;
}

.collapsible-content code {
    font-family: 'Fira Code', monospace !important;
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-size: 0.88em !important;
}

/* === MCQ OPTIONS ============================================= */
.mcq-options {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 14px !important;
}

.mcq-options li {
    padding: 10px 16px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: default;
}

.mcq-options li:hover {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.2);
}

.mcq-option-label {
    font-weight: 700;
    color: #a855f7;
    margin-right: 8px;
}

/* === CODING CHALLENGES ======================================= */
.challenge-card {
    background: rgba(6, 182, 212, 0.03);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-left: 4px solid #06b6d4 !important;
    border-radius: 0 12px 12px 0;
    padding: 22px 24px;
    margin-bottom: 22px;
}

.resource-main .challenge-card h3 {
    font-family: 'Syne', sans-serif !important;
    color: #22d3ee !important;
    margin: 0 0 12px !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    border: none !important;
}

.challenge-card .challenge-difficulty {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.challenge-card .challenge-description {
    color: #cbd5e1;
    line-height: 1.65;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.challenge-io {
    margin-bottom: 14px;
}

.challenge-io-label {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.challenge-io-value {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    border-radius: 6px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.challenge-constraints {
    color: #64748b;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 12px;
}

/* === LANGUAGE INDEX: CHAPTER CARDS ============================ */
.chapter-listing {
    margin-bottom: 40px;
}

.resource-main .chapter-listing h2 {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    color: #f1f5f9 !important;
    margin-bottom: 24px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid rgba(168, 85, 247, 0.15) !important;
    text-align: left !important;
}

.chapter-card {
    display: flex !important;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    margin-bottom: 12px;
    text-decoration: none !important;
    transition: all 0.25s;
    /* Kill global card styles */
    box-shadow: none !important;
    overflow: visible !important;
    position: relative !important;
}

.chapter-card:hover {
    background: rgba(168, 85, 247, 0.06) !important;
    border-color: rgba(168, 85, 247, 0.25) !important;
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.08) !important;
}

.chapter-card-number {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: #a855f7;
    min-width: 40px;
    text-align: center;
    line-height: 1;
    padding-top: 2px;
}

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

.chapter-card-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #e2e8f0;
    margin-bottom: 4px;
    line-height: 1.3;
}

.chapter-card-desc {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 6px;
}

.chapter-card-badges {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.chapter-card-badges .badge {
    font-size: 0.68rem !important;
    padding: 2px 8px !important;
}

/* === LANGUAGE CARDS (MASTER INDEX) =========================== */
.language-cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.language-card {
    display: flex !important;
    flex-direction: column;
    padding: 30px 26px;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(168, 85, 247, 0.15) !important;
    border-radius: 14px !important;
    text-decoration: none !important;
    transition: all 0.3s;
    /* Kill global card styles */
    box-shadow: none !important;
    overflow: visible !important;
}

.language-card:hover {
    background: rgba(168, 85, 247, 0.08) !important;
    border-color: rgba(168, 85, 247, 0.4) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15) !important;
}

.language-card-name {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #f1f5f9;
    margin-bottom: 10px;
}

.language-card-desc {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.language-card-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === RESPONSIVE ============================================== */
@media (max-width: 768px) {
    .resource-main {
        padding: 90px 16px 40px !important;
    }

    .resource-main .resource-title {
        font-size: 1.6rem !important;
    }

    .resource-main .content-section h2 {
        font-size: 1.35rem !important;
    }

    .resource-main .content-section h3 {
        font-size: 1.1rem !important;
    }

    .chapter-nav {
        grid-template-columns: 1fr;
    }

    .chapter-nav-card.next {
        grid-column: 1;
        text-align: left;
    }

    .practice-stats-bar {
        flex-direction: column !important;
        gap: 0;
    }

    .practice-stats-bar .stat {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 12px 16px;
    }

    .practice-stats-bar .stat + .stat {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .toc-box {
        padding: 18px 20px !important;
    }

    .language-cards-section {
        grid-template-columns: 1fr;
    }

    .chapter-card {
        flex-direction: column !important;
        gap: 8px;
    }

    .chapter-card-number {
        min-width: auto;
    }

    .resource-main .breadcrumb {
        font-size: 0.78rem !important;
    }

    .code-example-title {
        font-size: 0.85rem;
    }

    .cta-section {
        padding: 24px 16px;
    }

    .cta-button-primary,
    .cta-button-outline {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    .question-card {
        padding: 18px 18px;
    }

    .mistake-card {
        padding: 18px 18px;
    }

    .resource-main .content-section p {
        font-size: 0.95rem !important;
    }

    .resource-main .content-section li {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .resource-main {
        padding: 85px 14px 32px !important;
    }

    .resource-main .resource-title {
        font-size: 1.4rem !important;
    }

    .resource-meta-badges {
        gap: 6px;
    }

    .resource-main .badge {
        font-size: 0.68rem !important;
        padding: 3px 8px !important;
    }

    .practice-stats-bar .stat-count {
        font-size: 1.2rem;
    }

    .code-example-output {
        font-size: 0.8rem;
    }

    .collapsible-toggle {
        font-size: 0.78rem;
        padding: 6px 14px;
    }
}

/* === PRINT STYLES ============================================ */
@media print {
    nav,
    #nav-placeholder,
    #footer-placeholder,
    footer,
    .breadcrumb,
    .chapter-nav,
    .cta-section,
    .practice-link,
    .notes-link,
    .code-copy-btn,
    .collapsible-toggle {
        display: none !important;
    }

    .resource-main {
        padding: 0 !important;
        max-width: 100% !important;
        color: #000 !important;
    }

    .resource-title,
    .content-section h2,
    .content-section h3,
    .content-section h4 {
        color: #000 !important;
    }

    .content-section p,
    .content-section li,
    .summary-box li {
        color: #333 !important;
    }

    .collapsible-content {
        display: block !important;
    }

    .content-section pre {
        background: #f5f5f5 !important;
        border-color: #ccc !important;
    }

    .content-section pre code {
        color: #000 !important;
    }

    .badge {
        border-color: #ccc !important;
        color: #333 !important;
    }

    .toc-box {
        border-color: #ccc !important;
        background: #f9f9f9 !important;
    }
}
