/* ========================================
   LESSEN DOCS — Design System
   ======================================== */

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-code: #0d1117;
    --bg-inline-code: rgba(99, 130, 255, 0.12);
    --bg-sidebar: #0e1425;
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 130, 255, 0.5);
    --text-primary: #e8eaf0;
    --text-secondary: #8b95a8;
    --text-muted: #5a6478;
    --accent: #6382ff;
    --accent-glow: rgba(99, 130, 255, 0.2);
    --green: #34d399;
    --orange: #f59e0b;
    --red: #ef4444;
    --purple: #a78bfa;
    --cyan: #22d3ee;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --sidebar-width: 280px;
    --header-height: 60px;
    --radius: 10px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* === Header === */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    height: 30px;
    opacity: 0.95;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
}

.header-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.header-link:hover {
    color: var(--text-primary);
}

.header-cta {
    background: var(--accent);
    color: #fff;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.header-cta:hover {
    background: #5570ee;
    box-shadow: 0 0 20px var(--accent-glow);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

/* === Layout === */
.docs-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* === Sidebar === */
.docs-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-section {
    padding: 0 20px;
    margin-bottom: 8px;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 0 8px;
}

.sidebar-link {
    display: block;
    padding: 7px 14px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 450;
    transition: all 0.15s;
    margin: 1px 0;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 550;
}

.sidebar-link .method {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 6px;
    font-family: var(--font-mono);
}

.method-get {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
}

.method-post {
    background: rgba(99, 130, 255, 0.15);
    color: var(--accent);
}

/* === Main Content === */
.docs-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    max-width: 860px;
    padding: 48px 56px 120px;
}

/* === Typography === */
.docs-content h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.docs-content h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 56px 0 16px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
}

.docs-content h2:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.docs-content h3 {
    font-size: 18px;
    font-weight: 650;
    margin: 32px 0 12px;
    color: var(--text-primary);
}

.docs-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 15px;
}

