/* Header (navigation + theme toggle + back-to-top)
   Extracted from header.php to avoid injecting <style> in the body.
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.top-header {
    background-color: #000;
    padding: 20px 0;
    border-bottom: 1px solid #333;
}

/* Mode clair pour le header */
.light-theme .top-header {
    background-color: #fff !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.top-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

/* Bouton dark/light mode */
.theme-toggle {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    border: 2px solid #555;
    border-radius: 20px;
    width: 60px;
    height: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    background: #444;
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.theme-toggle.dark .theme-toggle-slider {
    transform: translateX(30px);
}

.theme-toggle i {
    color: #333;
}

/* Mode clair pour le sélecteur de thème */
.light-theme .theme-toggle {
    background: #f0f0f0 !important;
    border: 2px solid #0071e3 !important;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3) !important;
}

.light-theme .theme-toggle:hover {
    background: #e8f4fd !important;
    border-color: #005bb8 !important;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.4) !important;
}

.light-theme .theme-toggle-slider {
    background: #0071e3 !important;
    box-shadow: 0 3px 8px rgba(0, 113, 227, 0.4) !important;
}

/* Amélioration de la visibilité de l'icône */
.theme-toggle i {
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.light-theme .theme-toggle i {
    color: #ffffff !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.logo-link {
    position: absolute;
    left: 20px;
    z-index: 2;
}

.logo {
    height: 40px;
    width: auto;
}

.top-links {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 40px;
}

.top-links li {
    position: relative;
}

/* Délai pour maintenir le menu ouvert */
.top-links li .dropdown {
    pointer-events: none;
}

.top-links li:hover .dropdown {
    pointer-events: auto;
}

.top-links a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 10px 0;
    display: block;
}

/* Mode clair pour les liens */
.light-theme .top-links a {
    color: #000 !important;
}

.top-links a:hover {
    color: #0071e3;
}

/* Mode clair pour le hover des liens */
.light-theme .top-links a:hover {
    color: #0071e3 !important;
}

/* Style pour les sous-menus */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #111;
    min-width: 250px;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: 1000;
    padding: 10px 0;
    border: 1px solid #333;
}

/* Mode clair pour les menus déroulants */
.light-theme .dropdown {
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.top-links li:hover .dropdown {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-section {
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

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

/* Mode clair pour les sections de menu déroulant */
.light-theme .dropdown-section {
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-section h3 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 20px;
    margin-bottom: 5px;
    background: #333;
    border-radius: 4px;
    margin: 0 10px 5px 10px;
}

.dropdown a {
    padding: 8px 20px;
    font-size: 14px;
    color: #fff;
    display: block;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 10px;
}

/* Mode clair pour les éléments des menus déroulants */
.light-theme .dropdown-section h3 {
    color: #000 !important;
    background: #f5f5f5 !important;
}

.light-theme .dropdown a {
    color: #000 !important;
}

.dropdown a:hover {
    background: #333;
    color: #fff;
}

/* Mode clair pour le hover des éléments de menu déroulant */
.light-theme .dropdown a:hover {
    background: #f0f0f0 !important;
    color: #000 !important;
}

/* Indicateur pour les menus déroulants */
.has-dropdown > a::after {
    content: '▾';
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.has-dropdown:hover > a::after {
    transform: rotate(180deg);
}

/* Style pour le menu burger */
.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 20px;
    z-index: 1000;
}

.burger-bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px 0;
    background: #fff;
    transition: all 0.3s ease;
}

/* Mode clair pour le menu burger */
.light-theme .burger-bar {
    background: #000 !important;
}

/* Media queries pour le responsive */
@media (max-width: 1024px) {
    .burger-menu {
        display: block;
    }

    .top-nav {
        padding: 15px 20px;
    }

    .top-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 999;
        margin-right: 0;
        padding: 80px 20px 20px 20px;
    }

    /* Mode clair pour le menu mobile */
    .light-theme .top-links {
        background: #fff !important;
    }

    /* Ensure readability on dark mobile menu background */
    .top-links a {
        color: #fff;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Mode clair pour les liens du menu mobile */
    .light-theme .top-links a {
        color: #000 !important;
        text-shadow: none !important;
        font-weight: 600;
    }

    .top-links.active {
        transform: translateX(0);
    }

    .dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        background: transparent;
        text-align: center;
        padding: 0;
        margin-top: 10px;
    }

    .dropdown a {
        padding: 10px 0;
        font-size: 16px;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Mode clair pour les éléments de dropdown mobile */
    .light-theme .dropdown a {
        color: #000 !important;
        text-shadow: none !important;
    }

    /* Bouton de fermeture mobile */
    .mobile-close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 1001;
    }

    .close-menu-btn {
        background: rgba(255, 255, 255, 0.1) !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 50% !important;
        width: 50px !important;
        height: 50px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }

    .close-menu-btn:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
        transform: scale(1.1) !important;
    }

    /* Mode clair pour le bouton de fermeture */
    .light-theme .close-menu-btn {
        background: rgba(0, 0, 0, 0.1) !important;
        border: 2px solid rgba(0, 0, 0, 0.3) !important;
        color: #000 !important;
    }

    .light-theme .close-menu-btn:hover {
        background: rgba(0, 0, 0, 0.2) !important;
        border-color: rgba(0, 0, 0, 0.5) !important;
    }

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

    .burger-menu.active .burger-bar:nth-child(2) {
        opacity: 0;
    }

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

@media (max-width: 768px) {
    .logo {
        height: 30px;
    }

    .top-links a {
        font-size: 18px;
    }

    /* Amélioration de la visibilité sur petits écrans */
    .top-links a {
        font-size: 20px;
        padding: 15px 0;
        text-align: center;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Mode clair pour les séparateurs sur petits écrans */
    .light-theme .top-links a {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .top-links a:last-child {
        border-bottom: none;
    }

    /* Amélioration des sous-menus sur mobile */
    .dropdown {
        margin-top: 20px;
        padding: 0 20px;
    }

    .dropdown a {
        font-size: 16px;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .light-theme .dropdown a {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

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

/* Bouton retour en haut */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #0071e3;
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background: #005bb8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.4);
}

.back-to-top.show {
    display: flex;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}
