body {
    padding: 0;
    margin: 0;
    overflow-x: hidden; /* Évite le scroll horizontal */
}

html, body {
    height: 100vh; /* Utiliser vh plutôt que % pour plus de cohérence */
    width: 100vw;
}

#map, #map2 {
    height: 100vh; /* Hauteur viewport plutôt que % */
    width: 100vw;
    margin-bottom: 30px;
    box-sizing: border-box; /* Important pour Chrome */
}

/* Alternative plus robuste pour les conteneurs de carte */
#map, #map2 {
    position: relative;
    min-height: calc(100vh - 30px); /* Compenser le margin-bottom */
}

.info {
    padding: 6px 8px;
    background: white;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}

.leaflet-control-thresholds {
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

/* Styles du panneau Thresholds */
.leaflet-control-thresholds {
    opacity: 0.8;
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

.threshold-options {
    display: block !important;
    white-space: nowrap;
    background: white;
    padding: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    border-radius: 4px;
}

.threshold-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 3px 0;
}

.threshold-options input[type="checkbox"] {
    cursor: pointer;
}

.threshold-options span {
    width: 15px;
    height: 15px;
    display: inline-block;
    border: 1px solid #333;
    border-radius: 3px;
}

.show {
    display: block;
}

.range-control {
    position: absolute;
    top: 115px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 5px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.range-control:hover {
    background: rgba(255, 255, 255, 0.9);
}

#fl-min {
    margin-top: 10px;
}

#slider {
    height: 280px !important;
    margin: 10px 5px;
    transition: height 0.3s ease, margin 0.3s ease;
    /* Ajustements spécifiques pour Chrome */
    box-sizing: border-box;
    max-height: 280px;
}

.range-values {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}

.noUi-vertical {
    width: 10px;
    background: rgba(220, 220, 220, 0.7);
}

.noUi-connect {
    background: rgba(66, 133, 244, 0.7);
}

.noUi-vertical .noUi-handle {
    width: 18px;
    height: 24px;
    right: -4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.noUi-handle:hover {
    background: rgba(255, 255, 255, 1);
}

.noUi-handle:after, .noUi-handle:before {
    display: none;
}

.leaflet-control-layers {
    opacity: 0.8 !important;
}

.marker-cluster {
    background-color: rgba(0, 123, 255, 0.7);
    border-radius: 50%;
    text-align: center;
    color: white;
    font-weight: bold;
}

.marker-cluster.small {
    width: 30px;
    height: 30px;
    line-height: 30px;
}

.marker-cluster.medium {
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.marker-cluster.large {
    width: 50px;
    height: 50px;
    line-height: 50px;
}

/* Style du bouton Volcans */
.volcano-button {
    background-color: white;
    color: #020202;
    opacity: 0.8;
    font-size: 16px;
    padding: 8px 12px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.volcano-button:hover {
    background-color: #f4f4f4;
    border-color: rgba(0,0,0,0.4);
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.volcano-button:focus {
    outline: none;
}

.leaflet-bar button {
    border-radius: 3px;
}

.leaflet-control-custom {
    font-size: 14px;
    font-weight: bold;
    color: black;
    background-color: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    box-shadow: none;
    text-decoration: none;
    width: 50px !important;
    height: auto;
    padding: 0 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.leaflet-control-custom:hover {
    background-color: #f4f4f4;
    border-color: rgba(0,0,0,0.4);
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 999;
    display: none;
}

.loader-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    display: none;
    z-index: 1000;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Media queries améliorées pour le slider */
@media (orientation: landscape) and (max-height: 600px) {
    #slider {
        height: 100px !important;
        max-height: 100px !important;
        margin: 10px 5px;
        transition: height 0.3s ease, margin 0.3s ease;
    }
}

@media (max-height: 600px) and (max-width: 545px) {
    #slider {
        height: 120px !important;
        max-height: 120px !important;
        margin: 10px 5px;
        transition: height 0.3s ease, margin 0.3s ease;
    }
}

/* Ajustements spécifiques du slider pour Chrome/Webkit */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    #slider {
        height: 280px !important; /* Légèrement réduit pour Chrome */
        max-height: 280px !important;
    }

    @media (orientation: landscape) and (max-height: 600px) {
        #slider {
            height: 90px !important; /* Réduit pour Chrome en paysage */
            max-height: 90px !important;
        }
    }

    @media (max-height: 600px) and (max-width: 545px) {
        #slider {
            height: 110px !important; /* Réduit pour Chrome sur petits écrans */
            max-height: 110px !important;
        }
    }
}

