/* --- DOCS PAGE --- */
.docs-page { display: flex; flex-direction: column; min-height: 100vh; }

/* --- SIDEBAR --- */
.docs-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.docs-sidebar .sidebar-section { margin-bottom: 4px; }

.docs-sidebar .sidebar-label {
    display: block;
    padding: 10px 20px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--accent);
    user-select: none;
}

.docs-sidebar a {
    display: block;
    padding: 4px 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-left: 2px solid transparent;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.6;
}

.docs-sidebar a:hover {
    color: var(--text);
    background: rgba(249, 115, 22, 0.04);
    border-left-color: rgba(249, 115, 22, 0.3);
}

.docs-sidebar a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-glow);
    font-weight: 600;
}

.docs-sidebar .sub-links a {
    padding-left: 36px;
    font-size: 0.78rem;
}

/* Collapsible channel list */
.docs-sidebar details { margin: 0; }
.docs-sidebar details summary {
    display: block;
    padding: 4px 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    list-style: none;
    user-select: none;
}
.docs-sidebar details summary::-webkit-details-marker { display: none; }
.docs-sidebar details summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.2s ease;
    font-size: 0.65rem;
    color: var(--text-muted);
}
.docs-sidebar details[open] summary::before { transform: rotate(90deg); color: var(--accent); }
.docs-sidebar details summary:hover {
    color: var(--text);
    background: rgba(249, 115, 22, 0.04);
}

/* --- OVERLAY (mobile) --- */
.docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 40;
}
.docs-overlay.open { display: block; }

/* --- HAMBURGER --- */
.docs-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
}
.docs-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.2s;
}

/* --- MAIN CONTENT --- */
.docs-content {
    margin-left: 260px;
    padding: 36px 56px 60px;
    max-width: none;
    margin-right: 40px;
    min-height: 100vh;
}

.docs-content section {
    scroll-margin-top: 76px;
    margin-bottom: 48px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border);
}
.docs-content section:last-child { border-bottom: none; }

.docs-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.3px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(249, 115, 22, 0.15);
}

.docs-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--text);
    scroll-margin-top: 76px;
}

.docs-content h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--text);
    scroll-margin-top: 76px;
}

.docs-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.75;
    margin-bottom: 12px;
}

.docs-content strong { color: var(--text); }

.docs-content ul, .docs-content ol {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.75;
    margin: 8px 0 16px 20px;
}

.docs-content li { margin-bottom: 4px; }
.docs-content li code { font-size: 0.8rem; }

/* --- CODE BLOCKS --- */
.docs-content .code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0 20px;
    transition: border-color 0.2s;
}

.docs-content .code-block:hover {
    border-color: rgba(255,255,255,0.06);
}

.docs-content .code-header {
    background: var(--bg3);
    padding: 6px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
}

.docs-content pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-content pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text);
}

/* Override Prism theme to match our dark theme */
.docs-content pre[class*="language-"],
.docs-content code[class*="language-"] {
    background: none;
    text-shadow: none;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.65;
}

/* Inline code */
.docs-content p code,
.docs-content li code,
.docs-content td code {
    background: var(--code-bg);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent);
    border: 1px solid rgba(30,41,59,0.8);
}

/* --- TABLES --- */
.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    font-size: 0.84rem;
}

.docs-content th {
    text-align: left;
    padding: 8px 14px;
    background: var(--bg3);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.docs-content td {
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}

.docs-content tr:hover td { background: rgba(249, 115, 22, 0.02); }

/* --- CALLOUT BOXES --- */
.callout {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.86rem;
    line-height: 1.65;
    border-left: 3px solid;
}

.callout-tip {
    background: rgba(249, 115, 22, 0.06);
    border-color: var(--accent);
    color: var(--text-muted);
}
.callout-tip strong { color: var(--accent); }

.callout-info {
    background: rgba(59, 130, 246, 0.06);
    border-color: #3b82f6;
    color: var(--text-muted);
}
.callout-info strong { color: #60a5fa; }

.callout-warning {
    background: rgba(239, 68, 68, 0.06);
    border-color: #ef4444;
    color: var(--text-muted);
}
.callout-warning strong { color: #f87171; }

/* --- CHANNEL CARD in docs --- */
.ch-doc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 12px;
    scroll-margin-top: 76px;
}
.ch-doc-header img, .ch-doc-header svg { flex-shrink: 0; }
.ch-doc-header h3 { margin: 0; }

/* --- NAV DOCS LINK --- */
.nav-docs {
    background: var(--accent) !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}
.nav-docs:hover {
    background: var(--accent2) !important;
    color: #fff !important;
}

/* --- COPY BUTTON --- */
.code-block {
    position: relative;
}

.code-copy-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    z-index: 2;
    font-family: inherit;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.code-block:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.code-copy-btn.copied {
    opacity: 1;
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

/* --- BACK TO TOP --- */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #ea580c);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s, box-shadow 0.15s;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.45);
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* --- GETTING STARTED TABS --- */
.getting-started-tabs { display: flex; gap: 6px; margin: 20px 0; }
.gs-tab {
    padding: 8px 20px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); border-radius: 8px;
    cursor: pointer; font-size: 0.88rem; transition: all 0.2s;
}
.gs-tab:hover { border-color: var(--accent); color: var(--text); background: rgba(249,115,22,0.04); }
.gs-tab.active {
    background: linear-gradient(135deg, var(--accent), #ea580c);
    color: #fff; border-color: var(--accent); font-weight: 600;
}
.gs-panel { display: none; }
.gs-panel.active { display: block; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .docs-menu-toggle { display: flex; }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 60;
    }
    .docs-sidebar.open { transform: translateX(0); }

    .docs-content {
        margin-left: 0;
        padding: 28px 20px 40px;
        margin-right: 0;
    }

    .nav-links a:not(.nav-gh):not(.nav-docs) { display: none; }
}

@media (max-width: 600px) {
    .docs-content {
        padding: 20px 14px 32px;
    }
    .docs-content h2 { font-size: 1.35rem; }
    .docs-content h3 { font-size: 1rem; }
    .docs-sidebar { width: min(260px, 85vw); }
}
