/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Backgrounds */
    --bg-primary: #0f172a;
    /* Main background */
    --bg-secondary: #1e293b;
    /* Sidebar, code blocks */
    --bg-accent: #334155;
    /* Hover states, separators */

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-highlight: #e2e8f0;

    /* Accents */
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* =========================================
   2. LAYOUT
   ========================================= */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    padding: 32px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-content {
    margin-left: 280px;
    padding: 64px 120px;
    max-width: 1200px;
    flex: 1;
}

/* =========================================
   3. SIDEBAR NAVIGATION
   ========================================= */
.sidebar-logo {
    padding: 0 32px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
}

.sidebar-logo span {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-label {
    padding: 0 32px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.nav-item {
    display: block;
    padding: 10px 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--accent-purple);
    background-color: rgba(139, 92, 246, 0.05);
    border-left-color: var(--accent-purple);
}

/* =========================================
   4. TYPOGRAPHY & HEADINGS
   ========================================= */
h1 {
    color: var(--text-primary);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

h2 {
    color: var(--text-primary);
    font-size: 26px;
    font-weight: 700;
    margin-top: 64px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

h2::after {
    content: '';
    width: 40px;
    height: 4px;
    background-color: var(--accent-purple);
    border-radius: 2px;
}

h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

p {
    margin-bottom: 20px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text-highlight);
}

/* =========================================
   5. COMPONENTS (Cards, Grids, Tables)
   ========================================= */
.card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Feature Matrix & Model Pricing Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

.model-name {
    color: var(--text-primary);
    font-weight: 600;
}

.token-price {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-purple);
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

/* Error Grid */
.error-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.error-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.error-code {
    font-weight: 700;
    font-size: 16px;
}

/* Parameter Box */
.parameter-row {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.parameter-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.parameter-name {
    color: var(--accent-purple);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.parameter-type {
    color: var(--text-muted);
    font-size: 12px;
}

.parameter-req {
    color: var(--accent-amber);
    font-size: 11px;
    font-weight: 700;
}

/* =========================================
   6. CODE BLOCKS & TABS
   ========================================= */
.code-container {
    background-color: #0c111d;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin: 24px 0;
}

.code-header {
    background-color: rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 44px;
}

.tab-list {
    display: flex;
    gap: 4px;
    height: 100%;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    height: 100%;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-purple);
}

.lang-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

pre {
    padding: 24px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Syntax Highlighting (Dark Mono Theme) */
.syntax-key {
    color: #9cdcfe;
}

.syntax-val {
    color: #ce9178;
}

.syntax-comment {
    color: #6a9955;
    font-style: italic;
}

.syntax-string {
    color: #ce9178;
}

.syntax-keyword {
    color: #569cd6;
}

.syntax-fn {
    color: #dcdcaa;
}

.syntax-num {
    color: #b5cea8;
}

.syntax-punct {
    color: #d4d4d4;
}

/* =========================================
   7. ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-content {
        padding: 48px 40px;
    }
}