/* Ecomas Public API & Webhook Documentation Stylesheet */

:root {
    --doc-primary: #533afd;
    --doc-primary-hover: #432cd9;
    --doc-primary-rgb: 83, 58, 253;
    --doc-bg: #f8fafc;
    --doc-card: #ffffff;
    --doc-border: #e2e8f0;
    --doc-text: #0f172a;
    --doc-muted: #64748b;
    --doc-code-bg: #0b0f19;
    --doc-code-border: #1e293b;
    --doc-sidebar-width: 280px;
}

.dark {
    --doc-bg: #0b0f19;
    --doc-card: #131a2b;
    --doc-border: rgba(255, 255, 255, 0.08);
    --doc-text: #f8fafc;
    --doc-muted: #94a3b8;
    --doc-code-bg: #070a12;
    --doc-code-border: rgba(255, 255, 255, 0.1);
}

/* Documentation Shell */
.api-docs-section {
    padding: 60px 0 120px;
    background: var(--doc-bg);
    position: relative;
    overflow: hidden;
}

.api-docs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Header */
.api-docs-hero {
    background: linear-gradient(135deg, rgba(83, 58, 253, 0.08) 0%, rgba(124, 98, 255, 0.04) 50%, rgba(236, 72, 153, 0.04) 100%);
    border: 1px solid var(--doc-border);
    border-radius: 28px;
    padding: 48px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.05);
}

.api-docs-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    background: rgba(83, 58, 253, 0.1);
    color: var(--doc-primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0;
    border: 1px solid rgba(83, 58, 253, 0.2);
}

.api-docs-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.api-docs-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-btn-copy-md {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--doc-primary);
    background: rgba(83, 58, 253, 0.08);
    border: 1px solid rgba(83, 58, 253, 0.22);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.api-btn-copy-md:hover {
    background: var(--doc-primary);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(83, 58, 253, 0.25);
}

.api-btn-view-md {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--doc-text-muted);
    background: var(--doc-card);
    border: 1px solid var(--doc-border);
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.api-btn-view-md:hover {
    color: var(--doc-text);
    border-color: var(--doc-primary);
}

.api-docs-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--doc-text);
    margin-bottom: 16px;
}

.api-docs-subtitle {
    font-size: 17px;
    line-height: 1.7;
    color: var(--doc-muted);
    max-width: 820px;
    margin-bottom: 24px;
}

.api-docs-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.api-docs-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--doc-card);
    border: 1px solid var(--doc-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--doc-text);
}

/* Two-column layout */
.api-docs-layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    position: relative;
}

/* Sticky Sidebar Navigation */
.api-docs-sidebar {
    width: var(--doc-sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    background: var(--doc-card);
    border: 1px solid var(--doc-border);
    border-radius: 20px;
    padding: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
}

.api-docs-sidebar::-webkit-scrollbar {
    width: 4px;
}
.api-docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--doc-border);
    border-radius: 4px;
}

.api-nav-group-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--doc-muted);
    margin: 18px 0 8px 10px;
}
.api-nav-group-title:first-child {
    margin-top: 0;
}

.api-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.api-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--doc-muted);
    text-decoration: none;
    transition: all 0.18s ease;
}

.api-nav-link:hover {
    color: var(--doc-text);
    background: rgba(83, 58, 253, 0.06);
}

.api-nav-link.active {
    color: var(--doc-primary);
    background: rgba(83, 58, 253, 0.1);
    font-weight: 700;
}

.api-nav-method {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.api-nav-method.get { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.api-nav-method.post { background: rgba(83, 58, 253, 0.15); color: #6366f1; }
.api-nav-method.webhook { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Main Content Area */
.api-docs-content {
    flex: 1;
    min-width: 0;
}

/* Documentation Content Card */
.api-doc-block {
    background: var(--doc-card);
    border: 1px solid var(--doc-border);
    border-radius: 22px;
    padding: 36px;
    margin-bottom: 32px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
}

.api-doc-heading {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--doc-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-doc-text {
    font-size: 15px;
    line-height: 1.75;
    color: var(--doc-muted);
    margin-bottom: 20px;
}

/* Callout Info Boxes */
.api-callout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    background: rgba(83, 58, 253, 0.05);
    border: 1px solid rgba(83, 58, 253, 0.15);
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--doc-text);
}

.api-callout--warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
}

.api-callout--success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}

.api-callout i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 16px;
}

/* Endpoint URL Pill Header */
.api-endpoint-badge-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--doc-code-bg);
    border: 1px solid var(--doc-code-border);
    border-radius: 14px;
    padding: 12px 18px;
    font-family: monospace;
    font-size: 14px;
    margin: 18px 0;
}

.api-method-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.api-method-pill.get { background: #10b981; color: #fff; }
.api-method-pill.post { background: #6366f1; color: #fff; }
.api-method-pill.webhook { background: #f59e0b; color: #fff; }

.api-endpoint-path {
    color: #f8fafc;
    font-weight: 600;
    word-break: break-all;
}

/* Parameters Table */
.api-params-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--doc-border);
    border-radius: 14px;
}

.api-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.api-params-table th {
    background: rgba(0, 0, 0, 0.02);
    color: var(--doc-muted);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid var(--doc-border);
}

.dark .api-params-table th {
    background: rgba(255, 255, 255, 0.02);
}

.api-params-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--doc-border);
    color: var(--doc-text);
    vertical-align: top;
}

.api-params-table tr:last-child td {
    border-bottom: none;
}

.api-param-name {
    font-family: monospace;
    font-weight: 700;
    color: var(--doc-primary);
}

.api-param-type {
    font-family: monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--doc-muted);
    margin-left: 6px;
}

.dark .api-param-type {
    background: rgba(255, 255, 255, 0.08);
}

.api-param-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}
.api-param-badge.required { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.api-param-badge.optional { background: rgba(148, 163, 184, 0.15); color: #64748b; }

/* Interactive Code Tabs Container */
.api-code-container {
    background: var(--doc-code-bg);
    border: 1px solid var(--doc-code-border);
    border-radius: 16px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.api-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--doc-code-border);
    padding: 8px 14px;
}

.api-code-tabs {
    display: flex;
    gap: 4px;
}

.api-code-tab {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.api-code-tab:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.api-code-tab.active {
    color: #ffffff;
    background: rgba(83, 58, 253, 0.4);
}

.api-code-copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.api-code-copy-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.api-code-body {
    padding: 16px 20px;
    margin: 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.65;
    color: #f1f5f9;
}

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

/* Responsive Overrides */
@media (max-width: 1080px) {
    .api-docs-layout {
        flex-direction: column;
    }
    .api-docs-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 24px;
    }
}
