/* Styles pour la carte interactive de Tunisie */

.tunisia-map-section {
    background-color: #f8f9fa;
}

.city-filters {
    margin-bottom: 2rem;
}

.city-filters .filter-btn {
    margin: 0 5px 10px 5px;
    border-radius: 25px;
    padding: 8px 20px;
    transition: all 0.3s ease;
    border: 2px solid #f7a73e;
    color: #f7a73e;
    background-color: transparent;
    font-weight: 500;
}

.city-filters .filter-btn.active {
    background-color: #f7a73e;
    border-color: #f7a73e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(246, 147, 20, 0.3);
}

.city-filters .filter-btn:hover {
    background-color: #f7a73e;
    border-color: #f7a73e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(246, 147, 20, 0.3);
}

.city-filters .filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(246, 147, 20, 0.2);
}

#tunisia-map {
    height: 600px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

/* Masquer les contrôles de zoom par défaut */
.leaflet-control-zoom {
    display: none;
}
.map-zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .map-zoom-controls button {
        width: 34px;
        height: 34px;
        background-color: white;
        border: 1px solid #f7a73e;
        border-radius: 2px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        font-size: 0.9rem;
        color: #555;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease-in-out;
    }

        .map-zoom-controls button:hover {
            background-color: #f0f0f0;
            border-color: #f7a73e;
            color: #333;
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        }

/* Masquer l'attribution par défaut */
.leaflet-control-attribution {
    display: none;
}

/* Styles pour les gouvernorats */
.leaflet-interactive {
    stroke: #2222220a !important;
    stroke-width: 1.5 !important;
    fill: #e0e0e0 !important;
    opacity: 1 !important;
    cursor: pointer;
    transition: fill 0.2s, stroke 0.2s;
}

.leaflet-interactive:hover {
    fill: #f5941487 !important;
    stroke: #f59314 !important;
    stroke-width: 2.5 !important;
    filter: brightness(1.1);
    z-index: 10;
}

/* Effet de sélection */
.governorate-selected {
    stroke-width: 4 !important;
    stroke: #f7a73e !important;
    fill: #ffe0b2 !important;
    filter: brightness(1.2) !important;
    z-index: 1000 !important;
}

.city-info-panel {
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.city-info-panel .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.city-info-panel .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.city-info-panel .card-body {
    padding: 2rem;
}

.info-item {
    padding: 20px 10px;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-3px);
}

.info-item .custom-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    color: #f7a73e;
    transition: transform 0.3s ease;
}

.info-item:hover .custom-icon {
    transform: scale(1.1);
}

.info-item h5 {
    color: #343a40;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.info-item p {
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0;
}

/* Styles pour les popups Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: none;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    backdrop-filter: blur(10px);
}

.leaflet-popup-tip {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 20px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.leaflet-popup-content h5 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content p {
    color: #5a6c7d;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 0.9rem;
}

.leaflet-popup-content .btn {
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    background: linear-gradient(135deg, #f7a73e 0%, #ffb347 100%);
    border: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaflet-popup-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Styles pour la légende des régions */
.region-legend {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.legend-item:hover {
    transform: translateX(5px);
    background-color: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    padding-left: 10px;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.legend-color::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.legend-label {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.legend-title {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Styles pour les marqueurs personnalisés */
.custom-marker {
    background-color: #f7a73e;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.custom-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 15px rgba(246, 147, 20, 0.5);
}

/* Animation pour l'apparition du panneau d'informations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations personnalisées */
@keyframes mapAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes legendSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes governorateSelect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

#tunisia-map {
    animation: mapAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.region-legend {
    animation: legendSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

/* Effet de particules pour le fond */
#tunisia-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Responsive design amélioré */
@media (max-width: 768px) {
    #tunisia-map {
        height: 450px;
        border-radius: 10px;
    }

    .city-filters .filter-btn {
        margin: 0 3px 8px 3px;
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    .info-item {
        padding: 15px 5px;
    }

    .info-item .custom-icon {
        font-size: 2rem;
    }

    .city-info-panel .card-body {
        padding: 1.5rem;
    }

    .region-legend {
        margin-top: 20px;
        padding: 20px;
    }

    .legend-title {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    #tunisia-map {
        height: 350px;
        border-radius: 5px;
    }
    
    .city-filters {
        text-align: center;
    }
    
    .city-filters .filter-btn {
        display: block;
        width: 100%;
        margin: 0 0 10px 0;
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .info-item h5 {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
}

/* Amélioration de l'accessibilité */
.filter-btn:focus,
.btn:focus {
    outline: 2px solid #f7a73e;
    outline-offset: 2px;
}



/* Style pour le titre de la section */
.tunisia-map-section .section-title {
    color: #343a40;
    font-weight: 700;
    position: relative;
}

.tunisia-map-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #f7a73e;
    border-radius: 2px;
}

/* Style pour le texte de description */
.tunisia-map-section .lead {
    color: #6c757d;
    font-weight: 400;
    line-height: 1.6;
}

/* --- Ajout/Modification pour une carte plus réaliste --- */
#tunisia-map .country-border, .country-border {
    stroke: #000 !important;
    stroke-width: 3 !important;
    fill: #f5f5f5 !important;
}

/* Styles pour les marqueurs personnalisés et labels */
.leaflet-marker-icon.governorate-label {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

.governorate-label {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
}

.governorate-label span {
    background: rgba(255, 255, 224, 0.9);
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.7rem;
    border-radius: 4px;
    padding: 1px 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.2;
    display: inline-block;
}

.modern-filters-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 32px 18px 24px 18px;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 220px;
}
.filters-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}
.filters-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.filter-chip {
    background: linear-gradient(135deg, #f7a73e 0%, #ffb347 100%);
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 7px 18px;
    font-size: 0.98rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(246,147,20,0.08);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
}
.filter-chip i {
    margin-right: 6px;
    font-size: 1.1em;
}
.filter-chip:hover, .filter-chip.active {
    background: linear-gradient(135deg, #f7a73e 0%, #f5576c 100%);
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(246,147,20,0.13);
}
.filter-date {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    font-size: 0.97rem;
    color: #2c3e50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    width: 100%;
    max-width: 180px;
}
.filters-help {
    text-align: center;
    color: #5a6c7d;
    font-size: 0.95rem;
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 500;
}
.filters-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}
.filters-badge span {
    display: inline-block;
    background: linear-gradient(135deg, #f7a73e 0%, #ffb347 100%);
    color: white;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.93rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(246,147,20,0.08);
}
