/* ============================================
   Quero Van Escolar - Documentacao
   Estilo moderno minimalista
   ============================================ */

:root {
    --color-bg: #ffffff;
    --color-bg-sidebar: #f8fafc;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-accent: #2563eb;
    --color-accent-light: #dbeafe;
    --color-accent-dark: #1d4ed8;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #dc2626;
    --color-code-bg: #f1f5f9;
    --sidebar-width: 280px;
    --header-height: 64px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text);
}

.header-logo svg {
    width: 32px;
    height: 32px;
}

.header-logo span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-logo .badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--color-accent-light);
    color: var(--color-accent);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 4px;
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--color-bg-sidebar);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.header-search input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-light);
}

.header-search input::placeholder {
    color: var(--color-text-light);
}

.header-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-light);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* ---- LAYOUT ---- */
.layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 50;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

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

.sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
    padding: 8px 24px;
}

.sidebar-link {
    display: block;
    padding: 6px 24px;
    font-size: 14px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-link.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    background: var(--color-accent-light);
    font-weight: 500;
}

.sidebar-sublink {
    padding-left: 40px;
    font-size: 13px;
}

/* ---- MAIN CONTENT ---- */
.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    max-width: 860px;
    padding: 40px 48px 80px;
}

/* ---- TYPOGRAPHY ---- */
h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--color-text);
}

h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-top: 56px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 36px;
    margin-bottom: 12px;
    color: var(--color-text);
}

h4 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--color-text);
}

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

.lead {
    font-size: 18px;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 32px;
}

/* ---- SECTION ---- */
.doc-section {
    padding-top: 8px;
}

.doc-section + .doc-section {
    margin-top: 16px;
}

/* ---- LISTS ---- */
ul, ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

li {
    margin-bottom: 6px;
}

li strong {
    color: var(--color-text);
}

/* ---- CARDS ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.feature-card {
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

.feature-card-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
}

.feature-card h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.feature-card p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---- INFO BOXES ---- */
.info-box {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid;
}

.info-box.tip {
    background: #f0fdf4;
    border-color: var(--color-success);
    color: #166534;
}

.info-box.warning {
    background: #fffbeb;
    border-color: var(--color-warning);
    color: #92400e;
}

.info-box.note {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
    color: #1e40af;
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
}

/* ---- TABLES ---- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

thead th {
    text-align: left;
    padding: 10px 16px;
    background: var(--color-bg-sidebar);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

tbody tr:hover {
    background: rgba(0, 0, 0, 0.01);
}

/* ---- CODE ---- */
code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--color-code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-accent-dark);
}

/* ---- STATUS BADGES ---- */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

.badge-blue {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.badge-green {
    background: #dcfce7;
    color: var(--color-success);
}

.badge-yellow {
    background: #fef3c7;
    color: #b45309;
}

.badge-red {
    background: #fee2e2;
    color: var(--color-danger);
}

/* ---- STEPS ---- */
.steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
    margin: 24px 0;
}

.steps li {
    position: relative;
    padding-left: 48px;
    padding-bottom: 24px;
    border-left: 2px solid var(--color-border);
    margin-left: 16px;
    margin-bottom: 0;
}

.steps li:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

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

.steps li strong {
    display: block;
    margin-bottom: 4px;
}

/* ---- FLOW DIAGRAM ---- */
.flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
    font-size: 14px;
}

.flow-step {
    padding: 8px 16px;
    background: var(--color-bg-sidebar);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.flow-arrow {
    color: var(--color-text-light);
    font-size: 18px;
}

/* ---- FAQ ---- */
.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
}

.faq-question {
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--color-text);
    user-select: none;
}

.faq-question::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--color-text-light);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
    content: '-';
}

.faq-answer {
    display: none;
    padding-top: 12px;
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    display: block;
}

/* ---- SEARCH RESULTS ---- */
.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
}

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

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

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

.search-result-item:hover {
    background: var(--color-accent-light);
}

.search-result-item small {
    display: block;
    color: var(--color-text-light);
    font-size: 12px;
    margin-top: 2px;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--color-text-light);
    font-size: 14px;
}

/* ---- OVERLAY ---- */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
}

.overlay.visible {
    display: block;
}

/* ---- FOOTER ---- */
.footer {
    margin-left: var(--sidebar-width);
    padding: 32px 48px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 13px;
    text-align: center;
}

/* ---- BACK TO TOP ---- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: opacity 0.2s;
    z-index: 30;
    font-size: 18px;
}

.back-to-top.visible {
    display: flex;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .main {
        padding: 32px 32px 64px;
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

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

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

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

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

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
        margin-top: 40px;
    }

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

    .flow {
        flex-direction: column;
        align-items: flex-start;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    table {
        display: block;
        overflow-x: auto;
    }
}
