/* ── API Documentation Layout ─────────────────────────────────────────────── */

.api-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.api-sidebar {
    width: 260px;
    min-width: 260px;
    background: #1e1e2e;
    border-right: 1px solid #2a2a3d;
    padding: 32px 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.api-sidebar::-webkit-scrollbar {
    display: none;
}

/* ── Dark scrollbars ── */
.api-main {
    scrollbar-width: thin;
    scrollbar-color: #3a3a50 transparent;
}

.api-main::-webkit-scrollbar {
    width: 8px;
}

.api-main::-webkit-scrollbar-track {
    background: transparent;
}

.api-main::-webkit-scrollbar-thumb {
    background: #3a3a50;
    border-radius: 4px;
}

.api-main::-webkit-scrollbar-thumb:hover {
    background: #4a4a60;
}

.api-sidebar__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6c6c80;
    padding: 0 24px;
    margin-bottom: 12px;
}

.api-sidebar__list {
    list-style: none;
}

.api-sidebar__list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #a0a0b8;
    text-decoration: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.api-sidebar__list li a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #d0d0e0;
}

.api-sidebar__list li a.active {
    background: rgba(8, 106, 216, 0.12);
    color: #79b8ff;
    border-left-color: #79b8ff;
    font-weight: 600;
}

.api-sidebar__method {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.api-sidebar__method--post {
    background: rgba(56, 203, 137, 0.18);
    color: #5eda9e;
}

.api-sidebar__method--get {
    background: rgba(121, 184, 255, 0.15);
    color: #79b8ff;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */

.api-main {
    flex: 1;
    min-width: 0;
    padding: 40px 48px 80px;
    overflow-y: auto;
    background: #161625;
    color: #c9cdd6;
}

.api-main h1 {
    font-size: 28px;
    font-weight: 700;
    color: #e8e8f0;
    margin-bottom: 8px;
}

.api-main > .api-intro {
    font-size: 16px;
    color: #8b8fa4;
    line-height: 1.7;
    margin-bottom: 20px;
}

.api-notice {
    background: rgba(121, 184, 255, 0.06);
    border: 1px solid rgba(121, 184, 255, 0.15);
    border-left: 3px solid #79b8ff;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 40px;
    font-size: 14px;
    color: #8b8fa4;
    line-height: 1.7;
}

.api-notice p {
    margin-bottom: 8px;
}

.api-notice p:last-child {
    margin-bottom: 0;
}

.api-notice a {
    color: #79b8ff;
    text-decoration: none;
}

.api-notice a:hover {
    text-decoration: underline;
}

.api-main > .footer {
    margin: 40px -48px -80px;
}

.api-auth-note {
    background: rgba(56, 203, 137, 0.08);
    border: 1px solid rgba(56, 203, 137, 0.2);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 15px;
    color: #8b8fa4;
    line-height: 1.6;
}

.api-auth-note__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 6px;
}

.api-auth-note__badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(56, 203, 137, 0.15);
    color: #38cb89;
}

.api-auth-note p {
    margin: 0;
}

.api-auth-note code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #c9d1d9;
}

.api-auth-note a {
    color: #79b8ff;
    text-decoration: none;
}

.api-auth-note a:hover {
    text-decoration: underline;
}


/* ── Endpoint Section ─────────────────────────────────────────────────────── */

.api-endpoint {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 40px;
    background: #1c1c30;
    border: 1px solid #2a2a3d;
    border-radius: 8px;
    padding: 28px;
}

.api-endpoint__docs {
    min-width: 0;
}

.api-endpoint__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: #252540;
    border-radius: var(--radius-sm);
    border: 1px solid #2a2a3d;
    border-left: 3px solid var(--color-primary);
}

.api-endpoint__method {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.api-endpoint__method--post {
    background: rgba(56, 203, 137, 0.18);
    color: #5eda9e;
}

.api-endpoint__method--get {
    background: rgba(121, 184, 255, 0.15);
    color: #79b8ff;
}

.api-endpoint__path {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: #e8e8f0;
}

.api-endpoint__desc {
    font-size: 15px;
    color: #8b8fa4;
    line-height: 1.7;
    margin-bottom: 24px;
}

.api-endpoint__desc code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #79b8ff;
}

/* ── Schema Tables ────────────────────────────────────────────────────────── */

.api-schema {
    margin-bottom: 28px;
}

.api-schema__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #79b8ff;
    margin-bottom: 12px;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 3px solid #79b8ff;
}

.api-schema--request .api-schema__title {
    border-left-color: #5eda9e;
    color: #5eda9e;
}

.api-schema--response .api-schema__title {
    border-left-color: #79b8ff;
    color: #79b8ff;
}

