/* ── API Documentation Page ─────────────────────────────── */

.api-hero {
    background: #073476;
    min-height: 200px;
    display: flex;
    align-items: center;
}
.api-hero h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.api-hero p {
    color: rgba(255,255,255,.8);
    font-size: 1rem;
    margin: 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.api-sidebar {
    top: 80px;
    position: sticky;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    border: 1px solid #e2e6ea;
    font-size: .875rem;
}
.api-sidebar h6 {
    font-weight: 700;
    color: #073476;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .7rem;
    margin-bottom: .75rem;
}
.api-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.api-sidebar ul li {
    margin-bottom: .25rem;
}
.api-sidebar ul li a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: .3rem .5rem;
    border-radius: 4px;
    transition: background .15s, color .15s;
    line-height: 1.4;
}
.api-sidebar ul li a:hover,
.api-sidebar ul li a.active {
    background: #e8edf7;
    color: #073476;
    font-weight: 600;
}
.api-sidebar ul li a .method-badge-sm {
    font-size: .6rem;
    background: #198754;
    color: #fff;
    border-radius: 3px;
    padding: 1px 4px;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ── Base URL box ────────────────────────────────────────── */
.api-base-url-box {
    background: #f0f4fc;
    border: 1px solid #c5d3ef;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}
.api-base-url-box .label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #073476;
    margin-bottom: .35rem;
}
.api-base-url-box code {
    font-size: .95rem;
    color: #073476;
    font-weight: 600;
    word-break: break-all;
}

/* ── Language switcher ───────────────────────────────────── */
.api-lang-switcher {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    padding: .6rem 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.api-lang-switcher .lang-label {
    font-size: .75rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-right: .25rem;
}
.api-lang-btn {
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    font-size: .8rem;
    padding: .3rem .75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
    font-weight: 500;
}
.api-lang-btn:hover {
    border-color: #073476;
    color: #073476;
}
.api-lang-btn.active {
    background: #073476;
    border-color: #073476;
    color: #fff;
    font-weight: 700;
}

/* ── Endpoint section ────────────────────────────────────── */
.api-endpoint-section {
    margin-bottom: 3.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
    scroll-margin-top: 80px;
}
.api-endpoint-section:first-of-type {
    border-top: none;
}

.api-endpoint-header {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}
.api-method-badge {
    background: #198754;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .25rem .6rem;
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: 4px;
}
.api-endpoint-path {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #073476;
    word-break: break-all;
}
.api-endpoint-title {
    font-size: .95rem;
    color: #6c757d;
    margin-top: .15rem;
    font-weight: 400;
}
.api-endpoint-desc {
    color: #495057;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-size: .95rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}
.api-table thead th {
    background: #f1f3f5;
    color: #343a40;
    font-weight: 700;
    padding: .5rem .75rem;
    text-align: left;
    border: 1px solid #dee2e6;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.api-table td {
    padding: .5rem .75rem;
    border: 1px solid #dee2e6;
    vertical-align: top;
    color: #495057;
}
.api-table td:first-child {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #c0392b;
    font-size: .85rem;
    white-space: nowrap;
}
.api-table .badge-required {
    background: #dc3545;
    color: #fff;
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
}
.api-table .badge-optional {
    background: #6c757d;
    color: #fff;
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
}
.api-table .type-badge {
    color: #6f42c1;
    font-size: .8rem;
    font-family: 'Courier New', monospace;
}

/* ── Response example ────────────────────────────────────── */
.api-response-block {
    background: #1e2433;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
}
.api-response-block .block-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #adb5bd;
    margin-bottom: .6rem;
}
.api-response-block pre {
    margin: 0;
    font-size: .8rem;
    color: #a8d8a8;
    overflow-x: auto;
    max-height: 320px;
    white-space: pre;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}
.api-response-block .toggle-response {
    position: absolute;
    top: .75rem;
    right: .75rem;
    background: rgba(255,255,255,.1);
    border: none;
    color: #adb5bd;
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.api-response-block .toggle-response:hover {
    background: rgba(255,255,255,.2);
}
.api-response-block pre.collapsed {
    max-height: 80px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* ── Code blocks ─────────────────────────────────────────── */
.api-code-wrapper {
    margin-bottom: 1.5rem;
}
.api-code-block {
    display: none;
    background: #282c34;
    border-radius: 8px;
    overflow: hidden;
}
.api-code-block.visible {
    display: block;
}
.api-code-block .code-header {
    background: #21252b;
    padding: .4rem .9rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #abb2bf;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.api-code-block .copy-btn {
    background: none;
    border: 1px solid #495057;
    color: #abb2bf;
    font-size: .65rem;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all .15s;
}
.api-code-block .copy-btn:hover {
    border-color: #adb5bd;
    color: #fff;
}
.api-code-block .copy-btn.copied {
    border-color: #198754;
    color: #198754;
}
.api-code-block pre {
    margin: 0;
    padding: 1rem 1.25rem;
    font-size: .82rem;
    color: #abb2bf;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    white-space: pre;
}

/* ── Section label ───────────────────────────────────────── */
.api-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #073476;
    margin-bottom: .5rem;
    margin-top: 1.25rem;
}

/* ── Response headers table ──────────────────────────────── */
.api-response-headers {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .85rem;
}
.api-response-headers .resp-hdr {
    display: flex;
    gap: 1rem;
    margin-bottom: .3rem;
    align-items: baseline;
}
.api-response-headers .resp-hdr:last-child {
    margin-bottom: 0;
}
.api-response-headers .resp-hdr code {
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    color: #c0392b;
    font-weight: 600;
    white-space: nowrap;
    min-width: 160px;
}
.api-response-headers .resp-hdr span {
    color: #6c757d;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991px) {
    .api-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
    .api-lang-switcher {
        top: 0;
    }
}
