@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'League Spartan';
    src: url('fonts/LeagueSpartan-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'TuskerGrotesk';
    src: url('fonts/TuskerGrotesk-3800Super.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Kilimanjaro';
    src: url('fonts/Kilimanjaro Sans Tall.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}


:root {
    /* Variables de base */
    --bg-color: #f5f5f5;
    --text-color: #333333;
    --primary-color: #2B59A5;
    --secondary-color: #4a90e2;
    --accent-color: #6ab7ff;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    
    /* Variables spécifiques */
    --map-bg: #ffffff;
    --header-bg: #2B59A5;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --popup-bg: #ffffff;
    --popup-text: #333333;
}

/* Thème sombre */
.dark-theme {
    --bg-color: #0a0a0a; /* Fond d'écran très sombre */
    --text-color: #ffffff;
    --primary-color: #2B59A5;
    --secondary-color: #4a90e2;
    --accent-color: #6ab7ff;
    --border-color: #333333;
    --card-bg: #1a1a1a; /* Fond des cartes et conteneurs intérieurs (incluant content-container) */
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    /* Variables spécifiques pour le mode sombre */
    --map-bg: #0a0a0a;
    --header-bg: var(--bg-color); /* Utiliser le même fond que l'écran */
    --nav-bg: rgba(26, 26, 26, 0.95);
    --popup-bg: #1a1a1a;
    --popup-text: #ffffff;
}

/* Thème clair (par défaut) */
.light-theme {
    --bg-color: #f5f5f5;
    --text-color: #333333;
    --primary-color: #2B59A5;
    --secondary-color: #4a90e2;
    --accent-color: #6ab7ff;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Mode contraste élevé */
.high-contrast {
    --text-color: #000000;
    --bg-color: #ffffff;
    --primary-color: #0000ff;
    --secondary-color: #000080;
    --accent-color: #0000ff;
    --border-color: #000000;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Mode daltonien */
.daltonian-mode {
    /* Filtre par défaut (niveaux de gris) */
    filter: grayscale(100%);
}

/* Filtres SVG pour les différents types de daltonisme */
/* Définitions intégrées directement via data URI */

/* Protanopie (Rouge-Vert) */
.daltonian-mode.protanopia {
    filter: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="protanopia"><feColorMatrix type="matrix" values="0.56667 0.43333 0 0 0 0.55833 0.44167 0 0 0 0 0.24167 0.75833 0 0 0 0 0 1 0"/></filter></svg>#protanopia');
}

/* Deutéranopie (Rouge-Vert) */
.daltonian-mode.deuteranopia {
    filter: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="deuteranopia"><feColorMatrix type="matrix" values="0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0"/></filter></svg>#deuteranopia');
}

/* Tritanopie (Bleu-Jaune) */
.daltonian-mode.tritanopia {
    filter: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="tritanopia"><feColorMatrix type="matrix" values="0.95 0.05 0 0 0 0 0.43333 0.56667 0 0 0 0.475 0.525 0 0 0 0 0 1 0"/></filter></svg>#tritanopia');
}

/* Ajustements spécifiques pour les images en mode daltonien */
.daltonian-mode img {
    filter: inherit; /* Les images doivent hériter du filtre global */
}

/* Ajustements pour le texte et les éléments interactifs */
.daltonian-mode .settings-menu-item,
.daltonian-mode .filter-btn,
.daltonian-mode .bottom-nav button {
    border: 2px solid var(--text-color);
}

.daltonian-mode .settings-menu-item.active,
.daltonian-mode .filter-btn.active {
    background-color: var(--text-color);
    color: var(--bg-color);
}

/* Styles de base */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    font-family: 'League Spartan', sans-serif;
    margin: 0;
    padding: 0;
    text-align: center;
    height: 100vh;
    overflow-y: auto;
  }
  
  .title {
    font-size: 4.5em;
    font-family: 'Kajiro', serif;
    margin-bottom: 10px;
  }
  
  .subtitle {
    font-size: 1em;
    margin-bottom: 30px;
  }
  
/* Screens */
.map-screen, .fort-screen, .encyclopedie-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    min-height: 100vh;
    box-sizing: border-box;
    padding-top: 80px;
    padding-bottom: 80px;
    overflow-y: auto;
}

/* Map */
  .map-screen {
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 80px;
    height: calc(100vh - 80px);
    background-color: var(--map-bg);
}

#map {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
}

/* Bouton Lancer la navigation */
#start-navigation-btn {
    position: absolute;
    bottom: 100px; /* Juste au-dessus de la barre de navigation */
    left: 50%;
    transform: translateX(-50%);
    z-index: 800; /* Moins que la navbar, plus que la carte */
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#start-navigation-btn:hover {
    background-color: #234785;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Nouveau bouton pour recentrer la carte */
#recenter-map-btn {
    position: absolute;
    bottom: 100px;
    left: 20px;
    z-index: 800;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #2B59A5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#recenter-map-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

#recenter-map-btn:hover {
    background-color: #1E3F7D;
    transform: scale(1.05);
}

.dark-theme #recenter-map-btn {
    background-color: #1E3F7D;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.dark-theme #recenter-map-btn:hover {
    background-color: #2B59A5;
}

