/* ==========================================================================
   docs.css  —  API Documentation page  (dc-* namespace)
   Public /docs page + in-app Documentation sidebar link
   ========================================================================== */

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.doc-page {
    color: #e2e8f0;
    min-height: 100vh;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.doc-hero {
    background: linear-gradient(135deg, #0f1623 0%, #1a1f35 50%, #0f172a 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.doc-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 70% 50%, rgba(99, 102, 241, 0.12), transparent);
    pointer-events: none;
}

.doc-hero-inner {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.doc-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    margin-bottom: 1.25rem;
}

.doc-hero-eyebrow .material-symbols-outlined {
    font-size: 1rem;
}

.doc-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1.15;
    margin: 0 0 1rem;
}

.doc-hero-desc {
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 1.75rem;
    max-width: 580px;
}

.doc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.doc-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.doc-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.doc-meta-chip .material-symbols-outlined {
    font-size: 0.85rem;
    color: #22c55e;
}

/* ── Two-column layout ─────────────────────────────────────────────────────── */
.doc-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Left nav sidebar ──────────────────────────────────────────────────────── */
.doc-nav {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    /* Stick below the 4rem .site-header on the public page.
       overflow-x: clip on .site-wrapper means the window IS the scroll root,
       so sticky works correctly here. */
    top: 4.5rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    padding: 2rem 0 2rem 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* ── Dashboard context override ────────────────────────────────────────────── */
/* .dashboard-content (overflow-y: auto) is the scroll container here.        */
/* top offset only needs to clear padding, not a page-level header.           */
.dashboard-content .doc-nav {
    top: 1.75rem;
    max-height: calc(100vh - 5.5rem);
}

.doc-nav::-webkit-scrollbar {
    width: 4px;
}

.doc-nav::-webkit-scrollbar-track {
    background: transparent;
}

.doc-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.doc-nav-group {
    margin-bottom: 1.5rem;
}

.doc-nav-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    padding: 0 1rem;
    margin: 0 0 0.35rem;
}

.doc-nav-link {
    display: block;
    padding: 0.4rem 1rem;
    font-size: 0.86rem;
    color: #94a3b8;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    margin-right: 0;
}

.doc-nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.doc-nav-link.active {
    color: #818cf8;
    border-left-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    font-weight: 600;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
.doc-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 0 4rem 3rem;
}

/* ── Section ───────────────────────────────────────────────────────────────── */
.doc-section {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.5rem;
    scroll-margin-top: 2rem;
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.doc-sub-title {
    font-size: 1rem;
    font-weight: 600;
    color: #cbd5e1;
    margin: 1.75rem 0 0.6rem;
}

.doc-text {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.75;
    margin: 0 0 0.75rem;
}

.doc-list {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.75;
    padding-left: 1.25rem;
    margin: 0 0 1rem;
}

.doc-list li {
    margin-bottom: 0.4rem;
}

/* ── Inline code ───────────────────────────────────────────────────────────── */
.doc-inline-code {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

/* ── Code block ────────────────────────────────────────────────────────────── */
.doc-code-block {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin: 0.75rem 0;
    position: relative;
}

.doc-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.doc-code-copy-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.doc-code-copy-btn:hover {
    color: #94a3b8;
    background: rgba(255,255,255,0.06);
}

.doc-code-copy-btn .material-symbols-outlined {
    font-size: 0.9rem;
}

.doc-code {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #e2e8f0;
    tab-size: 2;
    white-space: pre;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.doc-code::-webkit-scrollbar {
    height: 5px;
}

.doc-code::-webkit-scrollbar-track {
    background: transparent;
}

.doc-code::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.doc-tabs {
    margin: 0.75rem 0;
}

.doc-tab-bar {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0.4rem 0.4rem 0;
    flex-wrap: wrap;
}

.doc-tab-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
}

.doc-tab-btn:hover {
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
}

.doc-tab-btn.active {
    color: #a5b4fc;
    background: #0d1117;
}

.doc-tabs .doc-code-block {
    border-radius: 0 0 10px 10px;
    margin-top: 0;
}

/* ── Endpoint card ─────────────────────────────────────────────────────────── */
.doc-endpoint {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid #6366f1;
    border-radius: 0 10px 10px 0;
    padding: 1.1rem 1.25rem;
    margin: 0.75rem 0;
}

.doc-endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.doc-endpoint-path {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88rem;
    color: #e2e8f0;
    font-weight: 600;
}

.doc-endpoint-desc {
    color: #64748b;
    font-size: 0.82rem;
    margin-left: auto;
    font-style: italic;
}

/* ── Method badges ─────────────────────────────────────────────────────────── */
.doc-badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'Fira Code', monospace;
}

.doc-badge--get    { background: rgba(34, 197, 94, 0.15);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.doc-badge--post   { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.doc-badge--put    { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.doc-badge--delete { background: rgba(239, 68, 68, 0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.doc-badge--patch  { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.3); }

/* ── Table ──────────────────────────────────────────────────────────────────── */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    margin: 0.5rem 0;
}

.doc-table th {
    text-align: left;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-table td {
    padding: 0.55rem 0.75rem;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.doc-table code {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85em;
}

.doc-param-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #475569;
    margin: 0.85rem 0 0.3rem;
}

/* ── Alert boxes ───────────────────────────────────────────────────────────── */
.doc-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0.75rem 0;
}

.doc-alert .material-symbols-outlined {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05em;
}

.doc-alert--info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

.doc-alert--info .material-symbols-outlined {
    color: #818cf8;
}

.doc-alert--warning {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

.doc-alert--warning .material-symbols-outlined {
    color: #fbbf24;
}

/* ── Steps ──────────────────────────────────────────────────────────────────── */
.doc-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 1.25rem 0;
    position: relative;
}

.doc-step {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.doc-step:last-child {
    padding-bottom: 0;
}

.doc-step::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 2.2rem;
    bottom: 0;
    width: 1px;
    background: rgba(99, 102, 241, 0.25);
}

.doc-step:last-child::before {
    display: none;
}

.doc-step-num {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    background: rgba(99, 102, 241, 0.15);
    border: 2px solid rgba(99, 102, 241, 0.4);
    color: #818cf8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}

.doc-step-body {
    flex: 1;
    padding-top: 0.15rem;
}

.doc-step-title {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.92rem;
    margin: 0 0 0.3rem;
}

.doc-step-desc {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.65;
    margin: 0;
}

/* ── Base URL bar ──────────────────────────────────────────────────────────── */
.doc-base-url {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin: 1rem 0;
}

.doc-base-url-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6366f1;
    white-space: nowrap;
}

.doc-base-url code {
    font-family: 'Fira Code', monospace;
    color: #a5b4fc;
    font-size: 0.88rem;
}

/* ── Use cases grid ────────────────────────────────────────────────────────── */
.doc-use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.doc-use-case {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 1rem;
}

.doc-use-case .material-symbols-outlined {
    font-size: 1.5rem;
    color: #6366f1;
    display: block;
    margin-bottom: 0.4rem;
}

.doc-use-case strong {
    font-size: 0.86rem;
    color: #e2e8f0;
    display: block;
    margin-bottom: 0.25rem;
}

.doc-use-case p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.55;
}

/* ── Status badges ─────────────────────────────────────────────────────────── */
.doc-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.76rem;
    font-family: monospace;
}

.doc-status--200, .doc-status--201, .doc-status--202 {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.doc-status--400, .doc-status--401, .doc-status--402,
.doc-status--403, .doc-status--404, .doc-status--409 {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.doc-status--500 {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* ── CTA section ───────────────────────────────────────────────────────────── */
.doc-cta {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2.5rem;
    text-align: center;
}

.doc-cta-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.6rem;
}

.doc-cta-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
}

.doc-cta-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Landing: Developer section ────────────────────────────────────────────── */
.dev-section {
    padding: 5rem 0;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.dev-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 60% at 80% 50%, rgba(99, 102, 241, 0.08), transparent);
    pointer-events: none;
}

.dev-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.dev-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 1rem;
}

.dev-label .material-symbols-outlined {
    font-size: 0.95rem;
}

.dev-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1.2;
    margin: 0 0 1rem;
}

.dev-desc {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.75;
    margin: 0 0 1.5rem;
}

.dev-bullets {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.75rem;
}

.dev-bullet {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.dev-bullet-icon {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1em;
}

.dev-bullet-icon .material-symbols-outlined {
    font-size: 0.85rem;
    color: #818cf8;
}

.dev-bullet-text {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
}

.dev-bullet-text strong {
    color: #cbd5e1;
}

.dev-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Code window for developer section */
.dev-code-window {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.dev-code-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dev-titlebar-dots {
    display: flex;
    gap: 0.35rem;
}

.dev-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
}

.dev-dot-red    { background: #ef4444; }
.dev-dot-amber  { background: #f59e0b; }
.dev-dot-green  { background: #22c55e; }

.dev-code-lang {
    margin-left: auto;
    font-size: 0.72rem;
    color: #475569;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.dev-code-pre {
    margin: 0;
    padding: 1.25rem;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #e2e8f0;
    overflow-x: auto;
    white-space: pre;
}

/* Syntax-like coloring */
.sc-keyword  { color: #c084fc; }
.sc-string   { color: #86efac; }
.sc-comment  { color: #475569; font-style: italic; }
.sc-key      { color: #93c5fd; }
.sc-value    { color: #f9a8d4; }
.sc-func     { color: #fbbf24; }
.sc-url      { color: #67e8f9; text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .doc-layout {
        flex-direction: column;
    }

    .doc-nav {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        padding: 1rem 0 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        display: flex;
        flex-wrap: wrap;
        gap: 0;
    }

    .doc-nav-group {
        margin-bottom: 0.5rem;
    }

    .doc-nav-group-label {
        display: none;
    }

    .doc-nav-link {
        display: inline-block;
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.4rem 0.7rem;
        white-space: nowrap;
    }

    .doc-nav-link.active {
        border-left-color: transparent;
        border-bottom-color: #6366f1;
    }

    .doc-content {
        padding: 2rem 0;
    }

    .dev-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 600px) {
    .doc-hero {
        padding: 2.5rem 0 2rem;
    }

    .doc-endpoint-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-endpoint-desc {
        margin-left: 0;
    }

    .doc-use-cases {
        grid-template-columns: 1fr 1fr;
    }
}
