/* ===== Partner API Documentation Page ===== */

/* Sidebar navigation */
.api-docs-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 15px;
    border-right: 1px solid #e9ecef;
}

.api-docs-sidebar .nav-link {
    color: #555;
    padding: 6px 12px;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
}

.api-docs-sidebar .nav-link:hover,
.api-docs-sidebar .nav-link.active {
    color: #1072ba;
    border-left-color: #1072ba;
    background: rgba(16, 114, 186, 0.05);
}

.api-docs-sidebar .nav-link.sub-link {
    padding-left: 24px;
    font-size: 0.85rem;
}

/* Mobile sidebar toggle */
.api-sidebar-toggle {
    display: none;
    background: #1072ba;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 15px;
    margin-bottom: 15px;
    cursor: pointer;
}

@media (max-width: 991px) {
    .api-docs-sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 15px;
        margin-bottom: 20px;
        display: none;
    }

    .api-docs-sidebar.show {
        display: block;
    }

    .api-sidebar-toggle {
        display: inline-block;
    }
}

/* Section styling */
.api-section {
    padding-top: 20px;
    margin-bottom: 40px;
}

.api-section h2 {
    color: #1072ba;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.api-section h3 {
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Endpoint URL display */
.api-endpoint {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.95rem;
    overflow-x: auto;
}

.api-endpoint .method-badge {
    flex-shrink: 0;
    margin-right: 12px;
}

.api-endpoint .endpoint-url {
    color: #333;
    word-break: break-all;
}

/* Method badges */
.method-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge.get {
    background: #d4edda;
    color: #155724;
}

.method-badge.post {
    background: #cce5ff;
    color: #004085;
}

/* Code blocks */
.api-code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.api-code-block .code-header {
    display: flex;
    background: #181825;
    padding: 8px 16px;
    border-bottom: 1px solid #313244;
}

.api-code-block .code-tab {
    padding: 4px 14px;
    color: #6c7086;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    border: none;
    background: none;
    font-family: inherit;
}

.api-code-block .code-tab.active {
    color: #cdd6f4;
    background: #313244;
}

.api-code-block .code-panel {
    display: none;
    padding: 16px;
    overflow-x: auto;
}

.api-code-block .code-panel.active {
    display: block;
}

.api-code-block pre {
    margin: 0;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
}

.api-code-block code {
    color: inherit;
    background: transparent;
    font-size: inherit;
}

/* Syntax colours (minimal — no JS library) */
.code-keyword { color: #cba6f7; }
.code-string  { color: #a6e3a1; }
.code-comment { color: #6c7086; font-style: italic; }
.code-url     { color: #89b4fa; }
.code-number  { color: #fab387; }

/* Parameter / field tables */
.api-table {
    width: 100%;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.api-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #333;
    font-weight: 600;
    padding: 10px 12px;
    white-space: nowrap;
}

.api-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.api-table {
    min-width: 520px;
}

.api-table tbody td:first-child code {
    white-space: nowrap;
}

.badge-required,
.badge-optional {
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 4px;
}

.api-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.api-table code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #e83e8c;
}

.badge-required {
    background: #dc3545;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-optional {
    background: #6c757d;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Nested field rows (child properties of objects) */
.api-table tr.nested-field td:first-child {
    padding-left: 24px;
}

.api-table tr.nested-field {
    background: #fafbfc;
}

/* Status table for webhooks */
.status-table tbody td:first-child {
    font-weight: 600;
}

/* Step cards for Getting Started */
.step-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    border-left: 4px solid #1072ba;
}

.step-card .step-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: #1072ba;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 10px;
}

/* Hero section */
.api-hero {
    background: linear-gradient(135deg, #39AAE1 0%, #1072ba 100%);
    color: #fff;
    padding: 24px 0;
    margin-bottom: 30px;
}

.api-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.api-hero p {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0;
}

/* CTA section */
.api-cta {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}

.api-cta h2 {
    border-bottom: none;
    font-size: 1.5rem;
}

.api-cta .btn-primary {
    background: #6BA031;
    border-color: #6BA031;
    padding: 10px 30px;
    font-size: 1rem;
}

.api-cta .btn-primary:hover {
    background: #5a8a28;
    border-color: #5a8a28;
}

/* Inline code in prose */
.api-section p code,
.api-section li code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #e83e8c;
}

/* Note / info boxes */
.api-note {
    background: #e7f3ff;
    border-left: 4px solid #1072ba;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.api-note strong {
    color: #1072ba;
}

.api-warning {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.api-warning strong {
    color: #856404;
}