@media (max-width: 768px) {
    #recenter-map-btn {
        bottom: 80px;
        left: 15px;
        width: 45px;
        height: 45px;
    }

    #recenter-map-btn img {
        width: 20px;
        height: 20px;
    }
}

/* Contrôles de zoom personnalisés */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    margin: 20px !important;
}

.leaflet-control-zoom a {
    background-color: #2B59A5 !important;
    color: white !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
}

.leaflet-control-zoom a:hover {
    background-color: #234785 !important;
}

/* Style des marqueurs personnalisés */
.custom-marker {
    background-color: #2B59A5; /* Couleur par défaut (bleu) */
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    width: 12px !important;
    height: 12px !important;
    margin-left: -6px !important;
    margin-top: -6px !important;
    transition: all 0.3s ease;
    position: relative; /* Nécessaire pour positionner ::after */
}

.custom-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background-color: white; /* Cercle intérieur blanc */
    box-shadow: 0 0 0 2px #2B59A5; /* Halo bleu par défaut */
    border-radius: 50%;
}

/* Styles pour chaque parcours */
.custom-marker.parcours1 {
    background-color: #ff9600; /* Orange pour le parcours 1 */
}

.custom-marker.parcours1::after {
    box-shadow: 0 0 0 2px #ff9600; /* Halo orange pour le parcours 1 */
}

.custom-marker.parcours2 {
    background-color: #72d12e; /* Vert pour le parcours 2 */
}

.custom-marker.parcours2::after {
    box-shadow: 0 0 0 2px #72d12e; /* Halo vert pour le parcours 2 */
}

.custom-marker:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Ajustement pour le mode sombre */
.dark-theme .custom-marker {
     border-color: #1a1a1a; /* Bordure sombre en mode sombre */
}

.dark-theme .custom-marker::after {
     box-shadow: 0 0 0 2px #1a1a1a; /* Halo sombre par défaut */
}

.dark-theme .custom-marker.parcours1::after {
     box-shadow: 0 0 0 2px #ff9600; /* Halo orange en mode sombre */
}

.dark-theme .custom-marker.parcours2::after {
     box-shadow: 0 0 0 2px #72d12e; /* Halo vert en mode sombre */
}

/* Style personnalisé pour les popups */
.leaflet-popup-content-wrapper {
    background-color: var(--popup-bg);
    color: var(--popup-text);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 300px !important;
}

.popup-content {
    padding: 0;
}

