/* Assimetrix Ajuda — Docs Layout v2
 * Layout de docs de produto (Stripe/Firebase/Notion style):
 * Header fino + sidebar persistente à esquerda + conteúdo central + TOC opcional à direita.
 */

:root {
    --docs-primary: #2d5f5d;
    --docs-primary-light: #3a7673;
    --docs-primary-dark: #1e4745;
    --docs-accent: #5fa7a3;
    --docs-accent-light: #7bc4c0;
    --docs-bg: #ffffff;
    --docs-bg-alt: #f8fafa;
    --docs-header-bg: #0a1a19;
    --docs-header-text: #b8d4d2;
    --docs-header-text-strong: #ffffff;
    --docs-border: #e5e7eb;
    --docs-border-strong: #d1d5db;
    --docs-text: #1f2937;
    --docs-text-secondary: #4b5563;
    --docs-text-muted: #6b7280;
    --docs-sidebar-width: 240px;
    --docs-toc-width: 200px;
    --docs-header-height: 52px;
    --docs-content-max: 780px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--docs-text);
    background: var(--docs-bg);
    line-height: 1.65;
    font-size: 15px;
}

/* ==================== HEADER ==================== */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--docs-header-height);
    background: var(--docs-header-bg);
    border-bottom: 1px solid rgba(95, 167, 163, 0.15);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 24px;
}
.docs-header-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--docs-header-text-strong);
    text-decoration: none;
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.docs-header-logo svg { flex-shrink: 0; }
.docs-header-title {
    color: var(--docs-header-text);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.docs-header-title::before {
    content: "/";
    color: rgba(184, 212, 210, 0.4);
    margin-right: 10px;
}
.docs-header-spacer { flex: 1; }
.docs-header-search {
    position: relative;
    max-width: 320px;
    width: 100%;
}
.docs-header-search input {
    width: 100%;
    padding: 6px 12px 6px 34px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--docs-header-text-strong);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: background 0.15s, border-color 0.15s;
}
.docs-header-search input:focus {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--docs-accent);
}
.docs-header-search input::placeholder { color: rgba(184, 212, 210, 0.6); }
.docs-header-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: rgba(184, 212, 210, 0.7);
    pointer-events: none;
}

/* Mobile hamburger */
.docs-header-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--docs-header-text-strong);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
}
.docs-header-menu-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ==================== MAIN LAYOUT ==================== */
.docs-layout {
    display: grid;
    grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr) var(--docs-toc-width);
    max-width: 1440px;
    margin: 0 auto;
}
.docs-sidebar { grid-column: 1 / 2; }
.docs-content { grid-column: 2 / 3; }
.docs-toc     { grid-column: 3 / 4; }
/* Overlay é inserido no DOM via JS mesmo no desktop — precisa esconder por padrão,
   senão vira grid item invisível empurrando o content pra próxima linha */
.docs-sidebar-overlay { display: none; }
/* Quando TOC está oculto (empty), content ocupa também a 3ª coluna pra não sobrar espaço */
.docs-layout.no-toc {
    grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr);
}
.docs-layout.no-toc .docs-content { grid-column: 2 / 3; }
.docs-layout.no-toc .docs-toc { display: none; }

