/* ========================================
   Reset and Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e4fbf;
    --primary-dark: #123b92;
    --primary-light: #4a7de0;
    --secondary-color: #0e7490;
    --accent-color: #89b4ff;
    --text-primary: #11203a;
    --text-secondary: #40536f;
    --text-light: #667b98;
    --bg-primary: #f4f7fd;
    --bg-secondary: #e9f0fb;
    --bg-tertiary: #d9e5f7;
    --surface-strong: #0f1c33;
    --border-color: rgba(24, 52, 99, 0.12);
    --sidebar-bg: #0f1c33;
    --sidebar-text: #c8d8f2;
    --sidebar-hover: #1c3055;
    --code-bg: #12213b;
    --code-text: #edf4ff;
    --shadow-sm: 0 10px 30px rgba(15, 28, 51, 0.06);
    --shadow-md: 0 18px 50px rgba(15, 28, 51, 0.10);
    --shadow-lg: 0 28px 80px rgba(15, 28, 51, 0.16);
}

body {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, rgba(137, 180, 255, 0.25), transparent 26%),
        radial-gradient(circle at top right, rgba(30, 79, 191, 0.16), transparent 22%),
        linear-gradient(180deg, #f6f9ff 0%, #edf3fc 54%, #e6eef9 100%);
    min-height: 100vh;
    position: relative;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1rem 2rem;
    background: rgba(244, 247, 253, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(24, 52, 99, 0.08);
}

.brand-lockup {
    display: flex;
    align-items: center;
}

.brand-home {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
}

.brand-mark {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 28, 51, 0.18);
    border: 1px solid rgba(137, 180, 255, 0.22);
    background: rgba(255, 255, 255, 0.5);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-kicker {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-light);
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.page-nav {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.page-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    font-weight: 500;
}

.page-nav a:hover,
.page-nav a.is-active {
    background: rgba(30, 79, 191, 0.08);
    border-color: rgba(30, 79, 191, 0.18);
    color: var(--primary-dark);
}

/* ========================================
   Main Content Area
   ======================================== */
