/* ==========================================================
   HEADER.CSS — Versão 13.5 Master (Themed Hover & Clean UI)
   * Objetivo: Cabeçalho fixo, busca inteligente e menu temático.
   * Correção V13.5: Adição de cores dinâmicas no hover do dropdown.
   ========================================================== */

/* ----------------------------------------------------------
   1. ESTRUTURA GLOBAL (STICKY & Z-INDEX)
---------------------------------------------------------- */
.site-header {
    position: fixed; /* Fixo no topo */
    top: 0;
    left: 0;
    width: 100%;
    height: 85px;
    background: #ffffff;
    z-index: 9999999; /* Acima de tudo (inclusive anúncios) */
    box-shadow: 0 1px 0 rgba(0,0,0,0.05); /* Linha sutil */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

/* Estado Scrolled (Vidro) */
.site-header.scrolled {
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 25px;
    gap: 30px;
    height: 100%;
}

/* ----------------------------------------------------------
   2. LOGO & BRANDING
---------------------------------------------------------- */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img { 
    width: 42px; 
    height: auto; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.logo-text { 
    font-size: 1.5rem; 
    font-weight: 800; 
    background: linear-gradient(135deg, var(--primary) 0%, #0a3d9c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.logo-area:hover .logo-img { transform: rotate(-10deg) scale(1.1); }

/* ----------------------------------------------------------
   3. BUSCA INTELIGENTE
---------------------------------------------------------- */
.header-search {
    flex: 1;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    transition: all 0.3s ease;
}

.header-search:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.15);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: var(--text-main);
}

.header-search button {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.header-search button:hover { background: var(--primary-dark); transform: scale(1.05); }

/* ----------------------------------------------------------
   4. NAVEGAÇÃO DESKTOP & MEGA MENU
---------------------------------------------------------- */
.main-nav { margin-left: auto; }

.main-nav ul {
    display: flex;
    gap: 25px;
    list-style: none;
    align-items: center;
    margin: 0; padding: 0;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
    padding: 8px 0;
}

.main-nav a:hover, 
.main-nav a.active-link { color: var(--primary); }

/* Indicador Animado */
.main-nav a::after {
    content: '';
    position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary); transition: width 0.3s ease;
}
.main-nav a:hover::after, 
.main-nav a.active-link::after { width: 100%; }

/* Dropdown (Mega Menu) */
.dropdown { position: relative; }

.dropdown > a { display: flex; align-items: center; gap: 6px; }
.dropdown > a i { font-size: 0.75rem; transition: transform 0.3s; }
.dropdown:hover > a i { transform: rotate(180deg); }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    width: 550px; /* Largura fixa ideal */
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    padding: 20px;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
}

/* Seta do Menu */
.dropdown-menu::before {
    content: '';
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px;
    background: #fff; border-top: 1px solid rgba(0,0,0,0.06); border-left: 1px solid rgba(0,0,0,0.06);
}

.dropdown:hover .dropdown-menu {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Hover Padrão (Fallback) */
.dropdown-menu li a:hover {
    background: var(--primary); color: #fff;
    transform: translateY(-2px); box-shadow: 0 4px 10px rgba(13, 110, 253, 0.25);
}
.dropdown-menu li a::after { display: none; } /* Remove underline padrão */

/* Botão Admin */
.admin-btn {
    background: rgba(239, 68, 68, 0.1); color: #ef4444 !important;
    padding: 6px 16px !important; border-radius: 50px;
    display: flex; align-items: center; gap: 6px;
}
.admin-btn:hover { background: #ef4444; color: #fff !important; }
.admin-btn::after { display: none; }

/* ----------------------------------------------------------
   5. MENU MOBILE (HAMBÚRGUER)
---------------------------------------------------------- */
.menu-toggle {
    display: none;
    background: none; border: none; padding: 0;
    font-size: 1.5rem; color: var(--text-main);
    cursor: pointer; z-index: 1001;
}

/* ----------------------------------------------------------
   6. RESPONSIVIDADE
---------------------------------------------------------- */
@media (max-width: 1024px) {
    .header-search { display: none; } /* Esconde busca em tablet/mobile */
    .menu-toggle { display: block; }  /* Mostra hambúrguer */

    /* Mobile Nav */
    .main-nav {
        position: fixed;
        top: 85px; left: 0; width: 100%;
        height: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        overflow: hidden; opacity: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex; flex-direction: column;
        border-top: 1px solid #f1f5f9;
    }

    .main-nav.active {
        height: calc(100vh - 85px);
        opacity: 1; overflow-y: auto;
        padding: 30px 25px;
    }

    .main-nav ul {
        flex-direction: column; width: 100%; align-items: flex-start; gap: 0;
    }

    .main-nav li { width: 100%; border-bottom: 1px solid #f1f5f9; }
    .main-nav a { display: block; padding: 15px 0; font-size: 1.1rem; width: 100%; }
    .main-nav a:hover::after { width: 0; } /* Remove animação desktop */

    /* Dropdown Mobile */
    .dropdown:hover .dropdown-menu { display: none; } /* Desativa hover */
    
    .dropdown-menu {
        position: static; opacity: 1; visibility: visible;
        transform: none; width: 100%; box-shadow: none; border: none;
        background: transparent; padding: 10px 0;
        display: none !important; /* Escondido até clicar */
        grid-template-columns: repeat(2, 1fr); /* 2 colunas */
    }
    
    .dropdown-menu::before { display: none; }

    .dropdown.active .dropdown-menu { display: grid !important; }
    .dropdown.active > a { color: var(--primary); }
    .dropdown.active > a i { transform: rotate(180deg); }
}

/* ----------------------------------------------------------
   7. CORES DO MENU (THEMED HOVER)
   * Adiciona brilho colorido conforme a categoria
---------------------------------------------------------- */
/* Política (Vermelho) */
.cat-hover-politics:hover {
    background: #fff1f2 !important; color: #e11d48 !important; border-color: #ffe4e6;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15) !important;
}
/* Tecnologia (Ciano) */
.cat-hover-technology:hover, .cat-hover-tech:hover {
    background: #ecfeff !important; color: #0891b2 !important; border-color: #cffafe;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15) !important;
}
/* Esportes (Laranja) */
.cat-hover-sports:hover {
    background: #fff7ed !important; color: #ea580c !important; border-color: #ffedd5;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.15) !important;
}
/* Brasil / Top (Azul) */
.cat-hover-brasil:hover, .cat-hover-top:hover {
    background: #eff6ff !important; color: #2563eb !important; border-color: #dbeafe;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15) !important;
}
/* Saúde (Verde Água) */
.cat-hover-health:hover, .cat-hover-saude:hover {
    background: #f0fdfa !important; color: #0d9488 !important; border-color: #ccfbf1;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15) !important;
}
/* Economia (Verde) */
.cat-hover-business:hover, .cat-hover-economy:hover {
    background: #f0fdf4 !important; color: #16a34a !important; border-color: #dcfce7;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15) !important;
}
/* Entretenimento (Rosa) */
.cat-hover-entertainment:hover {
    background: #fdf2f8 !important; color: #db2777 !important; border-color: #fce7f3;
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.15) !important;
}
/* Mundo (Roxo) */
.cat-hover-world:hover {
    background: #faf5ff !important; color: #9333ea !important; border-color: #f3e8ff;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15) !important;
}
/* Games (Roxo Escuro) */
.cat-hover-games:hover {
    background: #f3e8ff !important; color: #7e22ce !important; border-color: #e9d5ff;
    box-shadow: 0 4px 12px rgba(126, 34, 206, 0.15) !important;
}
/* Ciência (Indigo) */
.cat-hover-science:hover, .cat-hover-ciencia:hover {
    background: #eef2ff !important; color: #4f46e5 !important; border-color: #e0e7ff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15) !important;
}
/* Curiosidades (Amarelo) */
.cat-hover-curiosities:hover, .cat-hover-food:hover {
    background: #fffbeb !important; color: #d97706 !important; border-color: #fef3c7;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15) !important;
}
/* Clima (Verde Escuro) */
.cat-hover-environment:hover, .cat-hover-clima:hover {
    background: #f0fdf4 !important; color: #15803d !important; border-color: #dcfce7;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.15) !important;
}
