/* ========================================
   HEADER UNIFIÉ V2 - Belgium Video Gaming
   Design avec icônes et layout restructuré
   ======================================== */

/* ===== HEADER PRINCIPAL ===== */
.unified-header {
    background: #C70000;
    border-bottom: 3px solid var(--belgium-yellow);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    z-index: 1000;
    margin-top: 0;
    margin-bottom: 0;
}

/* ===== SECTION PRINCIPALE ===== */
.header-main {
    padding: 1rem 0;
    position: relative;
}

.header-main::after {
    content: "";
    display: table;
    clear: both;
}

/* ===== SECTIONS DU HEADER ===== */
.header-section {
    display: flex;
    align-items: center;
    min-height: 60px; /* Hauteur fixe pour aligner tous les éléments */
}

.header-section-left {
    justify-content: flex-start;
    gap: 1rem;
    width: 33.33%;
    float: left;
}

.header-section-center {
    justify-content: center;
    text-align: center;
    width: 33.33%;
    float: left;
}

.header-section-right {
    justify-content: flex-end;
    gap: 0.5rem;
    width: 33.33%;
    float: right;
}

/* ===== SECTION GAUCHE: LOGO + TITRE SITE ===== */
.header-logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.header-logo-section:hover {
    transform: scale(1.05);
    text-decoration: none;
    color: inherit;
}

.header-logo-admin {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-admin img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo-section:hover .header-logo-admin img {
    transform: rotate(5deg);
}

.header-site-title {
    color: var(--belgium-yellow);
    font-size: 1.5rem;
    line-height: 1.1;
    text-align: center;
    margin: 0;
    font-family: 'Luckiest Guy', cursive;  
}

.header-site-title .line1 {
    display: block;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--belgium-yellow);
    text-align: center;
    text-shadow: 2px 3px 6px #000000;
}

.header-site-title .line2 {
    display: block;
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 0.1rem;
    color: var(--belgium-yellow);
    text-align: center;
    text-shadow: 2px 3px 6px #000000;
}

/* ===== SECTION MILIEU: TAGLINE ===== */
.header-tagline {
    color: white;
    font-size: 1.5rem;
    text-align: center;
    text-shadow: 2px 3px 6px #000000;
    margin: 0;
}

/* ===== SECTION DROITE: ICÔNES ===== */
.header-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.search-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.search-icon svg {
    transition: transform 0.3s ease;
}

.search-icon:hover svg {
    transform: scale(1.1);
}