.content {
    width: min(1320px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 2.2rem 0 4rem;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    background:
        linear-gradient(135deg, rgba(11, 24, 49, 0.98) 0%, rgba(24, 52, 99, 0.97) 100%),
        linear-gradient(135deg, rgba(137, 180, 255, 0.12), rgba(14, 116, 144, 0.1));
    color: #eff5ff;
    padding: 2.6rem;
    border-radius: 24px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.hero-eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(239, 245, 255, 0.72);
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: clamp(2.8rem, 5vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.06em;
    line-height: 0.96;
}

.subtitle {
    font-size: 1.12rem;
    color: rgba(239, 245, 255, 0.8);
    margin-bottom: 1.8rem;
    font-weight: 400;
    max-width: 58ch;
}

.metric-strip {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.metric-card {
    min-width: 165px;
    padding: 1rem 1.1rem;
    background: rgba(239, 245, 255, 0.07);
    border: 1px solid rgba(239, 245, 255, 0.14);
    border-radius: 14px;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #eff5ff;
    margin-bottom: 0.35rem;
}

.metric-label {
    display: block;
    font-size: 0.82rem;
    color: rgba(239, 245, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-aside {
    display: flex;
}

.signal-card {
    align-self: stretch;
    width: 100%;
    background: linear-gradient(180deg, rgba(239, 245, 255, 0.09), rgba(239, 245, 255, 0.04));
    border: 1px solid rgba(239, 245, 255, 0.14);
    border-radius: 18px;
    padding: 1.5rem;
}

.signal-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.signal-card p {
    color: rgba(239, 245, 255, 0.84);
    margin-bottom: 1rem;
}

.signal-list {
    list-style: none;
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
}

.signal-list li {
    position: relative;
    padding-left: 1rem;
    color: rgba(239, 245, 255, 0.8);
}

.signal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62rem;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: var(--accent-color);
}

/* ========================================
   Sections
   ======================================== */
.section {
    background: rgba(244, 247, 253, 0.86);
    backdrop-filter: blur(8px);
    padding: 3rem;
    margin-bottom: 2rem;
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-dashboard {
    background: linear-gradient(180deg, rgba(244, 247, 253, 0.95), rgba(232, 240, 251, 0.96));
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.section-kicker {
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--primary-color);
}

.section-intro {
    max-width: 44ch;
    margin: 0;
}

.dashboard-status {
    padding: 0.95rem 1.2rem;
    background: var(--surface-strong);
    color: #e8f1ff;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.dashboard-frame {
    margin: 1.5rem auto 0;
    max-width: 1100px;
    min-height: 160px;
}

.section h2 {
    font-size: clamp(2rem, 3.6vw, 3rem);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.section h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.section h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.section h5 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.section p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.7;
}

.section ul {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.section li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* ========================================
   Code Styling
   ======================================== */
code {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    background-color: rgba(30, 79, 191, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--primary-dark);
    font-weight: 500;
}

pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #334155;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: var(--code-text);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ========================================
   Info Boxes
   ======================================== */
.info-box {
    background: rgba(137, 180, 255, 0.12);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.info-box h3 {
    margin-top: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-box ul {
    margin: 0.5rem 0 0 1.25rem;
}

.info-box li {
    margin-bottom: 0.75rem;
}

/* ========================================
   Diagram Boxes
   ======================================== */
.diagram-box {
    background: linear-gradient(135deg, rgba(14, 45, 110, 0.04) 0%, rgba(137, 180, 255, 0.12) 100%);
    border: 1px solid rgba(30, 79, 191, 0.18);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 18px;
}

.diagram-box h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.diagram-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.diagram-box ul {
    margin-left: 1.5rem;
}

/* ========================================
   Workflow Steps
   ======================================== */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.workflow-step {
    display: flex;
    gap: 1.5rem;
    align-items: start;
}

.step-number {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h5 {
    margin-top: 0.25rem;
    color: var(--text-primary);
}

.step-content p {
    margin-bottom: 0;
}

/* ========================================
   Tables
   ======================================== */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.components-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    font-size: 0.9375rem;
}

.components-table thead {
    background-color: var(--surface-strong);
    color: #f4ebdf;
}

.components-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.components-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    line-height: 1.6;
}

.components-table tbody tr:hover {
    background-color: rgba(30, 79, 191, 0.05);
}

.components-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Stack Layers
   ======================================== */
.stack-layer {
    background-color: rgba(244, 247, 253, 0.92);
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    border-radius: 14px;
    border-left: 4px solid var(--secondary-color);
    border: 1px solid rgba(14, 116, 144, 0.12);
}

.stack-layer h3 {
    margin-top: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.stack-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stack-item {
    background-color: rgba(252, 254, 255, 0.92);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* ========================================
   Loop Cards
   ======================================== */
.loops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.loop-card {
    background: linear-gradient(180deg, rgba(252, 254, 255, 0.96) 0%, rgba(233, 240, 251, 0.9) 100%);
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid rgba(82, 62, 45, 0.12);
    transition: all 0.3s ease;
}

.loop-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(30, 79, 191, 0.25);
}

.loop-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.loop-frequency {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loop-card p:last-child {
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* ========================================
   Deployment Grid
   ======================================== */
.deployment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.deployment-card {
    background: rgba(252, 254, 255, 0.94);
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid rgba(82, 62, 45, 0.12);
    transition: all 0.3s ease;
    text-align: center;
}

.deployment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(14, 116, 144, 0.25);
}

.deployment-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.deployment-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.deployment-card code {
    display: inline-block;
    margin-top: 0.5rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background-color: var(--surface-strong);
    color: #cfddf7;
    padding: 3rem;
    margin-top: 4rem;
    border-radius: 22px;
    text-align: center;
}

.footer p {
    margin-bottom: 1rem;
    color: var(--sidebar-text);
}

.footer-links {
    margin-top: 1.5rem;
}

.footer-links a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .content {
        width: min(100% - 2rem, 1320px);
        padding: 1.75rem 0 3rem;
    }

    .hero-grid,
    .section-heading {
        grid-template-columns: 1fr;
        display: grid;
    }

    .hero h1 {
        font-size: 2.6rem;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: start;
        padding: 1rem 1rem 0.85rem;
    }

    .brand-mark {
        width: 50px;
        height: 50px;
    }

    .content {
        width: min(100% - 1rem, 1320px);
        padding: 1rem 0 2.4rem;
    }

    .hero {
        padding: 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.125rem;
    }

    .section {
        padding: 2rem 1.5rem;
    }

    .section h2 {
        font-size: 1.75rem;
    }

    .page-nav {
        gap: 0.4rem;
    }

    .page-nav a {
        font-size: 0.82rem;
        padding: 0.45rem 0.7rem;
    }

    .metric-card,
    .signal-card {
        width: 100%;
    }

    .table-wrapper {
        font-size: 0.875rem;
    }
    
    .components-table th,
    .components-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ========================================
   Interactive Architecture Diagram
   ======================================== */
.interactive-diagram {
    position: relative;
}

.architecture-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
    margin: 2rem 0;
}

.arch-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.arch-node:hover {
    transform: scale(1.1);
}

.validator-node {
    z-index: 10;
}

.node-icon {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: rgba(252, 254, 255, 0.96);
    width: 82px;
    height: 82px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 79, 191, 0.3);
}

.miner-node .node-icon {
    border-color: rgba(14, 116, 144, 0.32);
    width: 66px;
    height: 66px;
    font-size: 1rem;
}

.node-label {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.pulse-ring {
    position: absolute;
    width: 82px;
    height: 82px;
    border: 1px solid rgba(30, 79, 191, 0.45);
    border-radius: 18px;
    animation: pulse 2s ease-out infinite;
}

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

.arch-miners {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.arch-connections {
    width: 100%;
    height: 100px;
    position: relative;
}

.connection-line {
    width: 100%;
    height: 100%;
}

/* Tooltip */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--sidebar-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-md);
}

/* ========================================
   Interactive Loop Tabs
   ======================================== */
.loop-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem 0 0;
    border-bottom: 1px solid rgba(24, 52, 99, 0.14);
}

.loop-tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.loop-tab:hover {
    color: var(--primary-color);
    background-color: rgba(30, 79, 191, 0.06);
}

.loop-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.loop-content-panels {
    position: relative;
}

.loop-panel {
    display: none;
    padding: 2rem;
    background-color: rgba(252, 254, 255, 0.86);
    border-radius: 0 0 18px 18px;
    animation: fadeIn 0.3s ease;
}

.loop-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loop-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(244, 247, 253, 0.98) 0%, rgba(217, 229, 247, 0.72) 100%);
    border-radius: 16px;
    min-width: 150px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
}

/* ========================================
   Interactive Timeline
   ======================================== */
.interactive-timeline {
    margin: 2rem 0;
}

.timeline-progress {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    filter: blur(10px);
}

.workflow-steps-interactive {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.workflow-step-interactive {
    display: flex;
    gap: 1.5rem;
    align-items: start;
    padding: 1.5rem;
    background-color: rgba(252, 254, 255, 0.92);
    border-radius: 18px;
    border: 1px solid rgba(82, 62, 45, 0.12);
    transition: all 0.4s ease;
    opacity: 0.6;
}

.workflow-step-interactive.active {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 18px 40px rgba(30, 79, 191, 0.12);
    transform: translateY(-2px);
}

.step-number-interactive {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.step-content-interactive {
    flex: 1;
}

.step-content-interactive h5 {
    margin: 0.25rem 0 0.5rem;
    color: var(--text-primary);
}

.step-content-interactive p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.step-time {
    display: inline-block;
    background-color: var(--bg-tertiary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-play-btn {
    display: block;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.timeline-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.timeline-play-btn:active {
    transform: translateY(0);
}

/* ========================================
   Component Filter
   ======================================== */
.component-filter {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background-color: rgba(252, 254, 255, 0.92);
    border: 1px solid rgba(82, 62, 45, 0.12);
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.component-row {
    transition: all 0.3s ease;
}

.component-row.filtered {
    display: none;
}

/* ========================================
   Code Block Header
   ======================================== */
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-strong);
    padding: 1rem 1.5rem;
    border-radius: 16px 16px 0 0;
    color: #f4ebdf;
    font-weight: 600;
}

.code-actions {
    display: flex;
    gap: 0.75rem;
}

.expand-all-btn,
.collapse-all-btn {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-all-btn:hover,
.collapse-all-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.expandable-code {
    margin-top: 0;
    border-radius: 0 0 8px 8px;
}

/* ========================================
   Scrollbar Styling
   ======================================== */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