/* ==================== SIDEBAR (LEFT) ==================== */
.docs-sidebar {
    position: sticky;
    top: var(--docs-header-height);
    max-height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 24px 8px 40px 24px;
    border-right: 1px solid var(--docs-border);
    background: var(--docs-bg);
    font-size: 14px;
}
.docs-sidebar-category {
    margin-bottom: 20px;
}
.docs-sidebar-category-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--docs-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}
.docs-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.docs-sidebar-list a {
    display: block;
    padding: 6px 12px;
    color: var(--docs-text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13.5px;
    line-height: 1.4;
    transition: background 0.12s, color 0.12s;
    border-left: 2px solid transparent;
    margin-left: -2px;
}
.docs-sidebar-list a:hover {
    background: var(--docs-bg-alt);
    color: var(--docs-primary-dark);
}
.docs-sidebar-list a.active {
    color: var(--docs-primary);
    background: rgba(95, 167, 163, 0.08);
    border-left-color: var(--docs-accent);
    font-weight: 600;
}
.docs-sidebar-empty {
    padding: 6px 12px;
    color: var(--docs-text-muted);
    font-size: 12.5px;
    font-style: italic;
}

/* ==================== CONTENT (CENTER) ==================== */
.docs-content {
    padding: 24px 40px 80px !important;
    margin: 0 !important;
    max-width: var(--docs-content-max);
    width: 100%;
    justify-self: start;
}
.docs-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.docs-breadcrumb {
    font-size: 12.5px;
    color: var(--docs-text-muted);
    margin-bottom: 12px;
}
.docs-breadcrumb a {
    color: var(--docs-primary);
    text-decoration: none;
}
.docs-breadcrumb a:hover { text-decoration: underline; }

.docs-content h1 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--docs-text);
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.docs-content > p:first-of-type,
.docs-content .docs-lede {
    font-size: 16px;
    color: var(--docs-text-secondary);
    line-height: 1.6;
    margin: 0 0 32px;
}
.docs-content h2 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--docs-text);
    margin: 40px 0 12px;
    padding-top: 8px;
    scroll-margin-top: calc(var(--docs-header-height) + 16px);
}
.docs-content h3 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--docs-primary-dark);
    margin: 28px 0 10px;
    scroll-margin-top: calc(var(--docs-header-height) + 16px);
}
.docs-content p { margin: 0 0 14px; color: var(--docs-text); }
.docs-content strong { color: var(--docs-text); font-weight: 600; }
.docs-content ul, .docs-content ol { margin: 0 0 16px 22px; padding: 0; }
.docs-content li { margin-bottom: 6px; }
.docs-content code {
    background: var(--docs-bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--docs-primary-dark);
}
.docs-content a {
    color: var(--docs-primary);
    text-decoration: underline;
    text-decoration-color: rgba(95, 167, 163, 0.4);
    text-underline-offset: 3px;
}
.docs-content a:hover { text-decoration-color: var(--docs-accent); }

/* Steps */
.docs-content .steps {
    counter-reset: step-counter;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.docs-content .steps li {
    counter-increment: step-counter;
    position: relative;
    padding: 14px 18px 14px 52px;
    background: var(--docs-bg-alt);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 14.5px;
}
.docs-content .steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    background: var(--docs-primary);
    color: #fff;
    border-radius: 50%;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}

/* Callouts */
.docs-content .callout {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 18px 0;
    border-left: 3px solid;
    font-size: 14.5px;
    display: flex; gap: 12px; align-items: flex-start;
}
.docs-content .callout .cico { flex-shrink: 0; font-size: 20px; line-height: 1; }
.docs-content .callout p { margin: 0; }
.docs-content .callout-tip { background: #f0f9f8; border-color: var(--docs-accent); color: #1e4745; }
.docs-content .callout-warn { background: #fef3c7; border-color: #f59e0b; color: #78350f; }
.docs-content .callout-info { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }

/* Path (menu breadcrumb inline) */
.docs-content .path {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--docs-bg-alt);
    border: 1px solid var(--docs-border);
    border-radius: 5px;
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 0.9em;
    color: var(--docs-primary-dark);
    font-weight: 500;
    text-decoration: none;
}

/* Field table */
.docs-content .field-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14px;
}
.docs-content .field-table th {
    text-align: left;
    background: var(--docs-bg-alt);
    padding: 10px 14px;
    font-weight: 600;
    color: var(--docs-primary-dark);
    border-bottom: 2px solid var(--docs-border);
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 13px;
}
.docs-content .field-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--docs-border);
    vertical-align: top;
    color: var(--docs-text-secondary);
}
.docs-content .field-table td:first-child {
    font-weight: 600;
    color: var(--docs-text);
    white-space: nowrap;
}

/* Screenshot pending marker — OCULTO em produção.
   Quando as imagens forem adicionadas, remover o display:none e substituir os
   <p class="screenshot-todo"> por <img> reais nos artigos. */
.docs-content .screenshot-todo {
    display: none !important;
    margin: 16px 0;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px dashed #f59e0b;
    border-radius: 6px;
    font-size: 12.5px;
    color: #78350f;
    font-style: italic;
}
.docs-content .screenshot-todo::before { content: "📸 "; }

/* FAQ */
.docs-content .faq { margin-top: 40px; }
.docs-content .faq details {
    background: var(--docs-bg-alt);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
}
.docs-content .faq details[open] {
    background: #fff;
    box-shadow: 0 2px 8px rgba(45,95,93,0.06);
}
.docs-content .faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--docs-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14.5px;
}
.docs-content .faq summary::-webkit-details-marker { display: none; }
.docs-content .faq summary::after {
    content: "+";
    font-size: 18px;
    color: var(--docs-accent);
    transition: transform 0.2s;
}
.docs-content .faq details[open] summary::after { transform: rotate(45deg); }
.docs-content .faq details p { margin: 10px 0 0; color: var(--docs-text-secondary); font-size: 14px; }

