/* ===== HEADER SPECIFIC STYLES ===== */

/* Variables CSS du header */
:root {
    --header-height: 70px;
    --header-z-index: 1000;
}

/* Base header styles */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--header-z-index);
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 2rem;
}

/* Logo styles */
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

.logoimg {
    width: 275px;
    height: 58px;
    object-fit: contain;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(84, 175, 50, 0.2));
}

.logo:hover .logoimg {
    filter: drop-shadow(0 4px 12px rgba(84, 175, 50, 0.35));
}

.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

/* Navigation styles */
nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

nav a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
    background: rgba(84, 175, 50, 0.1);
}

/* Desktop navigation enhancements */
@media (min-width: 992px) {
    /*nav a {
        position: relative;
        overflow: hidden;
    }

    nav a::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, rgba(84, 175, 50, 0.15), rgba(70, 144, 40, 0.15));
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: -1;
        border-radius: 10px;
    }

    nav a:hover::before {
        opacity: 1;
    }

    nav a::after {
        content: '';
        position: absolute;
        bottom: 8px;
        left: 50%;
        width: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
        transform: translateX(-50%);
        transition: width 0.3s ease;
        border-radius: 2px;
        box-shadow: 0 0 8px rgba(84, 175, 50, 0.5);
    }

    nav a:hover::after {
        width: 70%;
    }

    nav a.active {
        color: var(--primary-color);
        background: rgba(84, 175, 50, 0.12);
        font-weight: 600;
        animation: pulse-green 2s ease-in-out infinite;
    }

    nav a.active::after {
        width: 70%;
    }*/
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(84, 175, 50, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(84, 175, 50, 0);
    }
}

/* Menu toggle (hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(84, 175, 50, 0.1);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 2px;
    transition: var(--transition);
    box-shadow: 0 0 5px rgba(84, 175, 50, 0.3);
}

.menu-toggle:hover span {
    box-shadow: 0 0 10px rgba(84, 175, 50, 0.5);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Header controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Theme toggle button */
.theme-toggle {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 20px rgba(84, 175, 50, 0.4);
}

.theme-toggle:hover::before {
    opacity: 0.15;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Dark mode adjustments */
[data-theme="dark"] header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .logoimg {
    filter: drop-shadow(0 2px 8px rgba(84, 175, 50, 0.3));
}

[data-theme="dark"] .logo:hover .logoimg {
    filter: drop-shadow(0 4px 12px rgba(84, 175, 50, 0.5));
}

[data-theme="dark"] .theme-toggle {
    border-color: rgba(84, 175, 50, 0.4);
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 0 25px rgba(84, 175, 50, 0.5);
}

[data-theme="dark"] .menu-toggle span {
    background: var(--text-color);
}

@media (min-width: 992px) {
    [data-theme="dark"] nav a::before {
        background: linear-gradient(135deg, rgba(84, 175, 50, 0.2), rgba(70, 144, 40, 0.2));
    }

    [data-theme="dark"] nav a.active {
        background: rgba(84, 175, 50, 0.15);
    }

    [data-theme="dark"] nav a.active:hover {
        background: rgba(84, 175, 50, 0.25);
    }
}

/* Accessibility */
nav a:focus,
.theme-toggle:focus,
.menu-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    nav a,
    .theme-toggle,
    .menu-toggle,
    .logo {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    nav a.active {
        animation: none !important;
    }
}

/* ===== NOUVELLE STRUCTURE HEADER ===== */

#all_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap; /* Permet le retour à la ligne quand nécessaire */
}

#selecteur {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0; /* Empêche le rétrécissement excessif */
}

/* Logo responsive */
.logo {
    flex-shrink: 1; /* Permet au logo de rétrécir si nécessaire */
    min-width: 0; /* Permet le rétrécissement */
}

.logoimg {
    width: 275px;
    height: 58px;
    transition: opacity 0.3s ease;
    max-width: 100%; /* Important pour le responsive */
    height: auto;
}

/* Ajustements spécifiques pour la zone problématique (577px) */
@media (max-width: 767px) and (min-width: 577px) {
    
    /* Garder tout sur une ligne */
    #all_header {
        flex-wrap: nowrap !important;
        gap: 1rem !important;
        justify-content: space-between !important;
    }
    
    /* Logo plus petit mais sur la ligne */
    .logo {
        flex: 0 1 auto !important; /* Permet le rétrécissement mais pas l'expansion */
    }
    
    .logoimg {
        width: 200px !important;
        height: 42px !important;
    }
    
    /* Sélecteurs compactés */
    #selecteur {
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
    }
    
    /* Boutons plus petits */
    .theme-toggle {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }
    
    .menu-toggle {
        padding: 6px !important;
    }
}

/* Point de rupture à 577px - passage en mode mobile */
@media (max-width: 577px) {
    
    /* Passer en layout vertical */
    #all_header {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
        text-align: center !important;
    }
    
    /* Logo centré en premier */
    .logo {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Sélecteurs centrés en dessous */
    #selecteur {
        justify-content: center !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    /* Taille normale des boutons */
    .theme-toggle {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    #selecteur {
        gap: 0.5rem !important;
    }
    
    .logoimg {
        width: 160px !important;
        height: 34px !important;
    }
}

