/* CSS OPTIMISÉ pour la carte EuGée - Version Performance */

/* 🚀 MARQUEURS CUSTOM OPTIMISÉS (plus rapides que AwesomeMarkers) */
.custom-marker {
    background: transparent;
    border: none;
    cursor: pointer;
}

.marker-pin {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
}

.marker-pin::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Couleurs des marqueurs selon catégories - CORRIGÉES */
.marker-red .marker-pin {
    background: #dc2626; /* Rouge - Assistance à maîtrise d'œuvre */
}

.marker-blue .marker-pin {
    background: #2563eb; /* Bleu - Assistance à maîtrise d'ouvrage */
}

.marker-green .marker-pin {
    background: #059669; /* Vert - Études techniques */
}

/* 🚀 CLUSTERING STYLES */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
}

.marker-cluster div {
    width: 40px;
    height: 40px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.8);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.9);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.8);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.9);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.8);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.9);
}

/* 🚀 POPUP OPTIMISÉ */
.eugee-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.marker-popup h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
}

.marker-popup .marker-category {
    margin: 4px 0;
    font-size: 14px;
    color: #6b7280;
}

.marker-popup .marker-description {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}

/* 🚀 OPTIMISATIONS DE PERFORMANCE CSS */
.eugee-map {
    /* Améliore les performances de rendu */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    /* Smooth scrolling */
    -webkit-overflow-scrolling: touch;
}

/* Indicateur de chargement amélioré */
.map-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f9fafb;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.map-loader p {
    margin: 16px 0 0 0;
    color: #6b7280;
    font-size: 14px;
}

/* 🚀 STATS OPTIMISÉES */
.map-stats {
    margin: 12px 0;
}

.stats-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #374151;
}

.total-count {
    font-weight: 600;
    color: #1f2937;
}

/* 🚀 CONTRÔLES SIMPLIFIÉS */
.map-controls {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.map-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
}

/* 🎯 FILTRES SIMPLES - 4 BOUTONS COLORÉS */
.simple-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* Boutons filtres colorés simplifiés - POLICE ENCORE PLUS GRANDE */
.filter-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px; /* 📏 Padding encore plus généreux */
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px; /* 🔤 Augmenté de 16px à 18px */
    font-weight: 600; /* 💪 Police plus épaisse */
    color: #374151;
    text-align: left;
    width: 100%;
    line-height: 1.4; /* 📏 Meilleur espacement des lignes */
}

.filter-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-button.active {
    background: #ffffff;
    border-color: #718917;
    color: #1f2937;
    box-shadow: 0 0 0 1px #718917;
}

.filter-button.active:hover {
    background: #ffffff;
    border-color: #718917;
    box-shadow: 0 0 0 1px #718917, 0 2px 4px rgba(0,0,0,0.1);
}

/* Badges colorés dans les boutons - ENCORE PLUS GRANDS */
.filter-color-badge {
    width: 24px; /* 🔵 Augmenté de 20px à 24px */
    height: 24px; /* 🔵 Augmenté de 20px à 24px */
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.filter-color-badge.red { 
    background: #dc2626; 
}

.filter-color-badge.blue { 
    background: #2563eb; 
}

.filter-color-badge.green { 
    background: #059669; 
}

.filter-text {
    flex: 1;
    font-weight: 600; /* 💪 Police plus épaisse */
    font-size: 15px; /* 🔤 Augmenté de 15px à 17px */
    line-height: 1.3;
}

.filter-count {
    font-size: 16px; /* 🔤 Augmenté de 14px à 16px */
    color: #6b7280;
    font-weight: 700; /* 💪 Police plus épaisse pour les compteurs */
    background: #f3f4f6;
    padding: 5px 10px; /* 📏 Padding encore plus généreux */
    border-radius: 14px; /* 🔄 Coins plus arrondis */
    min-width: 40px; /* 📐 Largeur minimale plus grande */
    text-align: center;
}

.filter-button.active .filter-count {
    background: #f0f9e6;
    color: #718917;
}

/* Suppression des anciens styles */
.filters-panel,
.filter-toggle,
.filter-control-btn {
    display: none !important;
}

/* 🚫 MASQUER L'ATTRIBUTION LEAFLET */
.leaflet-control-attribution {
    display: none !important;
}

/* 🚀 RESPONSIVE OPTIMISÉ */
@media (max-width: 768px) {
    .simple-filters {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .filter-button {
        padding: 12px 14px; /* 📏 Padding généreux sur tablette */
        font-size: 16px; /* 🔤 Bonne taille sur tablette */
    }
    
    .filter-text {
        font-size: 15px; /* 🔤 Texte bien visible sur tablette */
    }
    
    .filter-count {
        font-size: 14px; /* 🔤 Compteur visible sur tablette */
        padding: 4px 8px;
    }
    
    .marker-cluster div {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .custom-marker .marker-pin {
        width: 18px;
        height: 18px;
    }
    
    .map-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .simple-filters {
        grid-template-columns: 1fr;
        gap: 10px; /* 📏 Espacement généreux sur mobile */
    }
    
    .filter-button {
        padding: 12px 14px; /* 📏 Padding confortable sur mobile */
        font-size: 16px; /* 🔤 Taille bien lisible sur mobile */
    }
    
    .filter-text {
        font-size: 15px; /* 🔤 Texte bien visible sur mobile */
    }
    
    .filter-count {
        font-size: 14px; /* 🔤 Compteur bien visible sur mobile */
    }
    
    .filter-color-badge {
        width: 22px; /* 🔵 Badge légèrement plus petit sur mobile */
        height: 22px;
    }
}
