/* =========================================================
   DOCS INNER PAGES (shared by all /docs/*.html pages)
   ========================================================= */

.docs-inner-page {
    position: relative;
    overflow: hidden;
}

.docs-inner-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at 82% 20%, rgba(56, 189, 248, 0.10), transparent 22%);
    pointer-events: none;
    z-index: 0;
}

.docs-inner-page > * {
    position: relative;
    z-index: 1;
}

/* =========================================================
   HEADER (same as docs.html)
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.topbar {
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    background: rgba(248, 250, 252, 0.8);
}

.topbar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 42px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-nav a {
    color: #475569;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topbar-nav a:hover,
.topbar-nav a.active {
    color: #0f172a;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 86px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.24);
}

.brand-text {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.site-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    color: #334155;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #2563eb;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* =========================================================
   DOCS LAYOUT (sidebar + content)
   ========================================================= */

.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - 128px);
    padding: 64px 0 96px;
}

.docs-sidebar {
    position: sticky;
    top: 128px;
    align-self: start;
    padding-right: 40px;
}

.docs-sidebar-title {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.docs-sidebar-nav .sidebar-group-label {
    display: block;
    margin-top: 18px;
    margin-bottom: 2px;
    padding: 0 14px;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    list-style: none;
    pointer-events: none;
}

.docs-sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-sidebar-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.docs-sidebar-nav a:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
}

.docs-sidebar-nav a.active {
    color: #f8fbff;
    background: rgba(99, 102, 241, 0.18);
    font-weight: 600;
}

/* =========================================================
   DOCS CONTENT
   ========================================================= */

.docs-content {
    max-width: 760px;
}

.docs-content-header {
    margin-bottom: 48px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.docs-kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 14px;
    border-radius: 100px;
    background: rgba(99, 102, 241, 0.16);
    color: #818cf8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-content-header h1 {
    margin: 0 0 14px;
    color: #f8fbff;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.docs-content-header p {
    margin: 0;
    color: #c8d4e3;
    font-size: 1.06rem;
    line-height: 1.75;
    max-width: 60ch;
}

/* Sections */
.docs-section {
    margin-bottom: 48px;
}

.docs-section h2 {
    margin: 0 0 16px;
    color: #f1f5f9;
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.docs-section h3 {
    margin: 24px 0 10px;
    color: #e2e8f0;
    font-size: 1.06rem;
    font-weight: 600;
}

.docs-section p {
    margin: 0 0 16px;
    color: #94a3b8;
    line-height: 1.8;
}

.docs-section ul,
.docs-section ol {
    margin: 0 0 16px;
    padding-left: 20px;
    color: #94a3b8;
    line-height: 1.8;
}

.docs-section li {
    margin-bottom: 6px;
}

/* Code blocks */
.docs-code {
    margin: 20px 0;
    padding: 20px 24px;
    border-radius: 14px;
    background: rgba(13, 20, 37, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow-x: auto;
}

.docs-code pre {
    margin: 0;
    color: #c8d4e3;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre;
}

.docs-code-label {
    display: block;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Inline code */
.docs-section code {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.88em;
}

/* Info / note callout */
.docs-callout {
    margin: 20px 0;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.docs-callout p {
    margin: 0;
    color: #93c5fd;
    font-size: 0.95rem;
}

/* Table */
.docs-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.docs-table th {
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.docs-table td {
    padding: 12px 16px;
    color: #c8d4e3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
}

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

/* Nav between pages */
.docs-nav-footer {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.docs-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 12px;
    background: rgba(24, 35, 58, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: border-color 0.2s ease, background 0.2s ease;
    min-width: 180px;
}

.docs-nav-link:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.1);
}

.docs-nav-link-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.docs-nav-link-title {
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 600;
}

.docs-nav-link.next {
    text-align: right;
    margin-left: auto;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    padding: 40px 0 32px;
    color: #cbd5e1;
    background: #020617;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.footer-bottom {
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
    .topbar { display: none; }

    .header-inner {
        min-height: 78px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .site-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding-bottom: 16px;
    }

    .nav-list { flex-wrap: wrap; gap: 16px 22px; }
    .header-actions { gap: 10px; }

    .docs-layout {
        grid-template-columns: 1fr;
        padding: 48px 0 72px;
    }

    .docs-sidebar {
        position: static;
        padding-right: 0;
        padding-bottom: 36px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        margin-bottom: 36px;
    }

    .docs-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .docs-content-header h1 {
        font-size: 1.9rem;
    }

    .docs-nav-footer {
        flex-direction: column;
    }

    .docs-nav-link.next {
        text-align: left;
        margin-left: 0;
        width: 100%;
    }

    .docs-nav-link {
        width: 100%;
    }
}
