/**
 * Styles pour les cartes Leaflet
 * SéjourCure
 */

/* ===========================================
   CONTENEUR DE CARTE
   =========================================== */

.map-container {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.map-container-home {
    height: 500px;
}

.map-container-archive {
    height: 600px;
}

#homepage-map,
#archive-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ===========================================
   MARQUEURS PERSONNALISÉS
   =========================================== */

.thermal-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 40px;
    height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-pin::before {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    top: 0;
    left: 2px;
}

.marker-pin span {
    position: relative;
    z-index: 2;
    font-size: 18px;
    margin-top: -8px;
}

/* Marqueur conventionné */
.marker-pin.conv::before {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
}

.marker-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Animation au hover */
.thermal-marker:hover .marker-pin::before {
    transform: rotate(-45deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===========================================
   CLUSTERS
   =========================================== */

.marker-cluster {
    background: rgba(26, 107, 138, 0.6);
    border-radius: 50%;
}

.marker-cluster div {
    background: rgba(26, 107, 138, 0.9);
    color: white;
    font-weight: bold;
    font-size: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster-small {
    background: rgba(26, 107, 138, 0.6);
}
.marker-cluster-small div {
    width: 30px;
    height: 30px;
    margin: 5px;
}

.marker-cluster-medium {
    background: rgba(26, 107, 138, 0.7);
}
.marker-cluster-medium div {
    width: 40px;
    height: 40px;
    margin: 5px;
}

.marker-cluster-large {
    background: rgba(26, 107, 138, 0.8);
}
.marker-cluster-large div {
    width: 50px;
    height: 50px;
    margin: 5px;
}

/* ===========================================
   POPUPS
   =========================================== */

.thermal-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: hidden;
}

.thermal-popup .leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

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

.popup-content {
    font-family: inherit;
}

.popup-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-body {
    padding: 16px;
}

.popup-badge {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a3c4d;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.popup-location {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px 0;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.popup-tag {
    background: #e8f4f8;
    color: #1a6b8a;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.popup-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--primary-color, #1a6b8a);
    color: white !important;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.popup-btn:hover {
    background: var(--primary-dark, #134d63);
    color: white !important;
}

/* ===========================================
   TOGGLE LISTE/CARTE
   =========================================== */

.view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.view-toggle-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-btn:hover {
    border-color: var(--primary-color, #1a6b8a);
}

.view-toggle-btn.active {
    background: var(--primary-color, #1a6b8a);
    border-color: var(--primary-color, #1a6b8a);
    color: white;
}

.view-toggle-btn .icon {
    font-size: 16px;
}

/* ===========================================
   CARTE PAGE D'ACCUEIL
   =========================================== */

.homepage-map-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.homepage-map-header {
    text-align: center;
    margin-bottom: 30px;
}

.homepage-map-header h2 {
    font-size: 32px;
    color: #1a3c4d;
    margin-bottom: 10px;
}

.homepage-map-header p {
    font-size: 18px;
    color: #666;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.legend-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.legend-marker.standard {
    background: white;
    border: 2px solid #ccc;
}

.legend-marker.conventionne {
    background: #d4edda;
    border: 2px solid #28a745;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    .map-container-home {
        height: 400px;
    }
    
    .map-container-archive {
        height: 450px;
    }
    
    .popup-content {
        min-width: 200px;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .map-legend {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .map-container-home {
        height: 350px;
        border-radius: 12px;
    }
    
    .homepage-map-header h2 {
        font-size: 24px;
    }
}
