/* ================================================
   HUB SHELL — CV PRO
   Subconjunto ENXUTO do style.css da raiz do Hub,
   contendo APENAS o que a sidebar global e a barra
   superior precisam. O app React (Tailwind v4) se
   estiliza sozinho dentro do <main>.

   IMPORTANTE: não adicionar aqui resets universais
   (`*`), regras de `body`/`h1..h6` ou qualquer
   seletor genérico — CSS sem layer sempre vence os
   @layer do Tailwind e quebra o layout do React.

   Blocos copiados de style.css (manter em sincronia
   quando o design do Hub mudar):
   - :root tokens (linhas 5–46)
   - grid body::before (112–123)
   - .chat-header (295–310)
   - .hub-headline (338–354), .hub-subtitle (394–401)
   - .main-content (851–857)
   - .layout-container / .sidebar (1399–1469)
   - drawer mobile (1896–1980)
   ================================================ */

/* ---- Design tokens (tema dark; a página força data-theme=dark) ---- */
:root {
    /* Cores Oficiais */
    --bg-main:          #010404;
    --bg-surface:       #0A0E0E;
    --bg-surface-light: #141A1A;
    --text-primary:     #E6E8E6;
    --text-secondary:   #9AA19A;
    --text-muted:       #647464;
    --accent-green:     #6FB03A;
    --accent-blue:      #31A8A8;

    /* Utilitários gerados nativamente com color-mix() */
    --bg-glass:         rgba(255, 255, 255, 0.15);
    --border-color:     color-mix(in srgb, var(--text-primary) 20%, transparent);
    --border-hover:     color-mix(in srgb, var(--text-primary) 35%, transparent);
    --accent-glow:      color-mix(in srgb, var(--accent-green) 20%, transparent);

    /* Grid Theme */
    --grid-color:       rgba(16, 185, 129, 0.12);
    --grid-strong:      rgba(16, 185, 129, 0.22);

    /* Formas — O Símbolo do "A": Mistura de reto e curvo */
    --radius-mixed:     2.5rem 0 2.5rem 0;
    --radius-mixed-rev: 0 2.5rem 0 2.5rem;

    --radius-sm:        0.375rem;
    --radius-md:        0.625rem;
    --radius-lg:        1rem;
    --radius-xl:        1.25rem;
    --radius-full:      9999px;

    /* Sombras (tema escuro) */
    --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg:        0 12px 40px rgba(0, 0, 0, 0.55);

    /* Animações Modernas — Easing Físico (Spring) */
    --transition-fast:  0.15s ease;
    --transition-base:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --spring-easing:    linear(0, 0.576 4%, 0.79 8%, 0.964 12%, 1.102 17%, 1.005 36%, 1);
    --transition-spring: 0.5s var(--spring-easing);
}

/* ---- Grid Cartográfico atrás da sidebar ----
   O app React cobre o próprio fundo (.cv-app-background é opaco);
   este grid aparece na faixa da sidebar, como nos outros agentes. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
    pointer-events: none;
    z-index: -2;
}

/* ---- Layout global (sidebar + main) ---- */
.layout-container {
    display: flex;
    height: 100vh;
    height: 100dvh; /* respeita a barra de endereço dos navegadores móveis */
    width: 100%;
}

.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-nav-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.sidebar-nav-item:hover {
    background: var(--bg-surface-light);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: color-mix(in srgb, var(--accent-green) 15%, transparent);
    color: var(--accent-green);
    border-color: color-mix(in srgb, var(--accent-green) 30%, transparent);
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* ---- Barra superior (padrão dos agentes) ---- */
.chat-header {
    padding: 1.5rem 3rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
@media (max-width: 768px) {
    .chat-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.hub-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 6vw, 4.5rem);
    letter-spacing: 0.03em;
    margin-top: 1rem;
    line-height: 1.15;
    text-wrap: balance; /* Modern CSS */
    padding-top: 0.2em; /* Prevenir corte de acentos no topo */

    /* Gradiente concentrado no verde da marca; teal só como toque final */
    background: linear-gradient(135deg, #FFF 12%, var(--accent-green) 62%, color-mix(in srgb, var(--accent-green) 45%, var(--accent-blue)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Glow suave da marca atrás do título (só no dark) */
    filter: drop-shadow(0 6px 32px color-mix(in srgb, var(--accent-green) 28%, transparent));
}

.hub-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
    text-wrap: pretty; /* Modern CSS */
}

/* ================================================
   DRAWER MOBILE (sidebar deslizante)
   Botão ☰, overlay e botão de fechar são injetados
   em runtime por /mobile-nav.js (compartilhado).
   ================================================ */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1300;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1150;
}
.sidebar-close {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    /* ---- Drawer: sidebar deslizante sobre overlay ---- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100dvh;
        width: min(280px, 82vw);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1200;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-toggle { display: flex; }
    .sidebar-close { display: flex; }
    .sidebar-overlay { display: block; }
    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
    /* Trava o scroll do fundo enquanto o drawer está aberto */
    body.drawer-open {
        overflow: hidden;
    }

    /* ---- Header precisa de espaço para o hambúrguer ---- */
    .chat-header {
        padding: 1rem 1rem 1rem 3.75rem; /* espaço p/ o botão ☰ à esquerda */
    }
    .chat-header .hub-headline {
        font-size: 1.9rem !important; /* sobrescreve o inline 2.5rem */
    }
}