/* Popup concentrations */
.popup-desktop,
.popup-mobile,
.popup-small {
    font-family: system-ui, sans-serif;
    background-color: transparent;
    color: #222;
    font-size: 11px;
    line-height: 1.4;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: none;
}

/* Adaptation par taille device*/
.popup-desktop { font-size: 11px; }
.popup-mobile  { font-size: 10px; max-height: 60vh; overflow-y: auto; }
.popup-small   { font-size: 9px; max-height: 50vh; }

/* En-tête */
.popup-header {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ccc;
}

.volcano-name {
    font-weight: 600;
    font-size: 1em;
    margin: 0 0 2px 0;
}

.validity {
    font-size: 0.85em;
    color: #555;
    font-weight: 500;
    margin: 0;
}

/* Coordonnées */
.coordinates-section {
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid #ddd;
}

.coordinates-decimal,
.coordinates-dms {
    font-family: monospace;
    font-size: 0.85em;
    color: #003366;
    margin: 1px 0;
    font-weight: 500;
}

.coordinates-dms {
    padding-left: 5px;
}

/* Eléments de contenu */
.popup-feature {
    margin: 6px 0;
    padding: 0;
    border: none;
    background: none;
}

.top-feature {
    background: none;
    border: none;
}

.concentration {
    font-weight: 600;
    margin-bottom: 4px;
}

.elevation-info {
    display: flex;
    padding-left: 5px;
    gap: 4px;
    font-size: 0.98em;
    color: #333;
}

.elevation-info span {
    margin: 0;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .popup-mobile .elevation-info {
        /*flex-direction: column;*/
        gap: 2px;
    }
}

@media (max-width: 480px) {
    .popup-small .popup-header {
        margin-bottom: 4px;
        padding-bottom: 2px;
    }

    .popup-small .volcano-name {
        font-size: 0.95em;
    }

    .popup-small .coordinates-decimal {
        font-size: 0.8em;
    }

    .popup-small .coordinates-dms {
        font-size: 0.75em;
    }
}

/* Scrollbar au besoin */
.popup-mobile::-webkit-scrollbar {
    width: 3px;
}
.popup-mobile::-webkit-scrollbar-thumb {
    background: #aaa;
}
.watermark-overlay {
    position: fixed;
    bottom: 20px;
    right: 10px;
    z-index: 400;
    pointer-events: none;
    font-size: 20px;
    font-weight: bold;
    color: rgba(255, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow:
            1px 1px 2px rgba(0, 0, 0, 0.5),
            -1px -1px 1px rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 0, 0, 0.35);
    border-radius: 5px;
    backdrop-filter: blur(3px);

    /* Nouvelles propriétés pour le défilement */
    overflow: hidden;
    white-space: nowrap;
    width: 250px; /* Largeur fixe pour la zone visible */
}

/* Le contenu qui défile */
.watermark-overlay .scrolling-text {
    display: inline-block;
    animation: scroll-left 15s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* -50% car on répète 2 fois le texte */
    }
}

/* S'assurer que le watermark est visible lors de l'impression PNG */
@media print {
    .watermark-overlay {
        display: block !important;
        position: absolute;
        z-index: 10000;
        width: auto;
    }

    .watermark-overlay .scrolling-text {
        animation: none !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .watermark-overlay {
        font-size: 16px;
        letter-spacing: 2px;
        bottom: 18px;
        right: 16px;
        padding: 4px 10px;
        width: 200px;
    }

    .watermark-overlay .scrolling-text {
        animation-duration: 12s;
    }
}

@media (max-width: 480px) {
    .watermark-overlay {
        font-size: 14px;
        letter-spacing: 1px;
        bottom: 18px;
        right: 5px;
        padding: 3px 8px;
        width: 150px;
    }

    .watermark-overlay .scrolling-text {
        animation-duration: 10s;
    }
}

