/* --- Documentation Layout --- */
body.docs-page {
    background-color: var(--bg-void);
    overflow-x: hidden;
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    padding-top: var(--header-h);
}

/* --- Sidebar --- */
.docs-sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-dim);
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 30px 20px;
    z-index: 10;
}

.sidebar-group {
    margin-bottom: 30px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-left: 10px;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: #aaa;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.sidebar-link.active {
    color: var(--accent-primary);
    background: rgba(0, 255, 157, 0.05);
    border-left-color: var(--accent-primary);
}

/* --- Main Content --- */
.docs-content {
    grid-column: 2;
    padding: 60px 80px;
    max-width: 1000px;
}

.doc-section {
    margin-bottom: 80px;
    scroll-margin-top: 100px; /* For sticky header offset */
}

.doc-header {
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.doc-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.doc-desc {
    color: #888;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- Method Badges --- */
.method-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.8rem;
    margin-right: 10px;
}

.method-post { background: rgba(0, 255, 157, 0.15); color: var(--accent-primary); border: 1px solid var(--accent-primary); }
.method-get { background: rgba(0, 184, 255, 0.15); color: var(--accent-secondary); border: 1px solid var(--accent-secondary); }

/* --- Endpoint Box --- */
.endpoint-display {
    background: #000;
    border: 1px solid var(--border-light);
    padding: 15px;
    border-radius: 6px;
    font-family: var(--font-mono);
    color: #fff;
    display: flex;
    align-items: center;
    margin: 20px 0;
    font-size: 0.95rem;
}

.endpoint-url {
    color: #aaa;
    margin-left: 10px;
}

/* --- Parameters Table --- */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.9rem;
}

.params-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    color: #666;
    font-family: var(--font-mono);
    font-weight: normal;
}

.params-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-dim);
    color: #ccc;
    vertical-align: top;
}

.param-name {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
}

.param-type {
    font-family: var(--font-mono);
    color: #666;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.param-req {
    color: var(--accent-alert);
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* --- Code Block --- */
.code-block-container {
    background: #080808;
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.code-header {
    background: rgba(255,255,255,0.03);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lang-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #666;
}

.copy-action {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.copy-action:hover { color: #fff; }
.copy-action.copied {
    color: var(--accent-primary);
}
.copy-action.copied::after {
    content: '✓';
    margin-left: 5px;
}

.code-content {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #ccc;
    overflow-x: auto;
    line-height: 1.6;
}

/* --- Mobile Menu Toggle --- */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 44px;
    height: 44px;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #ccc;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.docs-sidebar.active {
    transform: translateX(0);
}

/* --- Code Tabs --- */
.code-tabs {
    margin: 30px 0;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    color: #666;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #aaa;
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Error Table --- */
.error-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.error-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    color: #666;
    font-family: var(--font-mono);
}

.error-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-dim);
    color: #ccc;
    vertical-align: top;
}

.error-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Tech Card --- */
.tech-card {
    background: rgba(0,255,157,0.02);
    border: 1px solid rgba(0,255,157,0.1);
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 30px;
}

.tech-card h3 {
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.tech-card p {
    color: #ccc;
    font-size: 0.95rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .docs-layout { grid-template-columns: 1fr; }
    .mobile-menu-toggle {
        display: flex;
    }
    .docs-sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        width: 280px;
        height: calc(100vh - var(--header-h));
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        display: block;
    }
    .docs-sidebar.active {
        transform: translateX(0);
    }
    .docs-content { padding: 40px 20px; }
}