/* ==================== TOC (RIGHT) ==================== */
.docs-toc {
    position: sticky;
    top: var(--docs-header-height);
    max-height: calc(100vh - var(--docs-header-height));
    overflow-y: auto;
    padding: 28px 24px 40px 8px;
    font-size: 13px;
}
.docs-toc-label {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--docs-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
    padding-left: 12px;
}
.docs-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--docs-border);
}
.docs-toc-list a {
    display: block;
    padding: 5px 12px;
    color: var(--docs-text-muted);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color 0.12s, border-color 0.12s;
}
.docs-toc-list a:hover { color: var(--docs-primary-dark); }
.docs-toc-list a.active {
    color: var(--docs-primary);
    border-left-color: var(--docs-accent);
    font-weight: 600;
}

/* ==================== HUB (landing) ==================== */
.docs-hub-welcome {
    margin-bottom: 32px;
}
.docs-hub-search {
    max-width: 560px;
    position: relative;
    margin: 20px 0 40px;
}
.docs-hub-search input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--docs-border-strong);
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.docs-hub-search input:focus {
    border-color: var(--docs-accent);
    box-shadow: 0 0 0 3px rgba(95, 167, 163, 0.12);
}
.docs-hub-search svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--docs-text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.docs-hub-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.docs-hub-cat-card {
    display: block;
    padding: 18px 20px;
    background: var(--docs-bg);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.docs-hub-cat-card:hover {
    border-color: var(--docs-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 95, 93, 0.08);
}
.docs-hub-cat-icon {
    font-size: 20px;
    margin-bottom: 8px;
    display: block;
}
.docs-hub-cat-label {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--docs-text);
    margin: 0 0 4px;
}
.docs-hub-cat-count {
    font-size: 12.5px;
    color: var(--docs-text-muted);
    margin: 0 0 8px;
}
.docs-hub-cat-desc {
    font-size: 13.5px;
    color: var(--docs-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.docs-hub-section {
    margin-bottom: 40px;
}
.docs-hub-section-title {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--docs-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 14px;
}
.docs-hub-recent {
    display: grid;
    gap: 8px;
}
.docs-hub-recent-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 14px;
    background: var(--docs-bg-alt);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s;
}
.docs-hub-recent-item:hover { border-color: var(--docs-accent); }
.docs-hub-recent-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--docs-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.docs-hub-recent-title {
    font-size: 14px;
    color: var(--docs-text);
    flex: 1;
}
.docs-hub-recent-time {
    font-size: 12px;
    color: var(--docs-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.docs-hub-support {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(95,167,163,0.08) 0%, rgba(95,167,163,0.02) 100%);
    border: 1px solid rgba(95, 167, 163, 0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.docs-hub-support h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--docs-primary-dark);
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 600;
}
.docs-hub-support p { margin: 0; font-size: 13.5px; color: var(--docs-text-secondary); flex: 1; min-width: 240px; }
.docs-hub-support-info { flex: 1; min-width: 240px; }
.docs-hub-support-btn {
    padding: 10px 18px;
    background: var(--docs-primary);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: background 0.15s;
    white-space: nowrap;
}
.docs-hub-support-btn:hover { background: var(--docs-primary-dark); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr);
    }
    .docs-toc { display: none; }
}

@media (max-width: 768px) {
    :root {
        --docs-header-height: 48px;
    }
    .docs-header-menu-btn { display: inline-flex; }
    .docs-header-title { display: none; }
    .docs-header-search { max-width: none; }

    .docs-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .docs-sidebar {
        position: fixed;
        top: var(--docs-header-height);
        left: 0;
        width: 280px;
        height: calc(100vh - var(--docs-header-height));
        background: #fff;
        border-right: 1px solid var(--docs-border);
        z-index: 90;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.06);
    }
    .docs-sidebar.open { transform: translateX(0); }

    .docs-sidebar-overlay {
        display: none;
        position: fixed;
        inset: var(--docs-header-height) 0 0 0;
        background: rgba(0,0,0,0.35);
        z-index: 80;
    }
    .docs-sidebar.open + .docs-sidebar-overlay { display: block; }

    .docs-content {
        padding: 24px 20px 60px;
    }
    .docs-content h1 { font-size: 26px; }
    .docs-content h2 { font-size: 19px; }
}
