/* Styles pour la carte interactive de l'Afrique */
.africa-map-container {
    width: 100%;
    padding: 4rem 0;
    background: white;
}

.map-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.map-title {
    text-align: center;
    margin-bottom: 3rem;
}

.map-title h2 {
    font-size: 3.5rem;
    font-weight: 900;
    color: #1b425b;
    margin-bottom: 1rem;
}

.map-title p {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto;
}

.interactive-map {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 2rem;
    box-shadow: 0 20px 60px rgba(27, 66, 91, 0.15);
}

#ebomaf-map {
    width: 100%;
    height: 700px;
    border-radius: 1rem;
    z-index: 1;
    background: linear-gradient(135deg, 
        rgba(246, 173, 198, 0.3) 0%, 
        rgba(169, 132, 240, 0.3) 25%, 
        rgba(82, 113, 255, 0.3) 50%, 
        rgba(132, 94, 247, 0.3) 75%, 
        rgba(246, 173, 198, 0.3) 100%);
}

/* Override Leaflet styles */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 0.875rem;
}

/* Tooltip */
#country-tooltip {
    position: fixed;
    background: rgba(27, 66, 91, 0.95);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -120%);
}

#country-tooltip strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #f4c430;
}

/* Modal */
#country-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content-wrapper {
    background: white;
    border-radius: 1.5rem;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: #1b425b;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

#close-modal:hover {
    background: #f4c430;
    color: #1b425b;
    transform: rotate(90deg);
}

.stat-box {
    transition: all 0.3s ease;
    animation: popIn 0.5s ease backwards;
}

.stat-box:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.stat-box:nth-child(1) { animation-delay: 0.1s; }
.stat-box:nth-child(2) { animation-delay: 0.2s; }
.stat-box:nth-child(3) { animation-delay: 0.3s; }
.stat-box:nth-child(4) { animation-delay: 0.4s; }

/* Légende */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.legend-color {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .map-title h2 {
        font-size: 2.5rem;
    }
    
    .map-title p {
        font-size: 1rem;
    }
    
    .interactive-map {
        padding: 1rem;
        border-radius: 1rem;
    }
    
    #ebomaf-map {
        height: 500px;
    }
    
    .modal-content-wrapper {
        padding: 1.5rem;
        margin: 0.5rem;
        max-height: 85vh;
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
    }
    
    .modal-content-wrapper h3 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    .modal-content-wrapper h4 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .stat-box {
        padding: 0.75rem !important;
    }
    
    .stat-box .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .stat-box .text-sm {
        font-size: 0.7rem !important;
    }
    
    .modal-content-wrapper ul li {
        font-size: 0.85rem;
    }
    
    .modal-content-wrapper .flex-wrap span {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.75rem !important;
    }
    
    #country-tooltip {
        font-size: 0.75rem;
    }
    
    .map-legend {
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .map-title h2 {
        font-size: 2rem;
    }
    
    .africa-map-container {
        padding: 2rem 0;
    }
    
    #ebomaf-map {
        height: 400px;
    }
    
    .modal-content-wrapper h3 {
        font-size: 1.5rem !important;
    }
    
    .modal-content-wrapper {
        padding: 1rem;
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        margin: 0.5rem;
    }
    
    .stat-box {
        padding: 0.5rem !important;
    }
    
    .stat-box .text-3xl {
        font-size: 1.25rem !important;
    }
}

/* Scrollbar personnalisé pour le modal */
.modal-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.modal-content-wrapper::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb {
    background: #1b425b;
    border-radius: 10px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #f4c430;
}
