/* Mandate Labs Docs — Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
    --accent: #145f37;
    --accent-light: #e8f5ee;
    --accent-hover: #0e4528;
    --bg: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-code: #f4f6f8;
    --text-primary: #1a1a2e;
    --text-secondary: #525f7f;
    --text-tertiary: #8898aa;
    --border: #e6ebf1;
    --border-light: #f0f2f5;
    --card-shadow: 0 2px 4px rgba(0,0,0,0.04);
    --radius: 8px;
    --nav-height: 60px;
    --sidebar-width: 280px;
    --content-max: 780px;
    --code-keyword: #0550ae;
    --code-string: #116329;
    --code-comment: #6e7781;
    --code-func: #8250df;
    --code-number: #0550ae;
    --code-property: #953800;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* ── Top Navigation ──────────────────────────────────────── */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--text-primary);
}

.nav-brand svg {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: 48px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--accent);
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    padding: 24px 16px 24px 24px;
    border-right: 1px solid var(--border);
    background: var(--bg);
    z-index: 50;
}

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

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    padding-left: 12px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.15s;
    text-decoration: none;
}

.sidebar-nav li a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    text-decoration: none;
}

.sidebar-nav li a.active {
    color: var(--accent);
    background: var(--accent-light);
    font-weight: 500;
}

.sidebar-nav li.sub a {
    padding-left: 24px;
    font-size: 13px;
}

/* ── Main Content ────────────────────────────────────────── */

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--nav-height);
    padding: 40px 48px 80px;
    max-width: calc(var(--content-max) + 96px + var(--sidebar-width));
}

.content-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.content-header h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}

.content-header .subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.content h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.content ul, .content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Code Blocks ─────────────────────────────────────────── */

.code-group {
    margin: 20px 0 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.code-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
    font-family: inherit;
}

.code-tab:hover {
    color: var(--text-primary);
}

.code-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg);
}

.code-panel {
    display: none;
    background: var(--bg-code);
    padding: 20px 24px;
    overflow-x: auto;
}

.code-panel.active {
    display: block;
}

.code-panel pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.inline-code {
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--border-light);
}

/* Syntax highlighting */
.kw { color: var(--code-keyword); font-weight: 500; }
.str { color: var(--code-string); }
.cmt { color: var(--code-comment); font-style: italic; }
.fn { color: var(--code-func); }
.num { color: var(--code-number); }
.prop { color: var(--code-property); }

/* ── Callout boxes ───────────────────────────────────────── */

.callout {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    border-left: 4px solid;
}

.callout-info {
    background: #eff6ff;
    border-color: #3b82f6;
}

.callout-info .callout-title {
    color: #1d4ed8;
}

.callout-warning {
    background: #fffbeb;
    border-color: #f59e0b;
}

.callout-warning .callout-title {
    color: #b45309;
}

.callout-success {
    background: var(--accent-light);
    border-color: var(--accent);
}

.callout-success .callout-title {
    color: var(--accent);
}

.callout-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.callout p {
    margin: 0;
    font-size: 14px;
}

/* ── Tables ──────────────────────────────────────────────── */

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.doc-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.doc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.doc-table td code {
    background: var(--bg-code);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* ── Badges / Tags ───────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-critical { background: #1a1a2e; color: #fff; }

/* ── Step indicators ─────────────────────────────────────── */

.step {
    counter-increment: step-counter;
    position: relative;
    padding-left: 48px;
    margin-top: 40px;
    margin-bottom: 24px;
}

.step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps-container {
    counter-reset: step-counter;
}

/* ── Next steps cards ────────────────────────────────────── */

.next-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.next-step-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    text-decoration: none;
}

.next-step-card:hover {
    border-color: var(--accent);
    box-shadow: var(--card-shadow);
    text-decoration: none;
}

.next-step-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.next-step-card p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
}

/* ── Footer ──────────────────────────────────────────────── */

.footer {
    margin-left: var(--sidebar-width);
    padding: 24px 48px;
    border-top: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ── Mobile hamburger ────────────────────────────────────── */

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px 0;
    border-radius: 1px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .mobile-toggle {
        display: block;
    }

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

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

    .main-content {
        margin-left: 0;
        padding: 32px 20px 60px;
    }

    .footer {
        margin-left: 0;
        padding: 24px 20px;
    }

    .nav-links {
        margin-left: auto;
        gap: 16px;
    }

    .next-steps {
        grid-template-columns: 1fr;
    }
}