.docs-content .lead {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.docs-content a {
    color: var(--accent);
    text-decoration: none;
}

.docs-content a:hover {
    text-decoration: underline;
}

.docs-content ul,
.docs-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.docs-content li {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 6px;
}

/* === Inline Code === */
.docs-content code:not(pre code) {
    background: var(--bg-inline-code);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
}

/* === Code Blocks === */
.code-block {
    position: relative;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0 24px;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.code-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-lang {
    background: rgba(99, 130, 255, 0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
    color: var(--green);
    border-color: rgba(52, 211, 153, 0.3);
}

.code-block pre {
    margin: 0;
    padding: 16px 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
    tab-size: 2;
}

/* === Code Tabs === */
.code-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.code-tab {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.code-tab:hover {
    color: var(--text-secondary);
}

.code-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.code-panel {
    display: none;
}

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

/* === Tables === */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
}

.docs-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.docs-table td {
    padding: 10px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.docs-table td code {
    background: var(--bg-inline-code);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: var(--font-mono);
}

/* === Callouts === */
.callout {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    border-left: 3px solid;
    font-size: 14px;
}

.callout p {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.callout-info {
    background: rgba(99, 130, 255, 0.08);
    border-color: var(--accent);
    color: #a8b4d0;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--orange);
    color: #d4a24a;
}

.callout-success {
    background: rgba(52, 211, 153, 0.08);
    border-color: var(--green);
    color: #6bc9a0;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Endpoint Card === */
.endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 20px 0;
}

.endpoint-method {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 5px;
    margin-right: 10px;
}

.endpoint-method.get {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
}

.endpoint-method.post {
    background: rgba(99, 130, 255, 0.15);
    color: var(--accent);
}

.endpoint-path {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.endpoint-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

/* === Pricing Cards === */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.pricing-name {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.pricing-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 8px 0;
}

.pricing-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin-top: 16px;
}

.pricing-features li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.pricing-features li::before {
    content: '✓';
    color: var(--green);
    margin-right: 8px;
    font-weight: 700;
}

/* === Badge === */
.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
}

.badge-blue {
    background: rgba(99, 130, 255, 0.15);
    color: var(--accent);
}

.badge-orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
}

/* === Params Table === */
.params-table td:first-child {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* === Section Marker === */
section[id] {
    scroll-margin-top: calc(var(--header-height) + 24px);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .docs-content {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 200;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-content {
        margin-left: 0;
        padding: 24px 20px 80px;
    }

    .menu-toggle {
        display: block;
    }

    .header-link {
        display: none;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 150;
        display: none;
    }

    .sidebar-overlay.open {
        display: block;
    }
}

/* === Scrollbar === */
.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* === Smart Models Section === */
.smart-models-intro {
    text-align: center;
    margin-bottom: 40px;
}

.smart-models-intro h2 {
    border-top: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    font-size: 28px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.smart-models-intro .lead {
    max-width: 600px;
    margin: 0 auto;
}

/* Tier legend */
.tier-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}

.tier-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.tier-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.tier-card.lite::before {
    background: linear-gradient(90deg, var(--green), var(--cyan));
}

.tier-card.pro::before {
    background: linear-gradient(90deg, var(--purple), var(--accent));
}

.tier-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tier-card h4 .tier-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.tier-badge.lite {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
}

.tier-badge.pro {
    background: rgba(167, 139, 250, 0.15);
    color: var(--purple);
}

.tier-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Model cards grid */
.model-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 28px 0;
}

.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    transition: all 0.25s ease;
    position: relative;
}

.model-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.model-card-accent {
    height: 3px;
}

.model-card-accent.flash {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.model-card-accent.pro {
    background: linear-gradient(90deg, var(--purple), #ec4899);
}

.model-card-accent.go {
    background: linear-gradient(90deg, var(--cyan), var(--accent));
}

.model-card-body {
    padding: 20px;
}

.model-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.model-card-icon {
    font-size: 24px;
    line-height: 1;
}

.model-card-title {
    flex: 1;
}

.model-card-title h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.model-card-title code {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.model-card-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.model-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}

.model-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.model-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.model-card-pricing {
    display: flex;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.model-price-item {
    text-align: center;
    flex: 1;
}

.model-price-item .price-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.model-price-item .price-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.model-price-item .price-unit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Tier separator */
.tier-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0 20px;
}

.tier-separator .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.tier-separator .label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.tier-separator .label.lite {
    color: var(--green);
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.tier-separator .label.pro {
    color: var(--purple);
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

/* Comparison table (docs version) */
.docs-comparison {
    margin: 40px 0 32px;
}

.docs-comparison h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.docs-comparison table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.docs-comparison th {
    text-align: center;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.docs-comparison th:first-child {
    text-align: left;
}

.docs-comparison th.hl {
    color: var(--accent);
    background: rgba(99, 130, 255, 0.06);
    position: relative;
}

.docs-comparison th.hl::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
}

.docs-comparison td {
    padding: 12px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.docs-comparison td:first-child {
    text-align: left;
    font-weight: 500;
}

.docs-comparison td.hl {
    background: rgba(99, 130, 255, 0.04);
    color: var(--text-primary);
    font-weight: 600;
}

.docs-comparison .check {
    color: var(--green);
    font-size: 16px;
}

.docs-comparison .cross {
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 16px;
}

/* CTA block */
.smart-cta {
    text-align: center;
    margin: 48px 0 24px;
    padding: 40px 32px;
    background: linear-gradient(135deg, rgba(99, 130, 255, 0.08), rgba(167, 139, 250, 0.06));
    border: 1px solid rgba(99, 130, 255, 0.15);
    border-radius: var(--radius);
}

.smart-cta h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.smart-cta p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.smart-cta .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.cta-btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.cta-btn.primary:hover {
    background: #5570ee;
    box-shadow: 0 0 40px rgba(99, 130, 255, 0.35);
    transform: translateY(-1px);
    text-decoration: none;
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

/* Response headers styled */
.headers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0 24px;
}

.header-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}

.header-item code {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 4px;
}

.header-item span {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .tier-legend {
        grid-template-columns: 1fr;
    }

    .model-cards-grid {
        grid-template-columns: 1fr;
    }

    .headers-grid {
        grid-template-columns: 1fr;
    }
}

/* === Syntax Colors (basic) === */
.tok-keyword {
    color: #c678dd;
}

.tok-string {
    color: #98c379;
}

.tok-comment {
    color: #5c6370;
    font-style: italic;
}

.tok-number {
    color: #d19a66;
}

.tok-function {
    color: #61afef;
}

.tok-property {
    color: #e06c75;
}

.tok-operator {
    color: #56b6c2;
}