/* ── API Documentation Styles ────────────────────────────── */
.api-hero {
    text-align: center;
    padding: 48px 0 32px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.api-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
}

.api-hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* ── Info Banner / Subscription CTA ────────────────────── */
.api-banner {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.api-banner-text {
    flex: 1;
}

.api-banner-text p {
    color: #fff;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
}

.api-banner .btn-cta {
    flex-shrink: 0;
    padding: 12px 28px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.api-banner .btn-cta:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
    .api-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ── Endpoint Cards ───────────────────────────────────── */
.api-endpoints {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.endpoint-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    transition: border-color .3s, box-shadow .3s;
}

.endpoint-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.endpoint-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .2s;
}

.endpoint-card.collapsed .endpoint-header:hover {
    background: rgba(255,255,255,0.02);
}

.endpoint-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.endpoint-method.get {
    background: rgba(59,130,246,0.25);
    border: 1px solid rgba(59,130,246,0.5);
    color: #60a5fa;
}

.endpoint-method.post {
    background: rgba(74,222,128,0.25);
    border: 1px solid rgba(74,222,128,0.5);
    color: #4ade80;
}

.endpoint-path {
    flex: 1;
}

.endpoint-path .path {
    font-family: var(--mono);
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.endpoint-path .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.endpoint-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(59,130,246,0.1);
    border-radius: 6px;
    color: var(--accent);
    font-weight: bold;
    transition: transform .3s, background .2s;
}

.endpoint-card.expanded .endpoint-toggle {
    transform: rotate(180deg);
}

.endpoint-card.expanded .endpoint-toggle {
    background: rgba(59,130,246,0.15);
}

.endpoint-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease-out;
}

.endpoint-card.expanded .endpoint-body {
    max-height: 2000px;
}

.endpoint-content {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .endpoint-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.endpoint-section {
    display: flex;
    flex-direction: column;
}

.endpoint-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.endpoint-section p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
}

.code-block {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
    overflow-x: auto;
    line-height: 1.5;
    margin-bottom: 12px;
}

.code-block .key {
    color: #93c5fd;
}

.code-block .string {
    color: #4ade80;
}

.code-block .number {
    color: #f97316;
}

.code-block .boolean {
    color: #fbbf24;
}

.code-block .null {
    color: #9ca3af;
}

.param-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

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

.param-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.param-table tr:hover {
    background: rgba(59,130,246,0.02);
}

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

.param-type {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.param-required {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.param-optional {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* ── Auth & Info Section ───────────────────────────────── */
.api-section {
    margin-bottom: 48px;
}

.api-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.api-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 24px 0 12px;
}

.api-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.auth-card h3 {
    margin-top: 0;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list strong {
    color: #fff;
}

/* ── Rate Limit Box ────────────────────────────────────── */
.rate-limit-box {
    background: var(--surface);
    border-left: 4px solid var(--warning);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.rate-limit-box h3 {
    margin-top: 0;
    color: var(--warning);
}

.rate-limit-box p {
    color: var(--text-muted);
    margin: 8px 0;
    font-size: 0.95rem;
}

/* ── Status Codes ──────────────────────────────────────── */
.status-code-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.status-code-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.status-code-item .code {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.status-code-item .code.success { color: var(--success); }
.status-code-item .code.created { color: var(--success); }
.status-code-item .code.accepted { color: var(--accent); }
.status-code-item .code.error { color: var(--danger); }

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

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .api-hero h1 {
        font-size: 1.8rem;
    }

    .endpoint-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .endpoint-path {
        flex-basis: 100%;
    }

    .endpoint-path .path {
        font-size: 0.85rem;
        word-break: break-all;
    }
}