:root {
    --bg-color: #0a0a0a;
    --panel-bg: #111111;
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --accent: #eb5e28;
    --accent-hover: #ff723b;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-navbar {
    height: 64px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--panel-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
    gap: 16px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Sidebar toggle button (matches team sidebar style) */
.docs-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.docs-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.docs-sidebar-toggle svg {
    width: 18px;
    height: 18px;
}


.top-navbar .logo {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.top-navbar .logo span {
    color: var(--accent);
    font-weight: 700;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: cover;
}

.nav-links-container {
    font-size: 0.85rem;
    display: flex;
    gap: 20px;
    font-weight: 500;
}

.nav-links-container .home-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links-container .home-link:hover {
    color: var(--text-main);
}

.nav-links-container .docs-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
}

.nav-links-container .docs-link:hover {
    color: var(--accent-hover);
}

.layout-container {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    width: 100%;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    background: var(--panel-bg);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.28s ease;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

/* Header */
.sidebar-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--panel-border);
    flex-shrink: 0;
}

.sidebar-header-link {
    text-decoration: none;
    display: block;
}

.topic-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.sidebar-header-link:hover .topic-title {
    color: var(--accent);
}

.topic-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.topic-meta-icon {
    color: var(--accent);
    opacity: 0.8;
}

/* Nav content area */
.sidebar-content {
    padding: 8px 0 24px;
    flex: 1;
}

/* ── Section group ── */
.nav-section {
    margin-bottom: 2px;
}

/* Clickable section heading */
.nav-section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.15s, color 0.15s;
    position: relative;
    border-left: 3px solid transparent;
    overflow: hidden;
}

.nav-section-link:hover {
    background: rgba(255,255,255,0.04);
    color: #fff;
}

.nav-section-link.active {
    background: rgba(235, 94, 40, 0.08);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-section-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s;
}
.nav-section-link:hover .nav-section-icon { color: #fff; }
.nav-section-link.active .nav-section-icon { color: var(--accent); }

/* Nested pages under a section */
.nav-links.nested {
    position: relative;
    padding-left: 20px;
    margin-bottom: 4px;
}

.nav-links.nested::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--panel-border);
}

/* Generic nav-link (nested pages and standalone pages) */
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Nested page – extra left offset so it clears the track line */
.nav-links.nested .nav-link {
    padding-left: 20px;
    font-size: 0.82rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-main);
}

.nav-link.active {
    background: rgba(235, 94, 40, 0.08);
    color: var(--accent);
    font-weight: 500;
    border-left-color: var(--accent);
}

/* Standalone page (no section parent) - same as regular nav-link but slightly bigger */
.nav-link.standalone {
    padding: 7px 16px 7px 20px;
    font-size: 0.875rem;
}

.nav-link.empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    pointer-events: none;
}

/* Sidebar divider between sections */
.nav-section + .nav-section {
    border-top: none;
}

.nav-section-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Divider line between top-level items and sections */
.sidebar-content > .nav-section:first-child,
.sidebar-content > .nav-link:first-child {
    margin-top: 4px;
}

/* Main Content Styling */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 40px 60px;
    max-width: 1000px;
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Collapsed sidebar state ─── */
body.docs-sidebar-collapsed .sidebar {
    transform: translateX(-260px);
}

body.docs-sidebar-collapsed .main-content {
    margin-left: 0;
}

/* ─── Mobile Overlay ─── */
.docs-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.docs-sidebar-overlay.visible {
    opacity: 1;
}

.page-header {
    margin-bottom: 32px;
}

.page-header.flex-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-header-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
}

.page-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
}

.page-header-icon.large-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    margin-bottom: 0;
    border-radius: 16px;
}

.page-header-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-title-container {
    flex: 1;
}

.page-title-banner {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.page-title-banner.margin-small {
    margin-bottom: 8px;
}

.page-description {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 800px;
}

.page-description.topic-desc {
    margin: 0;
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    max-width: 100%;
}

.meta-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-tag svg {
    width: 12px;
    height: 12px;
    color: var(--accent);
}

/* Content Blocks */
.content-sections {
    margin-top: 48px;
    border-top: 1px solid var(--panel-border);
    padding-top: 32px;
}

.section-container {
    margin-bottom: 40px;
}

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

.section-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border: 1px solid var(--panel-border);
}

.section-title {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
}

.section-content-wrapper {
    margin-bottom: 16px;
    padding-left: 40px;
}

.section-pages-list {
    margin-left: 13.5px;
    border-left: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

.section-page-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 24px;
    text-decoration: none;
    transition: all 0.2s;
    color: var(--text-main);
}

.section-page-link:hover {
    background: rgba(255,255,255,0.02);
    box-shadow: inset 2px 0 0 0 var(--accent);
}

.section-page-link svg {
    color: var(--text-muted);
}

.section-page-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.section-pages-empty {
    padding: 12px 16px 12px 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ─── Section index (the "In this section" list on section pages) ─── */
.section-index-list {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--panel-border);
}

.section-index-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.section-index-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    margin-bottom: 6px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.section-index-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(235, 94, 40, 0.3);
    transform: translateX(2px);
}

.section-index-card svg:first-child {
    color: var(--accent);
    opacity: 0.8;
    flex-shrink: 0;
}

.section-index-card span {
    flex: 1;
}

.section-index-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
}

.section-index-card:hover .section-index-arrow {
    opacity: 1;
    transform: translateX(0);
}

.section-index-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
}

.content-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.content-card.empty-state {
    text-align: center;
    padding: 64px 32px;
}

