/* ===== Docs Layout ===== */
.docs-page {
    padding-top: 60px;
}

.docs-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ===== Sidebar ===== */
.docs-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
}

.docs-sidebar-inner {
    padding: 24px 0 48px;
}

.docs-home-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    color: var(--text);
}

.docs-home-link .logo-icon {
    color: var(--primary);
}

.docs-nav {
    padding: 0 16px;
}

.docs-nav-section {
    margin-bottom: 24px;
}

.docs-nav-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 6px;
}

.docs-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav li {
    margin: 2px 0;
}

.docs-nav a {
    display: block;
    padding: 7px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all var(--transition);
}

.docs-nav a:hover {
    color: var(--text);
    background: var(--surface);
}

.docs-nav a.active {
    color: var(--primary);
    background: rgba(91, 61, 228, 0.08);
    font-weight: 600;
}

/* ===== Main Content ===== */
.docs-main {
    flex: 1;
    min-width: 0;
}

.docs-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 48px 96px;
}

.docs-content h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* ===== API Intro / Index ===== */
.api-intro {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.api-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.api-version {
    display: inline-block;
    background: rgba(91, 61, 228, 0.1);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.05em;
}

.api-baseurl {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--surface);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.api-toc h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.api-toc ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}

.api-toc li {
    margin: 4px 0;
}

.api-toc a {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.api-toc a:hover {
    text-decoration: underline;
}

/* ===== Endpoint blocks ===== */
.endpoint {
    margin-bottom: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.endpoint-anchor {
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.endpoint:hover .endpoint-anchor {
    opacity: 1;
}

.method-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.method-get    { background: #dcfce7; color: #15803d; }
.method-post   { background: #dbeafe; color: #1d4ed8; }
.method-put    { background: #fef9c3; color: #854d0e; }
.method-patch  { background: #fef3c7; color: #92400e; }
.method-delete { background: #fee2e2; color: #b91c1c; }
.method-head,
.method-other  { background: var(--surface); color: var(--text-muted); }

.endpoint-path code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text);
    background: none;
    padding: 0;
}

.deprecated-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.endpoint-body {
    padding: 20px 24px;
}

.endpoint-summary {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.endpoint-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.endpoint-desc p {
    margin: 0 0 8px;
}

.endpoint-desc code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ===== Endpoint sections (params / body / responses) ===== */
.endpoint-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.endpoint-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ===== Schema tables ===== */
.schema-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.schema-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.schema-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.schema-table tr.indent-1 td:first-child code {
    margin-left: 16px;
}

.schema-table tr.indent-2 td:first-child code {
    margin-left: 32px;
}

.schema-table tr.indent-1 td,
.schema-table tr.indent-2 td {
    color: var(--text-muted);
}

.schema-table td code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text);
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.docs-last-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.enum-values {
    margin-top: 6px;
    font-size: 0.8em;
    line-height: 1.8;
    color: var(--text-muted);
}

.enum-values code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.type-label {
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: var(--accent);
    white-space: normal;
    word-break: break-word;
}

.req-required {
    font-size: 0.72rem;
    font-weight: 600;
    color: #b91c1c;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.req-optional {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

code.example {
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: var(--primary);
    background: rgba(91, 61, 228, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

/* ===== Responses ===== */
.response-block {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    border: 1px solid var(--border);
}

.status-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    margin-right: 10px;
}

.status-2xx { background: #dcfce7; color: #15803d; }
.status-3xx { background: #dbeafe; color: #1d4ed8; }
.status-4xx { background: #fef3c7; color: #92400e; }
.status-5xx { background: #fee2e2; color: #b91c1c; }

.response-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.response-block .schema-table {
    margin-top: 12px;
}

/* ===== Schemas page ===== */
.schema-block {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.schema-block:last-child {
    border-bottom: none;
}

.schema-block h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.schema-block h3 a {
    color: var(--text);
    text-decoration: none;
}

.schema-block h3 a:hover {
    color: var(--primary);
}

.schema-block > p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* ===== Tag description ===== */
.tag-description {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .docs-sidebar {
        display: none;
    }

    .docs-content {
        padding: 24px 20px 64px;
    }
}