.api-schema--error .api-schema__title {
    border-left-color: #f97583;
    color: #f97583;
}

.api-schema__subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #c9cdd6;
    margin: 16px 0 8px;
    padding-left: 4px;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-bottom: 16px;
    table-layout: fixed;
}

.api-table col:nth-child(1) { width: 180px; }
.api-table col:nth-child(2) { width: 170px; }

.api-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c6c80;
    padding: 8px 12px;
    border-bottom: 2px solid #2a2a3d;
    background: rgba(255, 255, 255, 0.03);
}

.api-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a3d;
    vertical-align: top;
}

.api-table td:first-child {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: #79b8ff;
    white-space: nowrap;
}

.api-table td:nth-child(2) {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #6c6c80;
    white-space: nowrap;
}

.api-table td:last-child {
    color: #8b8fa4;
    line-height: 1.5;
}

.api-table .required::after {
    content: " *";
    color: #f97583;
    font-weight: 700;
}

.api-table .enum-vals {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #5eda9e;
}

/* ── Small Buttons ────────────────────────────────────────────────────────── */

.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn-sm--primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-sm--primary:hover {
    background: var(--color-primary-hover);
}

.btn-sm--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #a0a0b8;
    border: 1px solid #2a2a3d;
}

.btn-sm--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #d0d0e0;
}

/* ── Try It Panel ─────────────────────────────────────────────────────────── */

.api-tryit {
    background: #1e1e2e;
    border: 1px solid #2a2a3d;
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: 0;
}

.api-tryit__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #252538;
    border-bottom: 1px solid #2a2a3d;
}

.api-tryit__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b8fa4;
}

.api-tryit__actions {
    display: flex;
    gap: 6px;
}

.api-tryit__body {
    display: flex;
    flex-direction: column;
}

.api-tryit__pane + .api-tryit__pane {
    border-top: 2px solid #1a1a2a;
}

.api-tryit__pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #252538;
    border-bottom: 1px solid #2a2a3d;
}

.api-tryit__pane-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c6c80;
}

.api-tryit__pane-label--error {
    color: #f44;
}

.api-tryit__pane-label--ok {
    color: #38cb89;
}

.api-tryit__copy {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c6c80;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.api-tryit__copy:hover {
    color: #d0d0e0;
    background: rgba(255, 255, 255, 0.08);
}

.api-tryit__copy svg {
    width: 14px;
    height: 14px;
}

/* ── Monaco Editor ────────────────────────────────────────────────────────── */

.api-tryit__editor {
    height: 280px;
}

/* ── SVG Preview ─────────────────────────────────────────────────────────── */

.api-tryit__svg-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 20px;
    background: #1e1e1e;
}

.api-tryit__svg-preview svg {
    max-width: 100%;
    max-height: 400px;
}

/* ── Text Input ──────────────────────────────────────────────────────────── */

.api-tryit__input-wrap {
    padding: 12px 14px;
}

.api-tryit__input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #e8e8f0;
    background: #161625;
    border: 1px solid #2a2a3d;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
}

.api-tryit__input::placeholder {
    color: #6c6c80;
}

.api-tryit__input:focus {
    border-color: var(--color-primary);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .api-endpoint {
        grid-template-columns: 1fr;
    }

    .api-tryit {
        position: static;
    }
}

@media (max-width: 900px) {
    .api-sidebar {
        display: none;
    }

    .api-main {
        padding: 24px 16px 60px;
    }

    .api-main > .footer {
        margin: 40px -16px -60px;
    }

    .api-main h1 {
        font-size: 22px;
    }

    .api-endpoint {
        padding: 16px;
        gap: 16px;
    }

    .api-endpoint__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 14px;
    }

    .api-endpoint__path {
        font-size: 13px;
        word-break: break-all;
    }

    .api-endpoint__desc {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .api-table {
        table-layout: auto;
    }

    .api-table col:nth-child(1) { width: auto; }
    .api-table col:nth-child(2) { width: auto; }

    .api-table td:first-child,
    .api-table td:nth-child(2) {
        white-space: normal;
    }

    .api-table th,
    .api-table td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .api-table td:first-child {
        font-size: 12px;
    }

    .api-table td:nth-child(2) {
        font-size: 11px;
    }

    .api-schema {
        margin-bottom: 16px;
    }

    .api-schema__title {
        font-size: 12px;
        padding: 7px 10px;
    }

    .api-notice {
        font-size: 13px;
        padding: 12px 14px;
    }

    .api-tryit__editor {
        height: 200px;
    }

    .api-tryit__svg-preview {
        min-height: 200px;
    }
}
