/**
 * Styles front-end pour CT OSMap Widget
 */

/* Conteneur principal de la carte */
.ct-osmap-container,
.ct-osmap-block-container {
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Titre du bloc */
.ct-osmap-block-title {
    margin: 0 0 15px 0;
    padding: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    text-align: left;
}

/* Styles de la carte */
.ct-osmap-map,
.ct-osmap-block-map {
    width: 100%;
    min-height: 300px;
    border-radius: 8px;
}

/* Styles personnalisés pour les marqueurs */
.ct-osmap-marker-clicked {
    animation: markerClick 0.3s ease-in-out;
}

@keyframes markerClick {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Styles pour les tooltips */
.leaflet-tooltip.leaflet-tooltip-top:before {
    border-top-color: #333;
}

.leaflet-tooltip {
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 200px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    text-align: center;
}

/* Correction du positionnement du tooltip pour le centrer sur le marqueur */
.leaflet-tooltip-top {
    margin-top: -15px;
    margin-left: -15px;
}

.leaflet-tooltip-bottom {
    margin-top: 15px;
    margin-left: -15px;
}

.leaflet-tooltip-left {
    margin-left: -25px;
}

.leaflet-tooltip-right {
    margin-left: 5px;
}

/* Styles pour les popups */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 15px 20px;
    line-height: 1.5;
}

.leaflet-popup-tip {
    background: white;
}

/* Personnalisation des contrôles de zoom */
.leaflet-control-zoom {
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.leaflet-control-zoom a {
    border-radius: 6px;
    color: #333;
    font-size: 18px;
    line-height: 26px;
    text-decoration: none;
    background-color: #fff;
    border: none;
}

.leaflet-control-zoom a:hover {
    background-color: #f0f0f0;
    color: #000;
}

/* Attribution */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 5px;
}

/* Styles responsive */
@media (max-width: 768px) {
    .ct-osmap-container,
    .ct-osmap-block-container {
        margin: 10px 0;
    }
    
    .ct-osmap-map,
    .ct-osmap-block-map {
        min-height: 250px;
    }
    
    .ct-osmap-block-title {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .leaflet-tooltip {
        font-size: 12px;
        padding: 6px 10px;
        max-width: 150px;
    }
    
    .leaflet-control-zoom a {
        font-size: 16px;
        line-height: 24px;
    }
}

@media (max-width: 480px) {
    .ct-osmap-map,
    .ct-osmap-block-map {
        min-height: 200px;
        border-radius: 4px;
    }
    
    .ct-osmap-container,
    .ct-osmap-block-container {
        border-radius: 4px;
        margin: 8px 0;
    }
    
    .ct-osmap-block-title {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .leaflet-tooltip {
        font-size: 11px;
        padding: 4px 8px;
        max-width: 120px;
    }
}

/* Styles pour les marqueurs personnalisés */
.ct-osmap-custom-marker {
    background-color: #3498db;
    border: 3px solid #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    position: relative;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ct-osmap-custom-marker:hover {
    background-color: #2980b9;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.ct-osmap-custom-marker::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #3498db;
}

.ct-osmap-custom-marker:hover::after {
    border-top-color: #2980b9;
}

/* Loading spinner pour les cartes */
.ct-osmap-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.ct-osmap-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}