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

:root {
    --bg: #0a0a0f;
    --surface: #111118;
    --surface2: #18181f;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-faint: #475569;
    --accent: #7c3aed;
    --accent2: #4f46e5;
    --green: #22c55e;
    --blue: #3b82f6;
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --radius: 10px;
    --font: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.7;
}

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

a:hover {
    text-decoration: underline;
}

/* ── Topbar ──────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    width: var(--sidebar-w);
}

.topbar-center {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 6px;
    border-radius: 6px;
    display: none;
    transition: color 0.2s;
}

.sidebar-toggle:hover {
    color: var(--text);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.2rem;
}

.logo-docs {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: text;
    transition: border-color 0.2s;
    color: var(--text-muted);
}

.search-box:focus-within {
    border-color: var(--accent);
    color: var(--text);
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.88rem;
    flex: 1;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.72rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

.topbar-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity 0.2s;
}

.topbar-cta:hover {
    opacity: 0.9;
    text-decoration: none;
}

/* ── Lang Switcher ───────────────────────────── */
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font);
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--text);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
}

/* ── Layout ──────────────────────────────────── */
.layout {
    display: flex;
    padding-top: var(--topbar-h);
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    width: var(--sidebar-w);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 24px 12px;
    border-right: 1px solid var(--border);
    background: var(--bg);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 0 8px;
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--surface2);
    color: var(--text);
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent);
    font-weight: 500;
}

.sidebar-link i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

/* ── Main Content ────────────────────────────── */
.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
}

.content-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* ── Typography ──────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb i {
    font-size: 0.6rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.2;
}

h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

p.lead {
    font-size: 1.05rem;
    color: #b0bdd4;
    margin-bottom: 28px;
}

/* ── Callouts ────────────────────────────────── */
.callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 24px 0;
    border: 1px solid;
}

.callout-icon {
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.callout p {
    margin: 4px 0 0;
    font-size: 0.9rem;
}

.callout-tip {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.25);
}

.callout-tip .callout-icon {
    color: var(--accent);
}

.callout-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
}

.callout-info .callout-icon {
    color: var(--blue);
}

.callout-warning {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.25);
}

.callout-warning .callout-icon {
    color: #eab308;
}

/* ── Feature Cards Grid ──────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0 32px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    display: block;
}

.feature-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
    text-decoration: none;
    transform: translateY(-2px);
}

.feature-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── Steps ───────────────────────────────────── */
.steps {
    margin: 20px 0;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: none;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-body h3 {
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.step-body p {
    margin: 0;
    font-size: 0.88rem;
}

/* ── Code ────────────────────────────────────── */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: #c4b5fd;
}

pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.88rem;
}

/* ── Page Navigation ─────────────────────────── */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.page-nav-prev,
.page-nav-next {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: gap 0.2s;
}

.page-nav-prev:hover,
.page-nav-next:hover {
    gap: 12px;
    text-decoration: none;
}

/* ── Search Results ──────────────────────────── */
.search-results {
    position: absolute;
    top: calc(var(--topbar-h) + 4px);
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: none;
}

.search-results.open {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--text);
    transition: background 0.1s;
}

.search-result-item:hover {
    background: var(--surface2);
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 2px;
}

.search-result-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar-toggle {
        display: flex;
    }

    .topbar-left {
        width: auto;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s;
        z-index: 90;
    }

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

    .content {
        margin-left: 0;
    }

    .content-inner {
        padding: 32px 20px 60px;
    }

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

    .topbar-center {
        display: none;
    }

    h1 {
        font-size: 1.7rem;
    }

    .search-results {
        width: 90vw;
        left: 5vw;
        transform: none;
    }
}

@media (max-width: 600px) {
    .lang-switcher {
        display: none;
    }

    .topbar-cta span {
        display: none;
    }
}