/* /lib/css/header.css */
/* VERSÃO V8 FINAL - GLOBAL MENU + SEARCH DROPDOWN */

/* Fonte de ícones de armas HL2 */
@font-face {
    font-family: 'HL2WeaponIcons';
    src: url('/lib/fonts/HPH_HUD_WeaponIcons.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ==========================================================================
   1. ESTRUTURA PRINCIPAL (NAVBAR)
   ========================================================================== */
.main-navbar, .main-navbar * { box-sizing: border-box; }

.main-navbar {
    width: 100%; height: 70px;
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 2px solid #ff5000;
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000;
    padding: 0 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    font-family: 'Verdana', sans-serif;
    display: flex; align-items: center;
}

.nav-container {
    width: 100%; max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

/* MARCA / LOGO */
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-icon {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; }
.brand-title {
    color: #fff;
    font-weight: normal;
    font-size: 17px;
    line-height: 1;
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}
.brand-subtitle {
    color: #ff5000;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile: ocultar texto da marca */
@media (max-width: 768px) {
    .brand-text {
        display: none;
    }
    .brand-icon {
        width: 45px;
        height: 45px;
    }
}

/* ==========================================================================
   2. BARRA DE PESQUISA (+ DROPDOWN DE RESULTADOS)
   ========================================================================== */
.nav-search { flex-grow: 1; max-width: 600px; position: relative; }

.nav-search input {
    width: 100%; background: #1a1a1a; border: 1px solid #333;
    border-radius: 50px; padding: 10px 20px 10px 45px;
    color: #fff; font-family: 'Verdana', sans-serif; font-size: 14px;
    outline: none; transition: all 0.3s;
}
.nav-search input:focus { border-color: #ff5000; background: #222; }
.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    cursor: pointer;
    z-index: 10;
}

/* Mobile: searchbar colapsada */
@media (max-width: 768px) {
    .nav-search {
        max-width: 40px;
        transition: all 0.3s;
    }
    
    .nav-search.expanded {
        max-width: 100%;
        flex: 1;
    }
    
    .nav-search input {
        width: 40px;
        padding: 10px;
        background: transparent;
        border: none;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
    }
    
    .nav-search.expanded input {
        width: 100%;
        padding: 10px 20px 10px 45px;
        background: #1a1a1a;
        border: 1px solid #333;
        opacity: 1;
        pointer-events: all;
        cursor: text;
    }
    
    .search-icon {
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 18px;
        color: #ff5000;
    }
    
    .nav-search.expanded .search-icon {
        left: 15px;
        transform: translateY(-50%);
        color: #666;
    }
}

/* NOVO: Dropdown de Resultados da Pesquisa */
.search-results-dropdown {
    position: absolute;
    top: 100%; left: 20px;
    width: calc(100% - 40px);
    background: #1b1b1b;
    border: 1px solid #333; border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.9);
    z-index: 10001;
    display: none;
    max-height: 400px; overflow-y: auto;
}
.search-result-item {
    display: flex; align-items: center; padding: 12px;
    border-bottom: 1px solid #2a2a2a; color: #ccc;
    text-decoration: none; transition: background 0.2s; font-size: 13px;
}
.search-result-item:hover { background: #252525; color: #fff; }
.search-result-icon { margin-right: 10px; width: 20px; text-align: center; color: #ff5000; }

/* ==========================================================================
   3. PERFIL E LOGIN
   ========================================================================== */
.nav-profile { display: flex; align-items: center; gap: 15px; }
.profile-info { text-align: right; display: none; }
@media (min-width: 768px) { .profile-info { display: block; } }

.profile-name { display: block; color: #ff5000; font-weight: bold; font-size: 14px; }
.profile-avatar { 
    width: 42px; height: 42px; border-radius: 30%; 
    border: 2px solid #ff5000; object-fit: cover; cursor: pointer;
}

.btn-login-nav {
    background: #171a21; color: white; padding: 8px 20px; border-radius: 4px;
    text-decoration: none; font-weight: bold; font-size: 13px; display: flex; align-items: center; gap: 8px;
}

/* ==========================================================================
   4. DROPDOWNS PRINCIPAIS (Sino e Usuário)
   ========================================================================== */
.icon-wrapper, .user-wrapper {
    position: relative; cursor: pointer; display: flex; align-items: center; gap: 10px; z-index: 1001;
}
.badge-count {
    position: absolute; top: -5px; right: -5px;
    background: #ff0000; color: white; font-size: 10px;
    padding: 2px 5px; border-radius: 30%; font-weight: bold;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.custom-dropdown {
    position: absolute; top: 60px; right: 0;
    background: #1b1b1b; border: 1px solid #333; border-top: 3px solid #ff5000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    display: none; z-index: 2000; border-radius: 0 0 8px 8px;
}
.custom-dropdown.show { display: block !important; animation: fadeIn 0.2s ease; }

.notif-dd { width: 380px; max-height: 500px; overflow-y: auto; padding: 0; left: -280px; } 
.user-dd { width: 220px; }

.dd-header {
    padding: 12px 16px; border-bottom: 1px solid #2a2a2a;
    background-color: #222; color: #fff; font-size: 13px; font-weight: bold;
}
.dd-item {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: #ccc; text-decoration: none; font-size: 13px;
}
.dd-item:hover { background: #2a2a2a; color: #fff; }
.dd-divider { height: 1px; background: #333; margin: 5px 0; }
.text-red { color: #ff5555; }

/* ==========================================================================
   5. LISTA DE NOTIFICAÇÕES (Layout dos itens)
   ========================================================================== */
.notif-item {
    display: flex; align-items: flex-start; padding: 15px;
    border-bottom: 1px solid #2a2a2a; background-color: #1b1b1b;
    cursor: pointer; position: relative; transition: opacity 0.2s, background 0.2s;
}
.notif-item:hover { background-color: #252525; }
.notif-item.unread { background-color: #261e1b; border-left: 3px solid #ff5000; }

.notif-avatar { position: relative; margin-right: 15px; flex-shrink: 0; }
.notif-avatar img { width: 45px; height: 45px; border-radius: 30%; object-fit: cover; border: 2px solid #333; }
.notif-type-icon {
    position: absolute; bottom: -2px; right: -5px; width: 20px; height: 20px;
    border-radius: 50%; color: white; display: flex; align-items: center; justify-content: center; font-size: 10px; border: 2px solid #1b1b1b;
}

.notif-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.notif-text { font-size: 13px; color: #ccc; line-height: 1.4; }
.notif-preview { font-size: 12px; color: #777; margin-top: 3px; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time { font-size: 11px; color: #ff5000; font-weight: 500; margin-top: 5px; }

/* Botão de 3 pontinhos na notificação */
.notif-actions button {
    background: transparent; border: none; color: #555; padding: 5px; cursor: pointer; font-size: 14px;
}
.notif-actions button:hover { color: #fff; }

/* ==========================================================================
   6. NOVO MENU FLUTUANTE GLOBAL (A Solução do Corte)
   ========================================================================== */
.global-float-menu {
    position: fixed; /* O segredo: Fixo na tela, ignora overflow */
    width: 170px;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.9);
    display: none; /* Começa escondido */
    padding: 5px 0;
    z-index: 999999 !important; /* Acima de tudo */
}

.g-opt-item {
    padding: 10px 15px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: background 0.2s;
}
.g-opt-item:hover { background: #333; color: #fff; }
.g-opt-item i { width: 15px; text-align: center; }

/* Linha de Confirmação (Check Verde / X Cinza) */
.g-confirm-row {
    display: flex; align-items: center; justify-content: space-evenly;
    padding: 5px 0; background: #1a1a1a;
}
.g-btn-confirm, .g-btn-cancel {
    padding: 8px 20px; border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.g-btn-confirm { color: #4caf50; }
.g-btn-confirm:hover { background: rgba(76, 175, 80, 0.1); transform: scale(1.1); }

.g-btn-cancel { color: #888; }
.g-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* Botão Gerenciar */
.btn-manage-notifs {
    background: linear-gradient(135deg, #ff5000 0%, #ff7700 100%);
    color: white !important; padding: 5px 12px; border-radius: 4px;
    font-size: 11px; font-weight: bold; text-decoration: none;
    display: inline-flex; align-items: center; gap: 5px;
}
.btn-manage-notifs:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(255,80,0,0.4); }

/* ==========================================================================
   7. ANIMAÇÕES (Sino)
   ========================================================================== */
@keyframes bell-wake-up {
    0% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    100% { transform: rotate(0); }
}
.bell-ringing { animation: bell-wake-up 1.0s ease-in-out; color: #ff5000 !important; }

/* Animações de Entrada */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ESTILO DA BUSCA RICA (SONS) */
.search-results-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #151515; border: 1px solid #333; border-top: none;
    border-radius: 0 0 8px 8px; box-shadow: 0 15px 30px rgba(0,0,0,0.9);
    z-index: 10001; display: none; max-height: 450px; overflow-y: auto;
}

.search-result-row {
    display: flex; align-items: center; padding: 10px 15px;
    border-bottom: 1px solid #222; transition: background 0.2s;
    cursor: pointer;
}
.search-result-row:hover { background: #202020; }

.search-play-btn {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: #333; color: #ccc; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; transition: all 0.2s;
}
.search-play-btn:hover { background: #ff5000; color: white; transform: scale(1.1); }
.search-play-btn i { font-size: 11px; margin-left: 2px; }

.search-info-col { flex-grow: 1; overflow: hidden; display: flex; flex-direction: column; }
.search-title { 
    color: #eee; font-weight: bold; font-size: 13px; text-decoration: none; 
    display: block; margin-bottom: 3px;
}
.search-aliases { font-size: 10px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-alias-tag {
    background: #252525; padding: 2px 5px; border-radius: 3px; margin-right: 3px; color: #888;
}

/* ==========================================================================
   8. FILTROS DO RANK NO HEADER
   ========================================================================== */
.header-rank-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-rank-filters select {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-family: 'Verdana', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.header-rank-filters select:hover {
    border-color: #ff5000;
    background: #222;
}

.header-rank-filters select:focus {
    border-color: #ff5000;
    box-shadow: 0 0 0 2px rgba(255, 80, 0, 0.1);
}

/* Responsivo para filtros do rank */
@media (max-width: 1024px) {
    .header-rank-filters {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    /* Esconder filtros mobile na página quando os do header estão visíveis */
    .rank-filters-mobile {
        display: none !important;
    }
}

/* Mobile: ajustes gerais do header */
@media (max-width: 768px) {
    .main-navbar {
        height: 60px;
        padding: 0 10px;
    }
    
    .nav-container {
        gap: 10px;
    }
    
    .profile-avatar {
        width: 36px;
        height: 36px;
    }
    
    .icon-wrapper i {
        font-size: 18px;
    }
}