  /* Repositionner les contrôles de zoom Leaflet sur mobile */
@media (max-width: 768px) {
    .leaflet-top.leaflet-left {
        top: 80px !important;
        left: 10px !important;
    }
    
    /* Alternative : Placer les contrôles à droite */
    
    .leaflet-control-zoom {
        margin-left: auto !important;
        margin-right: 10px !important;
    }
    .leaflet-top.leaflet-left {
        left: auto !important;
        right: 0 !important;
    }
    
}
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            overflow: hidden;
            background: #f8f9fa;
        }
        

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
/* Cluster Marker */
.marker-cluster {
  background: hsl(205.14deg 100% 35.1%);
  color: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(0,50,155,0.4);
  border: 3px solid #fff;
  
  /* Pour centrer le marker sur sa position GPS */
  transform: translate(-50%, -50%);
  position: relative;
}
    

    .status-badge {
    display: block; /* au lieu de inline-block */
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    margin: 2px auto 0; /* auto pour centrer */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content; /* pour que le bouton prenne juste la largeur du texte */
    }
    .status-preparation { background-color: #FFA500; }
    .status-en-cours { background-color: #007BFF; }
    .status-termine { background-color: #28A745; }
    .status-suspendu { background-color: #FFC107; }
    .status-annule { background-color: #DC3545; }
    #wrapper {
        display: flex;
        height: 100vh;
        position: relative;
    }

        /* Sidebar Styles */
        #search-sidebar {
            width: 380px;
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 1000;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            flex-direction: column;
        }

        #search-sidebar::-webkit-scrollbar {
            width: 6px;
        }

        #search-sidebar::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        #search-sidebar::-webkit-scrollbar-thumb {
            background: #cbd5e0;
            border-radius: 3px;
        }

        #search-sidebar::-webkit-scrollbar-thumb:hover {
            background: #a0aec0;
        }

        .sidebar-header {
            padding: 30px 25px 20px;
            text-align: center;
            background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
            color: white;
            position: sticky;
            top: 0;
            z-index: 10;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .sidebar-header img {
            margin-bottom: 15px;
            animation: fadeIn 0.6s ease-in;
        }

        .sidebar-header h4 {
            font-size: 20px;
            font-weight: 700;
            margin: 15px 0 8px;
            letter-spacing: 0.5px;
        }

        .sidebar-header p {
            font-size: 14px;
            opacity: 0.95;
            font-weight: 500;
        }

        .search-form {
            padding: 25px;
            flex: 1;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #2c3e50;
            font-weight: 600;
            font-size: 14px;
            letter-spacing: 0.3px;
        }

        .form-group input,
        .form-group select {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e2e8f0;
            border-radius: 10px;
            font-size: 14px;
            transition: all 0.3s ease;
            background: white;
            color: #2c3e50;
        }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
            transform: translateY(-1px);
        }

        .filter-actions {
            margin-top: 25px;
        }

        .btn-filter {
            width: 100%;
            padding: 14px 20px;
            background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(41, 128, 185, 0.3);
            margin-bottom: 12px;
        }

        .btn-filter:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(41, 128, 185, 0.4);
        }

        .btn-filter:active {
            transform: translateY(0);
        }

        .btn-reset {
            display: block;
            width: 100%;
            padding: 12px 20px;
            background: white;
            color: #7f8c8d;
            border: 2px solid #e2e8f0;
            text-align: center;
            text-decoration: none;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .btn-reset:hover {
            background: #f8f9fa;
            border-color: #cbd5e0;
            color: #5a6c7d;
        }

        #filter-results {
            margin-top: 20px;
            padding: 15px;
            background: linear-gradient(135deg, #e8f4f8 0%, #d4edfa 100%);
            border-radius: 10px;
            border-left: 4px solid #3498db;
            animation: slideDown 0.3s ease;
        }

        #filter-results strong {
            color: #2980b9;
            font-size: 18px;
        }

        /* Map Container */
        #map-container {
            flex: 1;
            position: relative;
            overflow: hidden;
        }

        #map {
            width: 100%;
            height: 100%;
        }

        #scrollEnabling {
            position: absolute;
            bottom: 25px;
            right: 25px;
            padding: 12px 24px;
            background: white;
            color: #2980b9;
            text-decoration: none;
            border-radius: 25px;
            font-size: 14px;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
            transition: all 0.3s ease;
            z-index: 999;
        }

        #scrollEnabling:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
            background: #2980b9;
            color: white;
        }

        /* Toggle Button */
        #toggle-sidebar {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 1001;
            background: white;
            border: none;
            padding: 12px 16px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
            cursor: pointer;
            font-size: 20px;
            transition: all 0.3s ease;
            display: none;
        }

        #toggle-sidebar:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
        }

        #toggle-sidebar:active {
            transform: scale(0.95);
        }

        /* Popup Styles */
        .custom-popup .leaflet-popup-content-wrapper {
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        }

        .custom-popup .leaflet-popup-content {
            margin: 0;
            width: 320px !important;
        }

        .marker-popup img {
            width: 100%;
            height: 180px;
            object-fit: cover;
        }

        .marker-popup-content {
            padding: 20px;
        }

        .marker-popup-content h3 {
            margin: 0 0 15px 0;
            font-size: 14px;
            color: #2c3e50;
            font-weight: 500;
            line-height: 1.4;
        }

        .marker-popup-content h3 a {
            color: #2c3e50;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .marker-popup-content h3 a:hover {
            color: #2980b9;
        }

        .marker-popup-content p {
            margin: 8px 0;
            font-size: 14px;
            color: #555;
        }

        .view-details {
            display: inline-block;
            margin-top: 15px;
            padding: 10px 20px;
            color: white;
            text-decoration: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 3px 10px rgba(41, 128, 185, 0.3);
        }

        .view-details:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(41, 128, 185, 0.4);
        }

        /* Custom Markers */
        .custom-marker {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 25px;
            height: 25px;
            border-radius: 50%;
            background: white;
            font-size: 15px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
        }

        .custom-marker:hover {
            transform: scale(5.00);
        }

        .custom-marker.infrastructure { border-color: #f39c12; }
        .custom-marker.education { border-color: #e74c3c; }
        .custom-marker.sante { border-color: #3498db; }
        .custom-marker.agriculture { border-color:#12ad52; }
        .custom-marker.energie { border-color: rgb(231, 231, 35); }
        .custom-marker.general { border-color: #95a5a6; }

        /* Animations */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            #search-sidebar {
                position: fixed;
                left: 0;
                top: 0;
                width: 90%;
                max-width: 350px;
                height: 80vh;
                transform: translateX(-100%);
                box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2);
            }

            #search-sidebar.active {
                transform: translateX(0);
            }

            #toggle-sidebar {
                display: block;
            }

            #map-container {
                width: 100%;
            }

            #scrollEnabling {
                bottom: 15px;
                right: 15px;
                padding: 10px 18px;
                font-size: 13px;
            }

            .sidebar-header {
                padding: 25px 20px 15px;
            }

            .search-form {
                padding: 20px;
            }
        }

        @media (max-width: 480px) {
            #search-sidebar {
                width: 100%;
                max-width: 100%;
            }

            .sidebar-header h4 {
                font-size: 18px;
            }

            .marker-popup-content {
                padding: 14px;
            }

            .marker-popup-content h3 {
                font-size: 14px;
            }
        }

        /* Overlay pour mobile */
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .sidebar-overlay.active {
            display: block;
            opacity: 1;
        }
             /* Styles pour la légende */
        .map-legend {
            margin-top: 25px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e0e0e0;
        }
        
        .map-legend h4 {
            margin: 0 0 15px 0;
            font-size: 16px;
            font-weight: 600;
            color: #333;
            border-bottom: 2px solid #007BFF;
            padding-bottom: 8px;
        }
        
        .legend-section {
            margin-bottom: 15px;
        }
        
        .legend-section:last-child {
            margin-bottom: 0;
        }
        
        .legend-title {
            font-size: 13px;
            font-weight: 600;
            color: #555;
            margin: 0 0 8px 0;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .legend-icon {
            font-size: 20px !important;
            width: 30px !important;
            text-align: center;
        }
        
        .legend-label {
            font-size: 13px;
            color: #666;
        }
        
        .legend-cluster {
            display: inline-block;
            width: 30px;
        }
     .legend-carte {
    display: inline-block;
    width: 30px;
}

.map-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-color: var(--map-color, #007bff86); /* Couleur modifiable */
    border: 2px solid green;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Pin de localisation au centre */
.map-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50% 50% 50% 0;
    transform: translate(-50%, -60%) rotate(-45deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Point central du pin */
.map-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    width: 3px;
    height: 3px;
    background-color: var(--map-color, #0073e6);
    border-radius: 50%;
    z-index: 1;
}
/* Bleu ciel */
.map-icon {
    --map-color: #87CEEB;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.legend-label {
    font-size: 14px;
    color: #333;
}      
        .cluster-demo {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: hsl(205.14deg 100% 35.1%);
            border: 3px solid #fff;
            font-size: 12px;
            font-weight: 600;
            color: #fff;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }
        
        .legend-note {
            font-size: 11px;
            color: #888;
            font-style: italic;
            margin: 8px 0 0 0;
            padding-left: 5px;
        }
        
        @media (max-width: 768px) {
            .map-legend {
                margin-top: 20px;
                padding: 12px;
            }
            
            .map-legend h4 {
                font-size: 14px;
                margin-bottom: 12px;
            }
            
            .legend-title {
                font-size: 12px;
            }
            
         
            .legend-label {
                font-size: 12px;
            }
            
            .cluster-demo {
                width: 26px;
                height: 26px;
                font-size: 11px;
            }
            
            .legend-note {
                font-size: 10px;
            }
        }
        
        /* Styles pour le sélecteur de couches */
        .layer-control {
            position: absolute;
            top: 80px;
            right: 10px;
            z-index: 1000;
            background: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            min-width: 200px;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }
        
        .layer-control.hidden {
            transform: translateX(250px);
            opacity: 0;
            pointer-events: none;
        }
        
        .layer-control-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            border-bottom: 2px solid #007BFF;
            padding-bottom: 5px;
        }
        
        .layer-control h4 {
            margin: 0;
            font-size: 14px;
            font-weight: 600;
            color: #333;
        }
        
        .layer-close-btn {
            background: none;
            border: none;
            font-size: 20px;
            color: #666;
            cursor: pointer;
            padding: 0;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
        }
        
        .layer-close-btn:hover {
            background: #f0f0f0;
            color: #333;
        }
        
        .layer-toggle-btn {
            position: absolute;
            top: 80px;
            right: 10px;
            z-index: 999;
            background: white;
            border: none;
            padding: 10px 15px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: #333;
            transition: all 0.2s;
            display: none;
        }
        
        .layer-toggle-btn.visible {
            display: block;
        }
        
        .layer-toggle-btn:hover {
            background: #007BFF;
            color: white;
        }
        
        .layer-option {
            display: flex;
            align-items: center;
            padding: 8px 0;
            cursor: pointer;
            transition: background 0.2s;
        }
        
        .layer-option:hover {
            background: #f5f5f5;
            border-radius: 4px;
            padding-left: 5px;
        }
        
        .layer-option input[type="radio"] {
            margin-right: 10px;
            cursor: pointer;
        }
        
        .layer-option label {
            cursor: pointer;
            font-size: 13px;
            color: #555;
            flex: 1;
        }
        
        @media (max-width: 768px) {
            .layer-control {
                top: 60px;
                right: 5px;
                padding: 10px;
                min-width: 150px;
            }
            
            .layer-toggle-btn {
                top: 60px;
                right: 5px;
                padding: 8px 12px;
                font-size: 12px;
            }
            
            .layer-control h4 {
                font-size: 12px;
            }
            
            .layer-option label {
                font-size: 11px;
            }
            
            .layer-close-btn {
                font-size: 18px;
                width: 20px;
                height: 20px;
            }
        }
        .custom-marker i {
    font-size: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}