/* 
 * HEADER PROPRE SANS PROBLÈMES D'ENCODAGE
 * Menu hamburger et navigation reconstruits depuis zéro
 */

/* ========================================
   HEADER MODERNE - MÊME STYLE QUE LE FOOTER
======================================== */

.modern-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%) !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    position: relative;
    z-index: 999998 !important;
}

.modern-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="header-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23header-pattern)"/></svg>');
    pointer-events: none;
}

.modern-header .container {
    position: relative;
    z-index: 2;
}

/* Logo et branding */
.navbar-brand {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease !important;
}

.navbar-brand:hover {
    color: #f39c12 !important;
    transform: translateY(-2px);
}

.logo-container img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    border: 3px solid #f39c12 !important;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3) !important;
    transition: all 0.3s ease !important;
}

.logo-container img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5) !important;
}

.brand-text {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ========================================
   NOUVEAU MENU HAMBURGER - RECRÉÉ DEPUIS ZÉRO
======================================== */

.hamburger-button {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.hamburger-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #f39c12;
    transform: scale(1.05);
}

.hamburger-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 14px;
}

.hamburger-bar {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger-bar:nth-child(1) {
    top: 0;
}

.hamburger-bar:nth-child(2) {
    top: 6px;
}

.hamburger-bar:nth-child(3) {
    top: 12px;
}

/* Animation quand le menu est ouvert */
.hamburger-button.open .hamburger-bar:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
    background: #f39c12;
}

.hamburger-button.open .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-button.open .hamburger-bar:nth-child(3) {
    top: 6px;
    transform: rotate(-45deg);
    background: #f39c12;
}

.hamburger-button.open {
    background: rgba(243, 156, 18, 0.2);
    border-color: #f39c12;
}

/* ========================================
   MENU DÉROULANT MOBILE
======================================== */

.mobile-dropdown-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 0 0 20px 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 9999;
    opacity: 0;
}

.mobile-dropdown-menu.open {
    max-height: 80vh;
    opacity: 1;
}

.mobile-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="mobile-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23mobile-pattern)"/></svg>');
    pointer-events: none;
}

.mobile-menu-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu-section {
    margin-bottom: 2rem;
}

.mobile-menu-title {
    color: #f39c12;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-item:hover::before {
    left: 100%;
}

.mobile-menu-item:hover {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
    color: #f39c12;
    transform: translateX(5px);
}

.mobile-menu-icon {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.mobile-menu-text {
    font-weight: 500;
    font-size: 1rem;
}

.mobile-menu-badge {
    margin-left: auto;
    background: #f39c12;
    color: #2c3e50;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Boutons d'authentification dans le menu mobile */
.mobile-auth-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.mobile-auth-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-auth-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.mobile-auth-btn:hover::before {
    width: 200px;
    height: 200px;
}

.mobile-login-btn {
    background: rgba(52, 152, 219, 0.2);
    border: 2px solid #3498db;
    color: #3498db;
}

.mobile-login-btn:hover {
    background: #3498db;
    color: #ffffff;
    transform: translateY(-2px);
}

.mobile-register-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: 2px solid #f39c12;
    color: #ffffff;
}

.mobile-register-btn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

/* ========================================
   NAVIGATION PRINCIPALE
======================================== */

.navbar-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #ecf0f1 !important;
    text-decoration: none !important;
    padding: 0.75rem 1rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
}

.nav-link:hover {
    color: #f39c12 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3) !important;
}

.nav-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
    display: inline-block;
    width: 20px;
    text-align: center;
}

.nav-text {
    display: inline-block;
}

/* ========================================
   MENU UTILISATEUR
======================================== */

.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-user-menu:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-user-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-user-name {
    color: #ffffff;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-user-arrow {
    font-size: 0.8rem;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.nav-user-menu.active .nav-user-arrow {
    transform: rotate(180deg);
}

/* ========================================
   DROPDOWN UTILISATEUR
======================================== */

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block !important;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
}

.dropdown-link:hover {
    background: #f8f9fa;
    color: #f39c12;
    transform: translateX(5px);
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.dropdown-text {
    font-weight: 500;
    font-size: 0.95rem;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

.logout-link {
    color: #e74c3c;
}

.logout-link:hover {
    background: #ffeaea;
    color: #c0392b;
}

/* ========================================
   LIENS D'AUTHENTIFICATION
======================================== */

.nav-auth-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-auth-icon {
    font-size: 1rem;
}

.nav-auth-text {
    font-size: 0.95rem;
}

.nav-login {
    color: #ecf0f1 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.nav-login:hover {
    color: #f39c12 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #f39c12 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3) !important;
}

.nav-register {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: #ffffff !important;
    border-color: #f39c12 !important;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3) !important;
}

.nav-register:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%) !important;
    color: #ffffff !important;
    border-color: #e67e22 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5) !important;
}

/* ========================================
   ALERTES PROPRES
======================================== */

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    color: inherit;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* ========================================
   RESPONSIVE MOBILE
======================================== */

@media (max-width: 768px) {
    .hamburger-button {
        display: block;
    }
    
    .navbar-menu {
        display: none !important;
    }
    
    /* Responsive pour le nouveau menu mobile */
    .mobile-dropdown-menu {
        top: 60px;
    }

    .mobile-menu-content {
        padding: 1rem;
    }

    .mobile-menu-item {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .mobile-auth-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        padding: 1rem 1.5rem !important;
        border-radius: 10px !important;
        margin-bottom: 0.5rem !important;
        text-align: left !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        font-size: 1rem !important;
        transition: all 0.3s ease !important;
    }
    
    .nav-user-menu {
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .user-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.5rem;
    }
    
    .dropdown-link {
        color: #ffffff;
        justify-content: center;
    }
    
    .dropdown-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f39c12;
    }
    
    .dropdown-divider {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .nav-auth-link {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 0.5rem;
        padding: 1rem 1.5rem;
        border-radius: 10px;
    }
}

@media (max-width: 576px) {
    .navbar-menu {
        top: 60px;
        padding: 0.75rem;
    }
    
    .nav-link {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .nav-user-menu {
        padding: 0.875rem;
    }
    
    .nav-auth-link {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

/* ========================================
   FORCER LE MENU AU PREMIER PLAN
======================================== */

/* Règles spécifiques pour forcer le z-index */
.navbar-menu.show {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.mobile-menu-toggle {
    z-index: 1000000 !important;
    position: relative !important;
}

.modern-header {
    z-index: 999998 !important;
    position: sticky !important;
}

/* Forcer tous les éléments du menu à être au premier plan */
.navbar-menu.show * {
    z-index: inherit !important;
}

/* S'assurer que rien ne passe devant le menu */
.navbar-menu.show {
    isolation: isolate !important;
}
