@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-color: #0d1117;
    --side-bg: #161b22;
    --border-color: #30363d;
    --accent-color: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --text-color: #c9d1d9;
    --text-bright: #f0f6fc;
    --text-muted: #8b949e;
    --success: #3fb950;
    --code-bg: #161b22;
    --card-bg: #161b22;
    --card-hover-bg: #1c2128;
    --sidebar-width: 280px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    margin: 0;
    display: flex;
    line-height: 1.6;
    min-height: 100vh;
}

/* Sidebar */
aside {
    width: var(--sidebar-width);
    background-color: var(--side-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-container img {
    height: 48px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-bright);
    letter-spacing: -0.025em;
}

nav ul {
    list-style: none;
}

nav li {
    margin-bottom: 8px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
}

nav a.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
}

/* Main Content */
main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 80px 60px;
    max-width: 1200px;
}

section {
    margin-bottom: 120px;
}

h1,
h2,
h3 {
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Tabs Component */
.tabs {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.tabs label {
    padding: 10px 20px;
    background: var(--side-bg);
    border: 1px solid var(--border-color);
    border-bottom: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-radius: 6px 6px 0 0;
    margin-right: 4px;
}

.tabs input[type="radio"] {
    display: none;
}

.tab-content {
    width: 100%;
    order: 1;
    display: none;
    padding: 30px;
    background: var(--side-bg);
    border: 1px solid var(--border-color);
    border-radius: 0 6px 6px 6px;
}

.tabs input[type="radio"]:checked+label {
    background: var(--bg-color);
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.tabs input[type="radio"]:checked+label+.tab-content {
    display: block;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    padding: 1.25rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

code {
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace;
    font-size: 0.9rem;
}

/* Benchmarks */
.benchmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    background: var(--side-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.card h4 {
    margin-bottom: 8px;
    color: var(--text-bright);
}

.speed-tag {
    color: var(--success);
    font-weight: 700;
}

footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 1000px) {
    aside {
        width: 80px;
        padding: 20px 10px;
    }

    .logo-text,
    nav span {
        display: none;
    }

    main {
        margin-left: 80px;
        padding: 40px;
    }
}

/* API Reference Styles */

/* Sub-navigation for API categories */
.sub-nav {
    position: sticky;
    top: 0;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(12px);
    z-index: 100;
    padding: 12px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 20px;
    overflow-x: auto;
}

.sub-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.sub-nav a:hover {
    color: var(--accent-color);
}

.sub-nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

/* API Search Bar Refinement */
.search-container {
    margin-bottom: 48px;
    position: relative;
    max-width: 800px;
}

#apiSearch {
    width: 100%;
    background: var(--side-bg);
    border: 1px solid var(--border-color);
    padding: 16px 24px 16px 52px;
    border-radius: 12px;
    color: var(--text-bright);
    font-size: 1.1rem;
    font-family: var(--font-sans);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-container::before {
    content: "🔍";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.5;
    pointer-events: none;
}

#apiSearch:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 8px 16px rgba(0, 0, 0, 0.3);
    background: var(--card-hover-bg);
}

#apiSearch::placeholder {
    color: var(--text-muted);
}

/* Categorized Section Headers */
.api-section {
    margin-bottom: 64px;
}

.api-section h2 {
    font-size: 1.8rem;
    color: var(--text-bright);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin: 64px 0 32px 0;
    scroll-margin-top: 80px;
}

/* Re-styled Function Cards */
.function-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.function-card:hover {
    border-color: #444c56;
    background-color: var(--card-hover-bg);
}

.function-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.function-name {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--accent-color);
    font-weight: 600;
}

.pandas-resemblance {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(110, 118, 129, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.function-description {
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 24px;
}

.doc-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Parameters Table Refinement */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.params-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.param-name {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.param-type {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.return-section {
    background: rgba(63, 185, 80, 0.05);
    border: 1px solid rgba(63, 185, 80, 0.2);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.usage-notes {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 2px solid var(--border-color);
    padding-left: 16px;
}

.example-block {
    margin-top: 32px;
}

.example-block pre {
    background: #0d1117;
    margin: 12px 0 0 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.example-block code {
    color: var(--text-bright);
    line-height: 1.6;
}

.hidden {
    display: none;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.type-item {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.type-item strong {
    color: var(--accent-color);
    font-family: ui-monospace, monospace;
}

/* Overview Styles */
.content-box {
    background: var(--side-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin: 28px 0;
}

.content-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

ul.feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

ul.feature-list li {
    padding: 14px 0 14px 32px;
    position: relative;
    line-height: 1.8;
    border-bottom: 1px solid var(--border-color);
}

ul.feature-list li:last-child {
    border-bottom: none;
}

ul.feature-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.highlight-box {
    background: rgba(88, 166, 255, 0.05);
    border-left: 4px solid var(--accent-color);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 4px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 28px 0;
}

.comparison-card {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.comparison-card h4 {
    margin: 0 0 16px 0;
    color: var(--text-bright);
    font-size: 1.1rem;
}

.section-intro {
    font-size: 1.05rem;
    color: var(--text-bright);
    margin-bottom: 32px;
    line-height: 1.9;
}

/* Unified Footer */
footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

footer .dot {
    margin: 0 8px;
    color: #4b5563;
}

@media (max-width: 900px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.setup-step {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(168, 85, 247, 0.05));
    border-left: 4px solid #6366f1;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.step-number {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-align: center;
    line-height: 36px;
    font-weight: bold;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.screenshot {
    max-width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.code-block {
    background: var(--code-bg);
    color: var(--text-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}

.code-block code {
    color: var(--success);
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.warning-box strong {
    color: #fbbf24;
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.success-box strong {
    color: var(--success);
}

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.info-box strong {
    color: #60a5fa;
}

.file-path {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: #818cf8;
    font-weight: 600;
}

.command {
    background: var(--code-bg);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    display: inline-block;
    margin: 0.5rem 0;
    border: 1px solid var(--border-color);
}

ol.setup-checklist {
    list-style: none;
    counter-reset: item;
    padding-left: 0;
}

ol.setup-checklist li {
    counter-increment: item;
    margin-bottom: 0.5rem;
    padding-left: 2rem;
    position: relative;
}

ol.setup-checklist li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
    font-size: 1.2rem;
}

.toc {
    background: var(--side-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.toc h3 {
    margin-top: 0;
    color: var(--accent-color);
}

.toc ul {
    list-style: none;
    padding-left: 1rem;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.toc a:hover {
    color: var(--accent-color);
}

.setup-step h3 {
    color: var(--accent-color);
    margin-top: 1.5rem;
}

.setup-step ol,
.setup-step ul {
    margin-left: 1.5rem;
}

.setup-step li {
    margin: 0.5rem 0;
}

.setup-step a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.setup-step a:hover {
    text-decoration: underline;
}

.code-block pre {
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
}

.code-block pre code {
    color: var(--text-color);
    font-family: var(--font-mono);
}

/* Benchmark Styles */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.benchmark-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
    /* Offset for sticky nav */
}

.benchmark-section h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

/* Execution Pipeline Comparison Table */
.comparison-table-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.execution-comparison-table {
    width: 100%;
    max-width: 900px;
    border-collapse: collapse;
    background: var(--side-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.execution-comparison-table thead tr {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0.05));
}

.execution-comparison-table th {
    padding: 20px 24px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
    border-bottom: 2px solid var(--accent-color);
}

.execution-comparison-table th:first-child {
    border-right: 1px solid var(--border-color);
}

.execution-comparison-table td {
    padding: 16px 24px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

.execution-comparison-table td:first-child {
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
}

.execution-comparison-table tr:last-child td {
    border-bottom: none;
}

.execution-comparison-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.execution-comparison-table .highlight-cell {
    background: rgba(63, 185, 80, 0.08);
    color: var(--success);
}

.execution-comparison-table .highlight-cell strong {
    color: var(--success);
}

.execution-comparison-table code {
    background: rgba(88, 166, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .execution-comparison-table th,
    .execution-comparison-table td {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}