.content-card.empty-state svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.content-card.transparent-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.empty-content-box {
    text-align: center;
    padding: 64px 32px;
    border: 1px dashed var(--panel-border);
    border-radius: 12px;
    margin-top: 16px;
}

.empty-content-box svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-content-box h3 {
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-content-box p {
    color: var(--text-muted);
    margin: 0;
}

a.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: var(--accent);
}

.content-card h2, .content-card h3 {
    font-size: 1.3rem;
    margin: 0 0 12px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Breadcrumb */
.breadcrumb-container {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-link {
    color: var(--accent);
    text-decoration: none;
}

.page-header-bottom-border {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 16px;
}

.page-title-banner.margin-none {
    margin-bottom: 0;
}

/* Page Navigation Footer */
.page-navigation-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-prev-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    text-decoration: none;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.page-prev-btn:hover {
    background: rgba(255,255,255,0.1);
}

.page-last-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.page-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #000;
    text-decoration: none;
    background: var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.page-next-btn:hover {
    opacity: 0.9;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 32px 40px;
    }
}

@media (max-width: 768px) {
    /* On mobile, sidebar is off-screen by default (collapsed) */
    .sidebar {
        transform: translateX(-260px);
        z-index: 60;
    }

    /* When NOT collapsed on mobile, slide in and show overlay */
    body:not(.docs-sidebar-collapsed) .sidebar {
        transform: translateX(0);
    }

    body:not(.docs-sidebar-collapsed) .docs-sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        padding: 24px 20px;
    }

    body.docs-sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .page-title-banner {
        font-size: 1.8rem;
    }

    .page-navigation-footer {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .top-navbar {
        padding: 0 16px;
    }

    .main-content {
        padding: 20px 16px;
    }

    .page-title-banner {
        font-size: 1.5rem;
    }

    .meta-tags {
        gap: 6px;
    }

    .page-navigation-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Typography for user HTML content */
.user-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
}
.user-content h1, .user-content h2, .user-content h3, .user-content h4 {
    color: #f8fafc;
}
.user-content h1 {
    font-size: 1.8rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
}
.user-content h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}
.user-content h3 {
    font-size: 1.25rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}
.user-content h4 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.user-content p {
    margin-bottom: 1rem;
    color: #cbd5e1;
}
.user-content a {
    color: var(--accent);
    text-decoration: none;
}
.user-content a:hover {
    text-decoration: underline;
}
.user-content pre {
    background: rgba(0,0,0,0.4);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--panel-border);
    font-size: 0.9rem;
}
.user-content code {
    font-family: monospace;
    background: rgba(0,0,0,0.4);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}
.user-content pre code {
    background: transparent;
    padding: 0;
    font-size: 1em;
}
.user-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.2rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 0 6px 6px 0;
    font-size: 0.95rem;
}
.user-content ul, .user-content ol {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 0.95rem;
}
.user-content li {
    margin-bottom: 0.4rem;
}
.user-content img {
    max-width: 100%;
    border-radius: 6px;
}

/* -----------------------------------------------------------------
   HTML Sandbox Widget  (public-facing, W3Schools-style)
   ----------------------------------------------------------------- */
.bbx-sandbox-widget {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 28px 0;
    background: #0e1117;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    font-family: 'Outfit', system-ui, sans-serif;
    position: relative;
}
.bbx-sw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 8px 0 0;
    flex-shrink: 0;
}
.bbx-sw-tabs { display: flex; }
.bbx-sw-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
    font-family: inherit;
    letter-spacing: 0.03em;
}
.bbx-sw-tab:hover { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.04); }
.bbx-sw-tab.active { color: #facc15; border-bottom-color: #facc15; background: rgba(234,179,8,0.06); }
.bbx-sw-controls { display: flex; align-items: center; gap: 6px; }
.bbx-sw-run-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(234,179,8,0.15);
    color: #facc15;
    border: 1px solid rgba(234,179,8,0.3);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    font-family: inherit;
    letter-spacing: 0.04em;
}
.bbx-sw-run-btn:hover { background: rgba(234,179,8,0.28); border-color: rgba(234,179,8,0.5); }
.bbx-sw-run-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.bbx-sw-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.bbx-sw-fullscreen-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.bbx-sw-fullscreen-btn svg { width: 14px; height: 14px; }
.bbx-sw-split { display: flex; height: 360px; }
.bbx-sw-code-side {
    width: 50%;
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bbx-sw-pane { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.bbx-sw-pane.active { display: flex; }
.bbx-sw-textarea {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    background: #0e1117;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.75;
    padding: 16px;
    tab-size: 2;
    overflow-y: auto;
    caret-color: #facc15;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.bbx-sw-textarea::selection { background: rgba(234,179,8,0.25); }
.bbx-sw-textarea::-webkit-scrollbar { width: 4px; }
.bbx-sw-textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.bbx-sw-preview-side { width: 50%; display: flex; flex-direction: column; overflow: hidden; }
.bbx-sw-preview-bar {
    padding: 7px 14px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.74rem;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.bbx-sw-preview-frame { flex: 1; border: none; background: #ffffff; width: 100%; }
.bbx-sandbox-widget.bbx-sw-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}
.bbx-sandbox-widget.bbx-sw-fullscreen .bbx-sw-split { flex: 1; height: auto; }
body.bbx-sw-no-scroll { overflow: hidden; }
@media (max-width: 640px) {
    .bbx-sw-split { flex-direction: column; height: auto; }
    .bbx-sw-code-side { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); height: 200px; }
    .bbx-sw-preview-side { width: 100%; height: 240px; }
}
