/* ===== API DOCS — scoped under .api-docs ===== */

.api-docs {
    --brand-50: #fdf4ff; --brand-100: #fae8ff; --brand-200: #f5d0fe;
    --brand-300: #f0abfc; --brand-400: #e879f9; --brand-500: #d946ef;
    --brand-600: #c026d3; --brand-700: #a21caf; --brand-800: #86198f;
    --brand-900: #701a75; --brand-950: #4a044e;
    --gray-50: #fafafa; --gray-100: #f4f4f5; --gray-200: #e4e4e7;
    --gray-300: #d4d4d8; --gray-400: #a1a1aa; --gray-500: #71717a;
    --gray-600: #52525b; --gray-700: #3f3f46; --gray-800: #27272a;
    --gray-900: #18181b;
    --accent-400: #22d3ee; --accent-500: #06b6d4;
    --green-500: #22c55e; --green-600: #16a34a;
    --yellow-500: #eab308; --red-500: #ef4444;
    --blue-500: #3b82f6; --orange-500: #f97316;
    --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    font-family: var(--font-sans);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.api-docs a { color: var(--brand-900); text-decoration: none; }
.api-docs a:hover { color: var(--brand-700); }
.api-docs code { background: var(--gray-100); padding: 2px 6px; border-radius: 3px; font-size: 12px; font-family: var(--font-mono); }

/* ===== LAYOUT ===== */
.api-docs .layout { display: flex; min-height: calc(100vh - 56px); }

/* ===== SIDEBAR ===== */
.api-docs .sidebar { width: 272px; min-width: 272px; background: #fff; border-right: 1px solid var(--gray-200); padding: 16px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 50; transition: transform 0.25s ease; }
.api-docs .sidebar-search { padding: 0 14px 12px; }
.api-docs .sidebar-search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font-sans); outline: none; background: var(--gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 10px center no-repeat; transition: border-color 0.15s; }
.api-docs .sidebar-search input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(112,26,117,0.1); }
.api-docs .sidebar-section { padding: 0 10px; margin-bottom: 4px; }
.api-docs .sidebar-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); padding: 10px 12px 6px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; border-radius: var(--radius-sm); transition: background 0.1s; }
.api-docs .sidebar-section-title:hover { background: var(--gray-50); }
.api-docs .sidebar-section-title .chevron { transition: transform 0.2s; font-size: 10px; }
.api-docs .sidebar-section-title.collapsed .chevron { transform: rotate(-90deg); }
.api-docs .sidebar-section-links { overflow: hidden; transition: max-height 0.25s ease; }
.api-docs .sidebar-section-links.collapsed { max-height: 0 !important; }
.api-docs .sidebar-link { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--gray-600); border-radius: var(--radius-sm); transition: all 0.1s; }
.api-docs .sidebar-link:hover { background: var(--gray-100); color: var(--gray-800); text-decoration: none; }
.api-docs .sidebar-link.active { background: var(--brand-50); color: var(--brand-900); font-weight: 600; }
.api-docs .sidebar-link.hidden { display: none; }
.api-docs .sidebar-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-left: auto; flex-shrink: 0; }
.api-docs .badge-get { background: #dbeafe; color: #1d4ed8; }
.api-docs .badge-post { background: #dcfce7; color: #15803d; }
.api-docs .badge-new { background: #fef3c7; color: #b45309; }

/* ===== MAIN ===== */
.api-docs .main { flex: 1; max-width: calc(100% - 272px); }

/* ===== HERO ===== */
.api-docs .hero { background: linear-gradient(135deg, var(--brand-950) 0%, var(--brand-900) 50%, var(--brand-800) 100%); color: #fff; padding: 56px 48px; position: relative; overflow: hidden; }
.api-docs .hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(217,70,239,0.15) 0%, transparent 70%); pointer-events: none; }
.api-docs .hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; position: relative; }
.api-docs .hero p { font-size: 16px; opacity: 0.85; max-width: 600px; line-height: 1.7; position: relative; }
.api-docs .hero-badges { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; position: relative; }
.api-docs .hero-badge { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.1); backdrop-filter: blur(4px); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid rgba(255,255,255,0.08); }
.api-docs .hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); animation: apidocs-pulse 2s infinite; }
@keyframes apidocs-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== SECTION COMMON ===== */
.api-docs .content-section { padding: 48px; border-bottom: 1px solid var(--gray-200); }
.api-docs .content-section:nth-child(odd) { background: #fff; }
.api-docs .content-section:nth-child(even) { background: var(--gray-50); }
.api-docs .section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.api-docs .section-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.api-docs .section-subtitle { color: var(--gray-500); font-size: 15px; margin-bottom: 28px; max-width: 700px; line-height: 1.7; }
.api-docs .method-badge { font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 4px; letter-spacing: 0.03em; }
.api-docs .method-get { background: #dbeafe; color: #1d4ed8; }
.api-docs .method-post { background: #dcfce7; color: #15803d; }
.api-docs .endpoint-url { font-family: var(--font-mono); font-size: 13.5px; color: var(--gray-600); background: var(--gray-100); padding: 8px 14px; border-radius: var(--radius-sm); display: inline-block; margin-bottom: 16px; border: 1px solid var(--gray-200); }

/* ===== QUICK START ===== */
.api-docs .steps { display: flex; gap: 20px; flex-wrap: wrap; }
.api-docs .step { flex: 1; min-width: 260px; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 24px; transition: border-color 0.15s, box-shadow 0.15s; background: #fff; }
.api-docs .step:hover { border-color: var(--brand-300); box-shadow: 0 4px 16px rgba(112,26,117,0.08); }
.api-docs .step-number { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-900); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.api-docs .step h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--gray-900); }
.api-docs .step p { font-size: 13.5px; color: var(--gray-500); line-height: 1.6; }

/* ===== CODE PANELS ===== */
.api-docs .code-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
@media (max-width: 1100px) { .api-docs .code-columns { grid-template-columns: 1fr; } }
.api-docs .code-panel { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.api-docs .lang-tabs { display: flex; background: var(--gray-900); padding: 0 16px; gap: 0; overflow-x: auto; }
.api-docs .lang-tab { padding: 8px 14px; font-size: 12px; font-weight: 500; color: var(--gray-400); cursor: pointer; border: none; border-bottom: 2px solid transparent; background: none; font-family: var(--font-sans); white-space: nowrap; transition: all 0.15s; }
.api-docs .lang-tab:hover { color: var(--gray-200); }
.api-docs .lang-tab.active { color: #fff; border-bottom-color: var(--accent-400); }
.api-docs .code-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--gray-800); height: 38px; }
.api-docs .code-panel-title { font-size: 11px; font-weight: 600; color: var(--gray-300); text-transform: uppercase; letter-spacing: 0.05em; }
.api-docs .copy-btn { background: transparent; border: 1px solid var(--gray-600); color: var(--gray-400); font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 4px; cursor: pointer; font-family: var(--font-sans); transition: all 0.15s; }
.api-docs .copy-btn:hover { border-color: var(--gray-400); color: #fff; }
.api-docs .copy-btn.copied { border-color: var(--green-500); color: var(--green-500); }
.api-docs .code-block { background: var(--gray-900) !important; padding: 16px 20px; overflow-x: auto; max-height: 420px; }
.api-docs .code-block pre { margin: 0; padding: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: #e4e4e7; white-space: pre; background: transparent !important; border: none; }
.api-docs .code-block .s { color: #a5d6ff; } .api-docs .code-block .k { color: #7ee787; }
.api-docs .code-block .n { color: #f2cc60; } .api-docs .code-block .w { color: #ff7b72; }
.api-docs .code-block .c { color: #8b949e; } .api-docs .code-block .f { color: #d2a8ff; }
.api-docs .code-block .o { color: #79c0ff; }
.api-docs .response-header { background: var(--gray-900); }
.api-docs .response-header .code-panel-title { color: var(--green-500); }
.api-docs .response-block { background: #0d1117 !important; padding: 16px 20px; overflow-x: auto; max-height: 420px; }
.api-docs .response-block pre { margin: 0; padding: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: #c9d1d9; white-space: pre; background: transparent !important; border: none; }

/* ===== SHARED TABLE STYLES ===== */
.api-docs .params-table, .api-docs .field-table, .api-docs .rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.api-docs .params-table th, .api-docs .field-table th, .api-docs .rate-table th { text-align: left; padding: 9px 14px; background: var(--gray-100); color: var(--gray-500); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--gray-200); }
.api-docs .params-table td, .api-docs .field-table td, .api-docs .rate-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }

/* ===== PARAMS TABLE ===== */
.api-docs .params-section { margin-bottom: 24px; }
.api-docs .params-title { font-size: 13px; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.api-docs .param-name { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--brand-900); }
.api-docs .param-type { font-family: var(--font-mono); font-size: 12px; color: var(--gray-400); }
.api-docs .param-required { font-size: 11px; font-weight: 600; color: var(--red-500); text-transform: uppercase; }
.api-docs .param-desc { color: var(--gray-600); font-size: 13px; line-height: 1.5; }

/* ===== STATUS CHIPS ===== */
.api-docs .status-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.api-docs .status-chip { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1px solid var(--gray-200); }
.api-docs .status-chip.s200 { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.api-docs .status-chip.s400 { background: #fefce8; border-color: #fde68a; color: #a16207; }
.api-docs .status-chip.s401 { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.api-docs .status-chip.s429 { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }

/* ===== FIELD DESC TABLE ===== */
.api-docs .field-table { margin-top: 16px; }
.api-docs .field-table .fname { font-family: var(--font-mono); color: var(--brand-800); font-size: 12px; }
.api-docs .field-table .ftype { font-family: var(--font-mono); color: var(--gray-400); font-size: 11px; }
.api-docs .field-table .fdesc { color: var(--gray-600); font-size: 12.5px; }

/* ===== TRY IT ===== */
.api-docs .try-it { border: 2px dashed var(--brand-300); border-radius: var(--radius-lg); padding: 24px; background: var(--brand-50); margin-top: 20px; }
.api-docs .try-it h4 { font-size: 15px; font-weight: 700; color: var(--brand-900); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.api-docs .try-it h4 .try-icon { width: 18px; height: 18px; opacity: 0.7; }
.api-docs .try-input-group { margin-bottom: 10px; }
.api-docs .try-input-group-auto { flex: 0 0 auto; }
.api-docs .try-input-group-fill { flex: 1; }
.api-docs .try-input-group .try-input { width: 100%; flex: none; box-sizing: border-box; }
.api-docs .try-input-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; display: block; }
.api-docs .try-input-row { display: flex; gap: 10px; align-items: flex-end; }
.api-docs .try-input { flex: 1; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 13px; outline: none; transition: border-color 0.15s; background: #fff; }
.api-docs .try-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(112,26,117,0.12); }
.api-docs .try-input-sm { width: 100px; flex: none; }
.api-docs select.try-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding: 10px 28px 10px 8px; width: auto; min-width: 220px; }
.api-docs .try-btn { background: var(--brand-900); color: #fff; border: none; padding: 10px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; cursor: pointer; font-family: var(--font-sans); transition: all 0.15s; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.api-docs .try-btn:hover { background: var(--brand-800); }
.api-docs .try-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.api-docs .try-btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: apidocs-spin 0.6s linear infinite; display: none; }
.api-docs .try-btn.loading .spinner { display: inline-block; }
.api-docs .try-btn.loading .btn-text { display: none; }
@keyframes apidocs-spin { to { transform: rotate(360deg); } }
.api-docs .try-output { margin-top: 14px; border-radius: var(--radius-md); overflow: hidden; display: none; }
.api-docs .try-output.visible { display: block; animation: apidocs-fadeIn 0.2s ease; }
@keyframes apidocs-fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.api-docs .try-output-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--gray-900); }
.api-docs .try-output-status { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.api-docs .try-output-status.s2xx { color: var(--green-500); }
.api-docs .try-output-status.s4xx { color: var(--yellow-500); }
.api-docs .try-output-status.s5xx { color: var(--red-500); }
.api-docs .try-output-time { font-size: 11px; color: var(--gray-400); font-family: var(--font-mono); }
.api-docs .try-output-body { background: #0d1117 !important; padding: 14px 18px; overflow-x: auto; max-height: 350px; overflow-y: auto; }
.api-docs .try-output-body pre { margin: 0; padding: 0; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: #c9d1d9; white-space: pre-wrap; word-break: break-word; background: transparent !important; border: none; }
.api-docs .try-output-error { background: #1a0000 !important; padding: 14px 18px; }
.api-docs .try-output-error pre { color: #ff7b72; background: transparent !important; border: none; padding: 0; margin: 0; }
.api-docs .try-note { font-size: 11.5px; color: var(--gray-400); margin-top: 8px; font-style: italic; }
.api-docs .try-output-usage { display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--gray-400); background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 3px; margin-left: 8px; }

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.api-docs .ac-dropdown { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: #fff; border: 1px solid var(--gray-200); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,0.12); max-height: 240px; overflow-y: auto; display: none; }
.api-docs .ac-dropdown.open { display: block; }
.api-docs .ac-dropdown-item { padding: 8px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--gray-700); cursor: pointer; border-bottom: 1px solid var(--gray-100); transition: background 0.1s; }
.api-docs .ac-dropdown-item:last-child { border-bottom: none; }
.api-docs .ac-dropdown-item:hover { background: var(--brand-50); color: var(--brand-900); }

/* ===== PRODUCT CARDS ===== */
.api-docs .product-cards { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.api-docs .product-card { flex: 1; min-width: 200px; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px; background: #fff; transition: all 0.2s; }
.api-docs .product-card:hover { border-color: var(--brand-400); box-shadow: 0 8px 24px rgba(112,26,117,0.1); transform: translateY(-2px); }
.api-docs .product-card h4 { font-size: 14px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.api-docs .product-card .price { font-size: 13px; color: var(--brand-700); font-weight: 600; margin-bottom: 8px; }
.api-docs .product-card p { font-size: 12.5px; color: var(--gray-500); line-height: 1.5; }
.api-docs .product-card .arrow { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--brand-900); }

/* ===== RATE LIMIT TABLE ===== */
.api-docs .rate-table .plan-name { font-weight: 600; color: var(--gray-900); }

/* ===== BACK TO TOP ===== */
.api-docs .back-to-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; background: var(--brand-900); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(10px); transition: all 0.25s; z-index: 90; box-shadow: 0 4px 12px rgba(112,26,117,0.3); }
.api-docs .back-to-top.visible { opacity: 1; transform: translateY(0); }
.api-docs .back-to-top:hover { background: var(--brand-800); transform: translateY(-2px); }

/* ===== SCROLLBAR ===== */
.api-docs ::-webkit-scrollbar { width: 6px; height: 6px; }
.api-docs ::-webkit-scrollbar-track { background: transparent; }
.api-docs ::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.api-docs .code-block::-webkit-scrollbar-thumb, .api-docs .response-block::-webkit-scrollbar-thumb { background: var(--gray-600); }

/* ===== MOBILE SIDEBAR ===== */
.api-docs .hamburger { display: none; background: none; border: none; color: var(--brand-900); cursor: pointer; padding: 4px; }
.api-docs .hamburger svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
    .api-docs .hamburger { display: block; }
    .api-docs .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); z-index: 90; height: 100vh; }
    .api-docs .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
    .api-docs .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 80; }
    .api-docs .sidebar-overlay.open { display: block; }
    .api-docs .main { margin-left: 0; max-width: 100%; }
    .api-docs .hero { padding: 40px 24px; }
    .api-docs .hero h1 { font-size: 26px; }
    .api-docs .content-section { padding: 32px 20px; }
    .api-docs .code-columns { grid-template-columns: 1fr; }
    .api-docs .steps { flex-direction: column; }
    .api-docs .product-cards { flex-direction: column; }
}
