/* =========================================
   VARIAVEIS E RESET
   ========================================= */
:root {
    --sidebar-width: 260px;
    --header-height: 70px;
    --content-max-width: 1200px;
    --bg-void: #020617;
    --bg-surface: #0f172a;
    --border: rgba(255,255,255,0.08);
    --primary: #4f46e5;
    --cyan: #06b6d4;
    --text-muted: #94a3b8;
}

/* 1. Ajuste do corpo do site para acomodar a sidebar */
body.metria-app-active {
    padding-left: var(--sidebar-width);
    padding-top: var(--header-height);
}

/* 2. HEADER MODIFICADO (Quando logado) */
/* Empurra o header original para a direita */
body.metria-app-active .metria-header {
    left: var(--sidebar-width); 
    width: calc(100% - var(--sidebar-width)); 
    justify-content: center; /* Centraliza conteúdo */
}

/* Container interno do header original */
body.metria-app-active .header-inner {
    max-width: var(--content-max-width);
    padding: 0 20px;
    width: 100%;
}

/* --- BARRA DE BUSCA (MINIMALISTA & PREMIUM) --- */

/* Escondido por padrão (Visitantes) */
.mh-search-bar { display: none; }

/* Visível no Modo App */
body.metria-app-active .mh-search-bar {
    display: flex;
    align-items: center;
    
    /* Layout e Tamanho */
    flex: 1;
    max-width: 420px;
    height: 42px;
    margin: 0 40px;
    padding: 0 16px;
    
    /* Estilo Visual: Cápsula única */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 99px; /* Formato Pílula */
    
    box-shadow: none;
    transition: all 0.2s ease-in-out;
}

/* Estado de Foco (Glow na cápsula inteira) */
body.metria-app-active .mh-search-bar:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(79, 70, 229, 0.7);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.05); /* Glow externo */
    transform: translateY(0);
}

/* Ícone da Lupa */
.search-icon {
    color: rgba(255, 255, 255, 0.4); /* Cor mais sutil */
    font-size: 0.9rem;
    margin-right: 12px;
    transition: color 0.2s;
    pointer-events: none;
}

body.metria-app-active .mh-search-bar:focus-within .search-icon {
    color: var(--primary); /* Acende ao focar */
}

/* O Campo de Texto (Input) - ESTILO ZERADO */
.mh-search-bar input {
    flex: 1;
    width: 100%;
    height: 100%;
    
    /* Remove todos os estilos nativos que criam bordas/outlines */
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    
    /* Tipografia */
    color: #f8fafc;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Placeholder discreto */
.mh-search-bar input::placeholder {
    color: rgba(148, 163, 184, 0.4);
    font-weight: 400;
}

/* 4. SIDEBAR (LATERAL) */
.metria-sidebar {
    position: fixed;
    top: var(--header-height); bottom: 0; left: 0;
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.6);
    border-right: 1px solid var(--border);
    padding: 30px 15px;
    display: flex; flex-direction: column; gap: 8px;
    overflow-y: auto;
    z-index: 998;
    font-family: 'Inter', sans-serif;
}

.ms-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin: 20px 0 5px 12px;
    font-weight: 700;
}

.ms-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.ms-link:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.ms-link.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.15), transparent);
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: var(--primary);
    font-weight: 600;
}

.ms-link i { width: 20px; text-align: center; font-size: 1.1rem; transition: 0.2s; }
.ms-link:hover i { transform: scale(1.1); color: var(--cyan); }

.icon-arena { color: #f87171; } 


/* 5. RESPONSIVIDADE (MOBILE & TABLET) */
@media (max-width: 900px) {
    body.metria-app-active { padding-left: 0; padding-bottom: 70px; }
    
    /* Header no Tablet/Mobile */
    body.metria-app-active .metria-header {
        left: 0; width: 100%; padding: 0 1rem;
        justify-content: space-between;
    }
    
    /* Ajuste da Busca no Tablet */
    body.metria-app-active .mh-search-bar {
        margin: 0 15px;
        max-width: 100%;
    }

    /* Mobile Sidebar */
    .metria-sidebar {
        top: auto; bottom: 0; left: 0; right: 0;
        width: 100%; height: 70px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        background: #020617;
    }
    
    .ms-link span, .ms-label { display: none; }
    .ms-link { padding: 10px; flex-direction: column; gap: 5px; justify-content: center; width: 100%; border-radius: 0; }
    .ms-link i { font-size: 1.4rem; }
    .ms-link.active { border: none; border-top: 2px solid var(--primary); background: transparent; }
}

/* Mobile Pequeno (< 600px): Esconde a busca */
@media (max-width: 600px) {
    .mh-search-bar { display: none !important; }
}