/* Container de recherche header (masqué par défaut) */
.search-home-container {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 9999;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

.search-home-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-home-input {
    width: 250px;
    height: 40px;
    padding: 0 1rem;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}

.search-home-input::placeholder {
    color: #888;
    font-weight: 400;
}

.search-home-input:focus {
    color: #1a1a1a;
}

.search-home-button {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--belgium-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0.5rem;
}

.search-home-button:hover {
    background: #a52a1a;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(196, 35, 16, 0.3);
}

/* Résultats de recherche header */
.search-home-results {
    position: absolute;
    top: 6rem;
    left: -36.9rem;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-home-results.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Item de résultat */
.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-excerpt {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.search-result-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-date {
    font-size: 0.7rem;
    color: #888;
}

/* Badge colors */
.badge-test { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.badge-preview { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.badge-news, .badge-actu, .badge-actualités { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.badge-guide, .badge-dossiers { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; }
.badge-trailers { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.badge-démos { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: white; }
.badge-sponso { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); color: white; }

/* Message "Aucun résultat" */
.search-no-results {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.search-no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Loading state */
.search-loading {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--belgium-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.auth-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.auth-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    text-decoration: none;
    color: white;
}

.auth-icon svg {
    transition: transform 0.3s ease;
}

.auth-icon:hover svg {
    transform: scale(1.1);
}

/* Icônes spécifiques */
.dashboard-icon {
    background: var(--belgium-yellow);
    border-color: var(--belgium-black);
}

.logout-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.login-icon {
    background: var(--belgium-yellow);
    border-color: var(--belgium-black);
}

.register-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

/* ===== NAVIGATION PRINCIPALE ===== */
.header-navigation {
    background-color: #000000;
    width: 65vw;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

/* Éléments de navigation */
.nav-item {
    position: relative;
    flex: 1;
    text-align: center;
}

.nav-button {
    background-color: transparent;
    color: var(--belgium-yellow);
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.nav-button:hover {
    background-color: #DC2626;
    color: #FCD34D;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.nav-button:active {
    transform: translateY(0);
}

/* ===== DROPDOWN HARDWARE/ÉVÉNEMENT ===== */
.dropdown {
    position: relative;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #000000;
    border: 2px solid #DC2626;
    border-top: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

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

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid #333333;
}

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

.dropdown-item:hover {
    background-color: #DC2626;
    color: #FCD34D;
    padding-left: 20px;
}

.dropdown-item.disabled {
    color: #6B7280;
    cursor: not-allowed;
}

.dropdown-divider {
    height: 1px;
    background-color: #E5E7EB;
    margin: 8px 0;
}

/* ===== MENU HAMBURGER MOBILE ===== */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
}

.hamburger-line {
    display: block;
    width: 30px;
    height: 7px;
    background-color: var(--belgium-black);
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== MENU MOBILE ===== */
.navbar-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.navbar-mobile.active {
    opacity: 1;
    visibility: visible;
}

.navbar-mobile-content {
    background-color: #000000;
    width: 100%;
    max-width: 400px;
    height: 100%;
    padding: 80px 20px 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.navbar-mobile.active .navbar-mobile-content {
    transform: translateX(0);
}

.mobile-section {
    margin-bottom: 30px;
}

.mobile-section-title {
    color: #DC2626;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #DC2626;
    padding-bottom: 8px;
}

.mobile-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-item {
    color: #FFFFFF;
    text-decoration: none;
    padding: 12px 16px;
    background-color: #1F2937;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.mobile-item:hover {
    background-color: #DC2626;
    color: #FCD34D;
    border-left-color: #FCD34D;
    transform: translateX(5px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .header-navigation {
        width: 85%;
    }
    
    .nav-button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .header-navigation {
        width: 100%;
        position: relative;
    }
    
    .navbar-container {
        display: none;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .navbar-mobile {
        display: block;
    }
    
    .header-main {
        padding: 0.5rem 0;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .header-logo {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 200px);
    }
    
    .header-logo-icon {
        width: 45px;
        height: 45px;
        flex-shrink: 0;
    }
    
    .header-logo-text h1 {
        font-size: 1rem;
        line-height: 1.1;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .header-title {
        display: none;
    }
    
    .header-auth {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
        align-items: center;
        flex-shrink: 0;
    }
    
    .auth-icon {
        width: 36px;
        height: 36px;
    }
    
    .search-icon {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 550px) {
    .header-main {
        padding: 0.4rem 0;
        gap: 0.5rem;
    }
    
    .header-logo {
        max-width: calc(100% - 180px);
    }
    
    .header-logo-icon {
        width: 35px;
        height: 35px;
    }
    
    .header-logo-text h1 {
        font-size: 0.8rem;
        line-height: 1;
        white-space: normal;
    }
    
    .header-logo {
        gap: 0.4rem;
    }
    
    .auth-icon {
        width: 32px;
        height: 32px;
    }
    
    .search-icon {
        width: 32px;
        height: 32px;
    }

    .header-tagline {
        display: none !important;
    }
    
    /* Réduire le padding du header */
    .header-main {
        padding: 0.5rem 0;
    }
    
    /* Ajuster la taille du logo */
    .header-logo-admin {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Réduire la taille du titre */
    .header-site-title {
        font-size: 0.9rem;
    }
    
    .header-site-title .line1,
    .header-site-title .line2 {
        font-size: 0.9rem;
    }
    
    /* Réduire la taille des icônes */
    .search-icon,
    .auth-icon {
        width: 36px;
        height: 36px;
    }
    
    .search-icon svg,
    .auth-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.unified-header {
    animation: slideInDown 0.5s ease-out;
}

/* ===== ACCESSIBILITÉ ===== */
.nav-button:focus,
.dropdown-item:focus,
.mobile-item:focus,
.search-icon:focus,
.auth-icon:focus {
    outline: 2px solid #FCD34D;
    outline-offset: 2px;
}

/* ===== ÉTATS ACTIFS ===== */
.nav-item.active .nav-button {
    background-color: #DC2626;
    color: #FCD34D;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #FCD34D;
}
