/* Docs wrapper - full-width two-column layout.
   #880: a flex row with a draggable split. The sidebar width is a custom property so the
   splitter has one thing to move and the whole layout follows it. */
.docs-wrapper {
    --docs-sidebar-w: 17rem;
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 200px);
}

/* Sidebar - sticky, scrollable */
.docs-sidebar {
    flex: 0 0 var(--docs-sidebar-w);
    width: var(--docs-sidebar-w);
    position: sticky;
    top: 0;
    height: calc(100vh - 76px);  /* minus navbar */
    overflow-y: auto;
    border-right: 1px solid #e9ecef;
    padding: 1.5rem 0;
    background: #f8f9fa;
}

/* #880: the splitter itself. A wide hit area, a hairline rule — the border it replaces
   sits on the sidebar, so a plain background here would read as a second line. */
.docs-splitter {
    flex: 0 0 10px;
    align-self: stretch;
    position: sticky;
    top: 0;
    height: calc(100vh - 76px);
    cursor: col-resize;
    background: transparent;
    /* A drag that crosses the code panels must not select their text. */
    user-select: none;
    touch-action: none;
}
.docs-splitter::before {
    content: "";
    display: block;
    width: 3px;
    height: 100%;
    margin: 0 auto;
    border-radius: 3px;
    background: transparent;
    transition: background .15s;
}
.docs-splitter:hover::before,
.docs-splitter:focus-visible::before,
.docs-splitter.is-dragging::before { background: #1a3a5c; }
.docs-splitter:focus-visible { outline: none; }

/* Anything that would put a text cursor on the page while the splitter is being dragged. */
body.docs-resizing { cursor: col-resize; user-select: none; }
.docs-sidebar-inner { padding: 0 1rem; }
.docs-sidebar-header { padding: 0 0.5rem 1rem; }
.docs-sidebar-header h6 { font-size: 0.85rem; color: #1a3a5c; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* Sidebar nav links */
.docs-nav-section { margin-bottom: 0.75rem; }
.docs-nav-category {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.8rem; font-weight: 600; color: #495057;
    padding: 0.4rem 0.5rem; margin-bottom: 0.25rem;
}
.docs-nav-category .badge { font-size: 0.6rem; }
.docs-nav-link {
    display: block; padding: 0.3rem 0.5rem 0.3rem 1.5rem;
    font-size: 0.78rem; color: #6c757d; text-decoration: none;
    border-left: 2px solid transparent; transition: all 0.15s;
}
.docs-nav-link:hover { color: #1a3a5c; background: #e9ecef; }
.docs-nav-link.active { color: #1a3a5c; border-left-color: #1a3a5c; font-weight: 600; background: #e8f0f8; }

/* Sidebar footer */
.docs-sidebar-footer { padding: 1rem 0.5rem; border-top: 1px solid #dee2e6; margin-top: 1rem; }

/* Mobile sidebar toggle */
.docs-sidebar-toggle {
    position: fixed; bottom: 1rem; right: 1rem; z-index: 1050;
    background: #1a3a5c; color: white; border: none; border-radius: 50px;
    padding: 0.5rem 1rem; font-size: 0.85rem; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none;
}
@media (max-width: 991.98px) {
    .docs-sidebar-toggle { display: block; }
    .docs-sidebar {
        position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
        z-index: 1040; transition: left 0.3s ease; background: white;
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    }
    .docs-sidebar.show { left: 0; }
    /* #880: off-canvas sidebar — there is no split to drag, and the content is
       already full width. */
    .docs-splitter { display: none; }
}

/* Main content area.
   #880: was max-width: 900px, which is what made the endpoint column a strip with dead
   space beside it on any wide screen. The cap that remains is a readability bound for
   prose, not a layout constraint, and it is far enough out that a 1080p window fills.
   min-width: 0 is load-bearing: without it a wide code panel or table would refuse to
   shrink and push the flex row past the viewport. */
.docs-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.5rem 2rem;
    max-width: 1600px;
}

/* Docs hero header */
.docs-hero { padding: 1.5rem 0; border-bottom: 1px solid #e9ecef; }
.docs-hero h1 { font-size: 2rem; font-weight: 700; }
.docs-hero .lead { color: #6c757d; }

/* Category cards on index page */
.docs-category-card {
    display: block; padding: 1.25rem; border: 1px solid #dee2e6; border-radius: 8px;
    text-decoration: none; color: inherit; transition: all 0.15s; height: 100%;
}
.docs-category-card:hover { border-color: #1a3a5c; background: #f8faff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); color: inherit; }

/* Section styles */
.docs-section { padding: 1.5rem 0; }
.docs-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }

/* Endpoint sections */
.docs-endpoint-section { padding: 2rem 0 1rem; }
.docs-endpoint-header h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0; }
.docs-endpoint-path { font-size: 0.9rem; padding: 0.2rem 0.5rem; background: #f1f3f5; border-radius: 4px; }

/* Quick jump nav */
.docs-quick-nav { padding: 0.75rem; background: #f8f9fa; border-radius: 8px; }
.docs-quick-nav .badge { cursor: pointer; transition: all 0.15s; text-decoration: none; }
.docs-quick-nav .badge:hover { background: #1a3a5c !important; color: white !important; }

/* Parameter tables */
.docs-param-table { font-size: 0.85rem; }
.docs-param-table th { background: #f8f9fa; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.docs-param-table td { vertical-align: middle; }
.docs-param-table code { font-size: 0.8rem; color: #d63384; }

/* Code panels (dark theme) */
.docs-code-panel {
    border-radius: 8px; overflow: hidden; margin-bottom: 1rem;
    border: 1px solid #313244;
}
.docs-code-header {
    background: #313244; padding: 0.4rem 0.75rem;
    display: flex; justify-content: space-between; align-items: center;
    color: #a6adc8; font-size: 0.75rem;
}
.docs-code-panel pre {
    margin: 0; padding: 1rem; font-size: 0.8rem; line-height: 1.5;
    background: #1e1e2e; color: #cdd6f4; overflow-x: auto; max-height: 400px;
}
.docs-copy-btn {
    background: none; border: 1px solid #585b70; color: #a6adc8;
    padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.7rem; cursor: pointer;
}
.docs-copy-btn:hover { background: #585b70; color: #cdd6f4; }

/* Code example tabs */
.docs-code-tabs .nav-tabs { border-bottom: none; background: #313244; border-radius: 8px 8px 0 0; padding: 0 0.5rem; }
.docs-code-tabs .nav-link { color: #a6adc8; font-size: 0.78rem; border: none; padding: 0.4rem 0.75rem; border-bottom: 2px solid transparent; }
.docs-code-tabs .nav-link:hover { color: #cdd6f4; border-color: transparent; }
.docs-code-tabs .nav-link.active { color: #cdd6f4; background: transparent; border-bottom-color: #89b4fa; }
.docs-code-tabs .tab-content { background: #1e1e2e; border-radius: 0 0 8px 8px; border: 1px solid #313244; border-top: none; }
.docs-code-tabs .tab-pane pre { margin: 0; padding: 1rem; font-size: 0.8rem; line-height: 1.5; color: #cdd6f4; overflow-x: auto; max-height: 400px; background: transparent; }

/* Try in testbed button */
.docs-try-btn { font-size: 0.8rem; }

/* Auth section styles */
.docs-auth-table td, .docs-auth-table th { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.docs-base-url { background: #1e1e2e; color: #89b4fa; padding: 0.75rem 1rem; border-radius: 8px; font-family: monospace; font-size: 0.9rem; }
