/* Style global */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#maCarte {
    height: 100%;
    width: 100%;
}

/* Style du popup en haut à gauche */
.info-box {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: 280px;
    font-family: Arial, sans-serif;
}

/* Bouton de fermeture (croix rouge) en haut à gauche */
.close-btn {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    font-size: 22px;
    font-weight: bold;
    color: red;
    cursor: pointer;
}

.close-btn:hover {
    color: darkred;
}

/* Bouton de bascule (V rouge) en haut à droite */
.toggle-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: bold;
    color: red;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.toggle-btn:hover {
    color: darkred;
}

/* Logo Meshtastic du popup haut-gauche */
.info-img {
    display: block;
    max-width: 120px;
    height: auto;
    margin: 10px auto;
    border-radius: 4px;
}

.info-box h2 {
    font-size: 15px;
    margin-top: 0;
    margin-bottom: 10px;
    padding-right: 20px;
    line-height: 1.3;
}

.info-box p {
    font-size: 13px;
    margin: 5px 0;
}

.signature {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

/* Style du bloc de contrôle personnalisé (Bas à droite) */
.custom-map-controls {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    margin-right: 10px;
}

.custom-map-controls button {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding: 0;
    position: relative;
}

.custom-map-controls button:hover {
    background-color: #f0f0f0;
}

.custom-map-controls .control-separator {
    height: 1px;
    background-color: #ddd;
    margin: 0 4px;
}

/* Style de l'encadré des statuts (Haut à droite) */
.map-legend {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.map-legend h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    color: #444;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.dot-online {
    background-color: #2ecc71;
}

.dot-recent {
    background-color: #f39c12;
}

/* Style de la rosace des vents */
.leaflet-control-compass {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.leaflet-control-compass:hover {
    background-color: #f0f0f0;
}

.compass-svg {
    width: 32px;
    height: 32px;
    transition: transform 0.2s ease-out;
}

/* Animation rosace dans le bloc bas-droite */
.custom-map-controls button svg.compass-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease-out;
}

.custom-map-controls button:hover svg.compass-icon {
    transform: rotate(45deg);
}

/* Infobulles positionnées à gauche, entièrement visibles */
.custom-map-controls button::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

.custom-map-controls button:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Décalage de l'échelle vers le haut sur mobile / écrans étroits */
.leaflet-bottom.leaflet-left {
    bottom: 25px;
}

/* Transformation d'une seconde échelle en verticale dans le coin bas-gauche */
.leaflet-control-scale.vertical-scale {
    transform: rotate(-90deg);
    transform-origin: bottom left;
    margin-bottom: 30px;
    margin-left: 25px;
}