.popup-header {
    background-color: #2B59A5;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.popup-header h3 {
    margin: 0;
    font-size: 2.8em;
    font-weight: 300;
    color: white;
    font-family: 'TuskerGrotesk', sans-serif;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

.popup-image {
    width: calc(100% - 30px);
    height: 180px;
    object-fit: cover;
    margin: 15px;
    border-radius: 15px;
    border: 2px solid #eee;
}

.popup-description {
    color: var(--popup-text);
    line-height: 1.5;
    margin: 0 15px 15px 15px;
    padding: 0 15px;
    text-align: center;
    font-size: 0.95em;
    font-family: 'League Spartan', sans-serif;
}

.popup-resources {
    background-color: var(--card-bg);
    padding: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
}

.popup-resources h4 {
    color: #2B59A5;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.1em;
}

.resource-item {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}

.resource-item:last-child {
    margin-bottom: 0;
}

.resource-item img,
.resource-item iframe {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Styles spécifiques pour la vidéo */
.resource-item video {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    margin-bottom: 10px;
    object-fit: cover;
    animation: video-fade-in 0.3s ease-out;
}

/* Style spécifique pour la vidéo en plein écran */
.resource-item video:fullscreen {
    width: auto !important;
    height: 100vh !important;
    object-fit: contain !important;
    background-color: black !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.resource-item video:-webkit-full-screen {
    width: auto !important;
    height: 100vh !important;
    object-fit: contain !important;
    background-color: black !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.resource-item video:-moz-full-screen {
    width: auto !important;
    height: 100vh !important;
    object-fit: contain !important;
    background-color: black !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.resource-item video:-ms-fullscreen {
    width: auto !important;
    height: 100vh !important;
    object-fit: contain !important;
    background-color: black !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.video-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 10px;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    padding: 20px;
}

.play-button::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    z-index: 2;
}

.play-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.play-button img {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    filter: invert(24%) sepia(98%) saturate(1552%) hue-rotate(207deg) brightness(97%) contrast(101%);
    transition: transform 0.2s ease;
    position: relative;
    z-index: 3;
}

.play-button:hover img {
    transform: scale(1.1);
}

.video-thumbnail {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-thumbnail:hover {
    transform: scale(1.02);
}

@keyframes video-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mode sombre */
.dark-theme .play-button {
    background: rgba(255, 255, 255, 0.9);
}

.dark-theme .play-button:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.resource-description {
    color: var(--text-color);
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.leaflet-popup-tip {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.leaflet-container a.leaflet-popup-close-button {
    color: white;
    padding: 15px;
    font-weight: normal;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: white;
    opacity: 1;
}

/* Style du marqueur utilisateur */
.user-marker {
    width: 32px !important;
    height: 32px !important;
    margin-left: -16px !important;
    margin-top: -16px !important;
    position: relative;
    transition: all 0.3s ease-in-out;
}

/* Conteneur intérieur du marqueur, positionnement de base */
.user-marker-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    width: 16px;
    height: 16px;
    background: #2B59A5;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(43, 89, 165, 0.2);
    animation: pulse-dot 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
}

/* Style pour l'icône statique (point) */
.user-marker.static .user-marker-inner {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.user-marker.static .user-direction-arrow {
    display: none;
    opacity: 0;
    transform: scale(0);
}

/* Style pour l'icône directionnelle (flèche) */
.user-marker.directional .user-marker-inner {
    width: 32px;
    height: 32px;
    background: #2B59A5;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 50% 50% 0 0;
    position: static;
    transform: rotate(0deg);
    transform-origin: 50% 100%;
    transition: all 0.3s ease-in-out;
    display: block;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
                0 0 35px rgba(43, 89, 165, 0.7),
                0 0 45px rgba(43, 89, 165, 0.5),
                0 0 55px rgba(43, 89, 165, 0.3);
    filter: drop-shadow(0 0 12px rgba(43, 89, 165, 0.6));
    border: 2px solid white;
    background: linear-gradient(135deg, #2B59A5 0%, #1a3d7a 100%);
    animation: pulse-arrow 1.5s ease-in-out infinite;
}

/* Animation de pulsation pour la flèche */
@keyframes pulse-arrow {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
                    0 0 35px rgba(43, 89, 165, 0.7),
                    0 0 45px rgba(43, 89, 165, 0.5),
                    0 0 55px rgba(43, 89, 165, 0.3);
        filter: drop-shadow(0 0 12px rgba(43, 89, 165, 0.6));
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3),
                    0 0 40px rgba(43, 89, 165, 0.8),
                    0 0 50px rgba(43, 89, 165, 0.6),
                    0 0 60px rgba(43, 89, 165, 0.4);
        filter: drop-shadow(0 0 16px rgba(43, 89, 165, 0.7));
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
                    0 0 35px rgba(43, 89, 165, 0.7),
                    0 0 45px rgba(43, 89, 165, 0.5),
                    0 0 55px rgba(43, 89, 165, 0.3);
        filter: drop-shadow(0 0 12px rgba(43, 89, 165, 0.6));
    }
}

/* Ajustement en mode sombre pour le conteneur en mode directionnel */
.dark-theme .user-marker.directional .user-direction-arrow {
    background: linear-gradient(135deg, #4a90e2 0%, #2B59A5 100%);
    border-color: #1a1a1a;
    /* Ajustement de l'animation pour le mode sombre */
    animation: pulse-arrow-dark 1.5s ease-in-out infinite;
    /* Halo plus prononcé en mode sombre */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(74, 144, 226, 0.6),
                0 0 40px rgba(74, 144, 226, 0.4);
    filter: drop-shadow(0 0 12px rgba(74, 144, 226, 0.5));
}

/* Animation de pulsation pour la flèche en mode sombre */
@keyframes pulse-arrow-dark {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4),
                    0 0 30px rgba(74, 144, 226, 0.6),
                    0 0 40px rgba(74, 144, 226, 0.4);
        filter: drop-shadow(0 0 12px rgba(74, 144, 226, 0.5));
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5),
                    0 0 35px rgba(74, 144, 226, 0.7),
                    0 0 45px rgba(74, 144, 226, 0.5);
        filter: drop-shadow(0 0 16px rgba(74, 144, 226, 0.6));
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4),
                    0 0 30px rgba(74, 144, 226, 0.6),
                    0 0 40px rgba(74, 144, 226, 0.4);
        filter: drop-shadow(0 0 12px rgba(74, 144, 226, 0.5));
    }
}

/* Corriger l'animation pulse-dot pour ne pas interférer */
@keyframes pulse-dot {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes pulse-ring { /* Animation non utilisée actuellement, mais conservée */
    0% {
        transform: translate(-50%, -50%) scale(0.33);
        opacity: 1;
    }
    80%, 100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Contenu des pages */
.content-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Page Fort */
.fort-screen {
    min-height: 100vh;
    padding-bottom: 100px;
}

.fort-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 15px;
}

.fort-intro {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.fort-intro p {
    font-size: 1.2em;
    line-height: 1.5;
    text-align: center;
    padding: 0 15px;
}

.fort-image {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fort-text {
    font-size: 1.1em;
    line-height: 1.5;
    text-align: left;
    padding: 0 15px;
}

.fort-text h3 {
    color: #2B59A5;
    margin-top: 30px;
    margin-bottom: 15px;
    text-align: center;
    padding: 0 20px;
}

.fort-text p {
    margin-bottom: 15px;
}

.fort-mascotte {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
}

.mascotte-content {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

.mascotte-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
}

.fort-mediation {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.mediation-image {
    width: 100%;
    max-width: 600px;
    border-radius: 15px;
    margin-top: 20px;
}

.fort-parcours {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
}

.parcours-steps {
    list-style-type: none;
    padding: 0;
    margin: 15px 0;
}

.parcours-steps li {
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.parcours-steps li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #2B59A5;
}

.fort-themes {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.theme-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.theme-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.theme-card h4 {
    font-family: 'League Spartan', sans-serif;
    font-size: 1.3em;
    color: #2B59A5;
    margin: 0;
    text-align: center;
}

/* Page Encyclopédie */
.encyclopedie-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    min-height: 100vh;
    box-sizing: border-box;
    padding-top: 80px;
    padding-bottom: 80px;
    overflow-x: hidden;
    width: 100%;
}

.encyclopedie-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.search-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

.search-bar {
    width: 100%;
    box-sizing: border-box;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1em;
    font-family: 'League Spartan', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-bar input:focus {
    outline: none;
    border-color: #2B59A5;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #2B59A5;
    border-radius: 20px;
    background: white;
    color: #2B59A5;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-family: 'League Spartan', sans-serif;
    font-weight: 500;
}

.filter-btn:hover {
    background: #2B59A5;
    color: white;
}

.filter-btn.active {
    background: #2B59A5;
    color: white;
}

.poi-filter {
    width: 100%;
    box-sizing: border-box;
}

.poi-filter select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1em;
    font-family: 'League Spartan', sans-serif;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.poi-filter select:focus {
    outline: none;
    border-color: #2B59A5;
}

.resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

.resource-card {
    width: 100%;
    box-sizing: border-box;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.resource-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
}

.resource-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .encyclopedie-content {
        max-width: 800px;
        margin: 0 auto;
    }

    .search-filters {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .search-bar {
        flex: 2;
        min-width: 300px;
    }

    .filters {
        flex: 1;
        min-width: 200px;
    }

    .poi-filter {
        flex: 1;
        min-width: 200px;
    }

    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

  /*Header*/
  .top-header {
    background-color: var(--header-bg);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  .logo-header {
    height: 60px;
    filter: brightness(0) invert(1);
}

  /*Navbar*/
  .bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 35px;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  .bottom-nav button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 25%;
    height: 100%;
    overflow: hidden;
  }

  .bottom-nav button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #4a90e2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border-radius: 3px;
  }

  .bottom-nav button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 40px;
    height: 40px;
    background: rgba(43, 89, 165, 0.1);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
  }

  .bottom-nav img {
    width: 24px;
    height: 24px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
  } 

  .bottom-nav button:hover {
    transform: translateY(-2px);
  }

  .bottom-nav button:hover::before {
    width: 30px;
    opacity: 1;
  }

  .bottom-nav button:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .bottom-nav button.active-nav {
    background: none;
  }

  .bottom-nav button.active-nav::before {
    width: 30px;
    opacity: 1;
    background: linear-gradient(90deg, var(--primary-color), #4a90e2);
  }

  .bottom-nav button.active-nav::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    background: rgba(43, 89, 165, 0.15);
  }

  .bottom-nav button.active-nav img {
    transform: scale(1.1) rotate(360deg);
  }

  @media (max-width: 768px) {
  .bottom-nav {
      height: 65px;
      bottom: 15px;
      width: calc(100% - 30px);
    }

    .bottom-nav button {
      padding: 8px;
    }

    .bottom-nav img {
      width: 22px;
      height: 22px;
    }
  }

  .dark-theme .bottom-nav {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .dark-theme .bottom-nav button::after {
    background: rgba(43, 89, 165, 0.2);
  }

  .dark-theme .bottom-nav button.active-nav::after {
    background: rgba(43, 89, 165, 0.25);
  }

@media (max-width: 768px) {
    .bottom-nav {
        bottom: 15px;
        width: calc(100% - 30px);
        height: 65px;
    }

    .bottom-nav img {
        width: 22px;
        height: 22px;
    }
}

/* Écran de chargement */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #2B59A5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease-in-out 2s forwards;
}

.loading-logo {
    width: 120px;
    height: 120px;
    filter: brightness(0) invert(1);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

h2, h3, popup-header h3, modal-content h4, modal-content h5 {
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 3.6em;
    font-weight: normal;
    letter-spacing: 0.02em;
    margin: 0;
    color: var(--primary-color);
}

h3 {
    font-size: 2.4em;
    letter-spacing: 0.02em;
    color: var(--primary-color);
}

.popup-header h3 {
    font-size: 2.8em;
    letter-spacing: 0.02em;
    color: white;
}

.modal-content h4 {
    font-size: 2.4em;
    letter-spacing: 0.02em;
    color: var(--primary-color);
}

.modal-content h5 {
    font-size: 1.6em;
    letter-spacing: 0.02em;
    color: var(--primary-color);
}

p {
    font-family: 'League Spartan', sans-serif;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .title {
        font-size: 5.5em;
    }

    h2 {
        font-size: 4.8em;
    }

    .fort-text h3 {
        font-size: 3.2em;
    }

    .fort-intro p {
        font-size: 1.4em;
    }

    .fort-text {
        font-size: 1.2em;
    }

    .fort-content {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Page Réglages */
.settings-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    min-height: 100vh;
    box-sizing: border-box;
    padding-top: 80px;
    padding-bottom: 80px;
    overflow-x: hidden;
    width: 100%;
  }
    
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.settings-menu {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    box-sizing: border-box;
    position: relative;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
}

.settings-menu-item img {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(40%) sepia(100%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(90%);
}

.settings-menu-item span {
    display: inline;
    font-size: 1em;
    font-weight: 500;
}

.settings-menu-item:hover {
    background: rgba(43, 89, 165, 0.1);
}

.settings-menu-item:hover img {
    transform: translateY(-2px);
    opacity: 0.8;
}

.settings-menu-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    border: none;
}

.settings-menu-item.active img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Styles spécifiques pour le mode sombre */
.dark-theme .settings-menu-item {
    color: var(--text-color);
    border: none;
}

.dark-theme .settings-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .settings-menu-item img {
    filter: brightness(0) invert(1);
}

/* Styles de l'état actif pour le mode sombre */
.dark-theme .settings-menu-item.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.settings-sections {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.settings-section {
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.settings-section.active {
    display: block;
}

.settings-section h3 {
    color: #2B59A5;
    margin-top: 0;
    margin-bottom: 30px;
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 3.2em;
    text-align: left;
}

.settings-section p {
    color: #666;
    line-height: 1.6;
    font-size: 1.2em;
    font-family: 'League Spartan', sans-serif;
    text-align: left;
}

/* Options de réglages */
.settings-option {
    margin-bottom: 30px;
    text-align: left;
}

.settings-option label {
    display: block;
    font-family: 'League Spartan', sans-serif;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 12px;
    font-weight: 500;
}

.settings-option select,
.settings-option input[type="text"],
.settings-option input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    font-family: 'League Spartan', sans-serif;
    color: #333;
    background-color: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B59A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

.settings-option select:focus,
.settings-option input:focus {
    outline: none;
    border-color: #2B59A5;
    box-shadow: 0 0 0 3px rgba(43, 89, 165, 0.1);
}

.settings-option .toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.settings-option .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-option .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e0e0e0; /* Gris clair par défaut */
    transition: .4s;
    border-radius: 34px;
}

.settings-option .toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px; /* Position initiale du bouton */
    bottom: 4px;
    background-color: white; /* Couleur du bouton */
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Styles lorsque le toggle est ACTIF (input coché) */
.settings-option input:checked + .toggle-slider {
    background-color: var(--primary-color); /* Changer la couleur de fond */
}

.settings-option input:checked + .toggle-slider:before {
    transform: translateX(26px); /* Déplacer le bouton vers la droite */
    background-color: white; /* S'assurer qu'il reste blanc */
    animation: pulse-small 1.5s infinite ease-in-out; /* Ajouter une animation */
}

/* Définition de l'animation */
@keyframes pulse-small {
    0% {
        transform: translateX(26px) scale(1);
    }
    50% {
        transform: translateX(26px) scale(1.1);
    }
    100% {
        transform: translateX(26px) scale(1);
    }
}

/* Styles spécifiques pour le mode sombre */
.dark-theme .settings-option label {
    color: var(--text-color);
}

.dark-theme .settings-option select,
.dark-theme .settings-option input {
    background-color: #1e1e1e;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dark-theme .settings-option select:focus,
.dark-theme .settings-option input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 89, 165, 0.2);
}

.dark-theme .toggle-slider {
    background-color: var(--border-color); /* Couleur de base en mode sombre */
}

.dark-theme .toggle-slider:before {
    background-color: var(--text-color); /* Couleur du bouton en mode sombre */
}

.dark-theme input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

/* Section À propos */
.about-content {
    text-align: left;
}

.about-content p {
    margin-bottom: 15px;
    color: #666;
    font-size: 1.1em;
}

.about-links {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.about-links a {
    color: #2B59A5;
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.about-links a:hover {
    color: #234785;
    text-decoration: underline;
}

/* Styles pour les sous-sections de la page À propos */
.about-subsection {
    display: none; /* Masqué par défaut */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.about-subsection.active {
    display: block; /* Affiché quand actif */
}

.about-subsection h4 {
    color: #2B59A5;
    font-family: 'League Spartan', sans-serif; /* Utiliser League Spartan pour les sous-titres */
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: left;
}

.about-subsection h5 {
    color: #2B59A5;
    font-family: 'League Spartan', sans-serif;
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: left;
}

.about-subsection p {
    color: #666;
    line-height: 1.6;
    font-size: 1em;
    margin-bottom: 15px;
}

.about-subsection a {
    color: #2B59A5;
    text-decoration: underline;
}

.about-subsection a:hover {
    color: #234785;
}

/* Styles spécifiques pour le mode sombre */
.dark-theme .about-subsection {
    border-top-color: var(--border-color);
}

.dark-theme .about-subsection h4,
.dark-theme .about-subsection h5 {
    color: var(--text-color); /* Les titres en blanc en mode sombre */
}

.dark-theme .about-subsection p {
    color: var(--text-color); /* Le texte en blanc en mode sombre */
}

.dark-theme .about-subsection a {
    color: var(--secondary-color); /* Liens en bleu clair en mode sombre */
}

.dark-theme .about-subsection a:hover {
    color: var(--accent-color); /* Liens plus clairs au survol */
}

@media (max-width: 768px) {
    .settings-menu {
        padding: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .settings-menu-item {
        padding: 10px 15px;
        white-space: nowrap;
    }

    .settings-menu-item img {
        width: 20px;
        height: 20px;
    }

    .settings-menu-item span {
        font-size: 0.9em;
    }

    .settings-option {
        margin-bottom: 25px;
    }

    .settings-option label {
        font-size: 1em;
    }

    .settings-option select,
    .settings-option input[type="text"],
    .settings-option input[type="number"] {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .about-content p {
        font-size: 1em;
    }

    .about-links a {
        font-size: 1em;
    }
}

/* Mise à jour des styles pour le mode sombre */
.dark-theme .content-container {
    background-color: var(--card-bg);
    border: none;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    padding: 0;
    margin: 0;
    width: 100%;
}

.dark-theme .settings-menu {
    background-color: var(--card-bg);
    border: none;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    margin: 0;
    padding: 15px;
}

.dark-theme .settings-sections {
    background-color: var(--card-bg);
    border: none;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    margin: 0;
    padding: 30px;
}

.dark-theme .settings-content {
    padding: 0;
    margin: 0;
}

.dark-theme .settings-section {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.dark-theme .settings-option {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(255, 255, 255, 0.03);
}

.dark-theme .settings-menu-item {
    color: var(--text-color);
}

.dark-theme .settings-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .settings-menu-item.active {
    background-color: var(--primary-color);
    color: var(--text-color);
    font-weight: 700;
    border: 2px solid white;
}

.dark-theme .settings-menu-item.active img {
    filter: brightness(0) invert(1);
}

.dark-theme .settings-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .settings-option label {
    color: var(--text-color);
}

.dark-theme .settings-option select,
.dark-theme .settings-option input {
    background-color: #1e1e1e;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dark-theme .settings-option select:focus,
.dark-theme .settings-option input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 89, 165, 0.2);
}

.dark-theme .settings-option select option {
    background-color: #1e1e1e;
    color: var(--text-color);
}

.dark-theme .toggle-slider {
    background-color: var(--border-color);
}

.dark-theme .toggle-slider:before {
    background-color: var(--text-color);
}

.dark-theme input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

/* Styles pour la carte en mode sombre */
.dark-theme .leaflet-container {
    background-color: var(--bg-color) !important;
}

.dark-theme .leaflet-tile {
    filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

.dark-theme .leaflet-control-zoom a {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--border-color) !important;
}

.dark-theme .leaflet-control-zoom a:hover {
    background-color: #234785 !important;
}

.dark-theme .leaflet-popup-content-wrapper {
    background-color: var(--popup-bg) !important;
    border: 1px solid var(--border-color) !important;
}

.dark-theme .leaflet-popup-tip {
    background-color: var(--popup-bg) !important;
}

.dark-theme .leaflet-container a.leaflet-popup-close-button {
    color: var(--text-color) !important;
}

/* Styles pour la navbar en mode sombre */
.dark-theme .bottom-nav {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .bottom-nav button {
    color: var(--text-color);
}

.dark-theme .bottom-nav button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .bottom-nav button.active-nav {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Styles pour le header en mode sombre */
.dark-theme .top-header {
    background-color: var(--card-bg); /* Utiliser le même gris que le fond des cartes */
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dark-theme .logo-header {
    filter: brightness(0) saturate(100%) invert(40%) sepia(100%) saturate(1000%) hue-rotate(200deg) brightness(90%) contrast(90%); /* Filtre pour rendre le logo bleu */
}

/* Styles pour les écrans en mode sombre */
.dark-theme .map-screen,
.dark-theme .fort-screen,
.dark-theme .encyclopedie-screen,
.dark-theme .settings-screen {
    background-color: var(--bg-color);
}

/* Styles pour les popups en mode sombre */
.dark-theme .leaflet-popup-content-wrapper {
    background-color: var(--popup-bg);
    color: var(--popup-text);
}

.dark-theme .popup-header {
    background-color: var(--primary-color);
    color: #ffffff;
}

.dark-theme .popup-description {
    color: var(--popup-text);
}

.dark-theme .popup-resources {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.dark-theme .resource-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.dark-theme .resource-description {
    color: var(--popup-text);
}

/* Styles pour les cartes en mode sombre */
.dark-theme .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Styles pour les inputs en mode sombre */
.dark-theme input,
.dark-theme select {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Styles pour les sections en mode sombre */
.dark-theme .section {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Styles pour les toggles en mode sombre */
.dark-theme .toggle-slider {
    background-color: var(--border-color);
}

.dark-theme .toggle-slider:before {
    background-color: var(--text-color);
}

.dark-theme input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.dark-theme .fort-content {
    background-color: var(--card-bg);
}

.dark-theme .fort-text {
    color: var(--text-color);
}

.dark-theme .fort-text h3 {
    color: var(--secondary-color);
}

.dark-theme .parcours-steps li {
    color: var(--text-color);
}

.dark-theme .parcours-steps li:before {
    color: var(--secondary-color);
}

.dark-theme .about-content {
    color: var(--text-color);
}

.dark-theme .about-links a {
    color: var(--secondary-color);
}

.dark-theme .about-links a:hover {
    color: var(--accent-color);
}

.dark-theme .search-bar input {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dark-theme .poi-filter select {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dark-theme .filter-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.dark-theme .filter-btn:hover {
    background-color: #2d2d2d;
}

.dark-theme .filter-btn.active {
    background-color: var(--primary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
  }

/* Styles pour les modales (pop-ups) */
.modal {
    display: none; /* Masqué par défaut */
    position: fixed; /* Rester en place */
    z-index: 2000; /* S'assurer qu'il est au-dessus de tout le reste */
    left: 0;
    top: 0;
    width: 100%; /* Pleine largeur */
    height: 100%; /* Pleine hauteur */
    overflow: auto; /* Permettre le défilement si nécessaire */
    background-color: rgba(0, 0, 0, 0.6); /* Fond semi-transparent noir */
    backdrop-filter: blur(5px); /* Effet de flou sur l'arrière-plan */
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex; /* Affiché avec flexbox quand la classe active est ajoutée */
}

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 40px; /* Augmenter le padding */
    border-radius: 15px;
    width: 90%;
    max-width: 700px; /* Augmenter la largeur maximale si nécessaire pour le contenu */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: left;
    max-height: 80vh;
    overflow-y: auto;
}

.close-button {
    color: var(--primary-color); /* Mettre la croix en bleu */
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--secondary-color); /* Changer la couleur au survol/focus */
    text-decoration: none;
}

.modal-content h4 {
    color: var(--primary-color);
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 2.4em;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

.modal-content h5 {
    color: var(--primary-color);
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 1.6em;
    margin-top: 25px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: 300;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

.modal-content p {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.modal-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.modal-content a:hover {
    color: var(--secondary-color);
}

/* Styles spécifiques pour le mode sombre */
.dark-theme .modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.dark-theme .close-button {
    color: var(--secondary-color);
}

.dark-theme .close-button:hover,
.dark-theme .close-button:focus {
    color: var(--accent-color);
}

.dark-theme .modal-content h4 {
    color: var(--secondary-color);
}

.dark-theme .modal-content h5 {
    color: var(--secondary-color);
}

.dark-theme .modal-content p {
    color: var(--text-color);
}

.dark-theme .modal-content a {
    color: var(--secondary-color);
}

.dark-theme .modal-content a:hover {
    color: var(--accent-color);
}

/* Styles spécifiques pour la modale de sélection de parcours */
#parcours-select-modal .modal-content {
    max-width: 600px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#parcours-select-modal h4 {
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 2.8em;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.02em;
}

.parcours-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.parcours-option-btn {
    width: 100%;
    padding: 25px;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.parcours-option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.parcours-option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(43, 89, 165, 0.2);
}

.parcours-option-btn:hover::before {
    opacity: 0.1;
}

.parcours-option-btn h5 {
    font-family: 'League Spartan', sans-serif;
    font-size: 1.6em;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 12px 0;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 2;
    line-height: 1.3;
}

.parcours-option-btn p {
    font-family: 'League Spartan', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin: 0;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
  }
  
.close-modal-btn {
    background-color: var(--primary-color);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1em;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto 0;
    font-family: 'League Spartan', sans-serif;
    display: block;
}

.close-modal-btn:hover {
    background-color: #1E3F7D;
    transform: translateY(-2px);
}

.dark-theme .close-modal-btn {
    background-color: var(--primary-color);
    color: white;
}

.dark-theme .close-modal-btn:hover {
    background-color: #1E3F7D;
}

.dark-theme #parcours-select-modal .modal-content {
    background-color: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.dark-theme #parcours-select-modal h4 {
    color: var(--primary-color);
}

.dark-theme .parcours-option-btn {
    background-color: #1a1a1a;
    border-color: var(--primary-color);
}

.dark-theme .parcours-option-btn:hover {
    box-shadow: 0 5px 15px rgba(43, 89, 165, 0.3);
}

.dark-theme .parcours-option-btn h5 {
    color: var(--primary-color);
}

.dark-theme .parcours-option-btn p {
    color: #ffffff;
}

.dark-theme .parcours-option-btn:hover h5,
.dark-theme .parcours-option-btn:hover p {
    color: var(--primary-color);
}

.dark-theme .close-modal-btn {
    background-color: #2a2a2a;
    color: #999;
}

.dark-theme .close-modal-btn:hover {
    background-color: #333;
}

/* Animation d'entrée pour la modale */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#parcours-select-modal.active .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* Style pour les marqueurs numérotés du parcours */
.numbered-marker {
    background: none;
    border: none;
}

.marker-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.3s ease;
}

.marker-number.current {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    animation: pulse-current 1.5s infinite;
}

.marker-number.next {
    transform: scale(1.1);
}

@keyframes pulse-current {
    0% {
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
}

.dark-theme .marker-number {
    border-color: #1a1a1a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.dark-theme .marker-number.current {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: pulse-current-dark 1.5s infinite;
}

@keyframes pulse-current-dark {
    0% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    }
    100% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }
}

/* Styles pour le panneau de navigation style Waze */
.navigation-info-panel {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--nav-bg);
    padding: 15px 25px;
    border-radius: 35px;
    box-shadow: 0 4px 20px rgba(43, 89, 165, 0.15);
    width: auto;
    min-width: 320px;
    max-width: 400px;
    transition: top 0.3s ease-out;
    border: 1px solid rgba(43, 89, 165, 0.1);
    z-index: 1001;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 20px;
}

.navigation-info-panel.active {
    top: 20px;
    animation: none;
}

/* Masquer la carte derrière le panneau */
.navigation-info-panel.active ~ #map {
    margin-top: 140px;
    height: calc(100% - 140px);
}

.navigation-info-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    flex: 1;
    position: relative;
}

.info-item:first-child::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 1px;
    background-color: rgba(43, 89, 165, 0.2);
}

.info-label {
    color: var(--primary-color);
    font-size: 0.9em;
    font-family: 'League Spartan', sans-serif;
    font-weight: 600;
    text-align: center;
    opacity: 0.9;
    margin-bottom: 4px;
}

.info-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.2em;
    font-family: 'League Spartan', sans-serif;
    text-align: center;
    margin: 0;
}

/* Mode sombre */
.dark-theme .navigation-info-panel {
    background-color: var(--bg-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .info-item:first-child::after {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .info-label,
.dark-theme .info-value {
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .navigation-info-panel {
        padding: 12px 20px;
        min-width: 280px;
    }

    .info-value {
        font-size: 2em;
    }

    .info-label {
        font-size: 0.85em;
    }
}

/* Animation d'entrée */
@keyframes slide-down {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.navigation-info-panel.active {
    animation: slide-down 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

.error-modal .modal-content {
    max-width: 400px;
    text-align: center;
    padding: 30px;
}

.error-modal h4 {
    color: #e74c3c;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.error-modal p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 25px;
}

.dark-theme .error-modal .modal-content {
    background-color: #1a1a1a;
}

.dark-theme .error-modal h4 {
    color: #e74c3c;
}

.dark-theme .error-modal p {
    color: #999;
  }
  
.poi-section-title {
    color: #2B59A5;
    font-family: 'League Spartan', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 2px;
    text-align: left;
}

.poi-section-content {
    color: var(--text-color);
    font-family: 'League Spartan', sans-serif;
    font-size: 1em;
    margin-bottom: 8px;
    text-align: left;
}

.dark-theme .poi-section-title {
    color: var(--secondary-color);
}

.poi-popup-scrollable {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

@media (min-width: 600px) {
    .poi-popup-scrollable {
        max-height: 650px;
    }
}

@media (min-width: 900px) {
    .poi-popup-scrollable {
        max-height: 750px;
    }
}

.poi-title {
    color: #2B59A5;
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 2.7em;
    font-weight: normal;
    letter-spacing: 0.02em;
    margin: 0 0 16px 0;
    background: none;
    text-align: center;
}

.dark-theme .poi-title {
    color: var(--secondary-color);
}

.poi-fiche-text {
    font-family: 'League Spartan', sans-serif;
    font-size: 1.35em;
    color: var(--text-color);
    line-height: 1.7;
    margin-bottom: 18px;
    text-align: center;
}

.poi-section-title {
    color: #2B59A5;
    font-family: 'League Spartan', sans-serif;
    font-size: 1.45em;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 6px;
    text-align: center;
}

.poi-section-content {
    color: var(--text-color);
    font-family: 'League Spartan', sans-serif;
    font-size: 1.22em;
    margin-bottom: 14px;
    text-align: center;
}

/* Croix de fermeture de la popup POI */
.leaflet-container a.leaflet-popup-close-button {
    color: #2B59A5 !important;
    font-size: 2.2em !important;
    font-weight: bold;
    opacity: 1;
    right: 12px;
    top: 8px;
    transition: color 0.3s;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #234785 !important;
}

.dark-theme .leaflet-container a.leaflet-popup-close-button {
    color: var(--secondary-color) !important;
}

.welcome-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(43, 89, 165, 0.15);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s;
}

.welcome-modal.active {
    display: flex;
}

.welcome-modal .modal-content {
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(43, 89, 165, 0.15);
    padding: 38px 32px 32px 32px;
    max-width: 480px;
    width: 92vw;
    text-align: center;
    animation: welcomePopIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-modal h4 {
    color: #2B59A5;
    font-family: 'TuskerGrotesk', sans-serif;
    font-size: 2.1em;
    margin-bottom: 18px;
}

.welcome-modal p {
    font-size: 1.18em;
    color: var(--text-color);
    margin-bottom: 28px;
    line-height: 1.6;
}

.welcome-modal .close-modal-btn {
    background-color: #2B59A5;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.welcome-modal .close-modal-btn:hover {
    background-color: #234785;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes welcomePopIn {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(-30px);
    }
    60% {
        opacity: 1;
        transform: scale(1.04) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
  }
  