/**
 * Africa Risk Map - CSS Styles
 *
 * Styles for the interactive Africa Risk Map component
 */

/* Map container */
.africa-risk-map {
    width: 100%;
    height: 400px; /* Reduced from 500px to 400px */
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    background-color: #f8fafc;
}

/* Custom popup styles */
.custom-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

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

/* Country label styles */
.country-label {
    background: transparent;
    border: none;
    transition: opacity 0.3s ease;
}

.country-label .group:hover {
    z-index: 1000;
}

/* Country outline styles */
.country-outline {
    transition: all 0.3s ease;
}

.country-outline:hover {
    fill-opacity: 0.2;
    cursor: pointer;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.3));
}

/* Control styles */
.risk-type-control,
.year-control,
.legend {
    font-family: 'Figtree', sans-serif;
}

.risk-type-control input[type="radio"] {
    accent-color: #10B981;
}

/* Year slider styles */
#year-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #e5e7eb;
    outline: none;
}

#year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10B981;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#year-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #10B981;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Play button styles */
#play-button {
    cursor: pointer;
    transition: all 0.2s ease;
}

#play-button:hover {
    transform: scale(1.1);
}

/* Loading indicator */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    border-top-color: #10B981;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive styles */
@media (max-width: 768px) {
    .africa-risk-map {
        height: 350px; /* Reduced from 400px to 350px */
    }

    .country-label .relative.group {
        transform: scale(0.8);
    }
}

@media (max-width: 640px) {
    .africa-risk-map {
        height: 300px; /* Reduced from 350px to 300px */
    }

    .risk-type-control,
    .year-control,
    .legend {
        font-size: 0.8rem;
    }

    .country-label .relative.group {
        transform: scale(0.7);
    }
}

/* Animation for risk changes */
@keyframes riskChange {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.risk-changing {
    animation: riskChange 1s ease-in-out;
}

/* Tooltip styles */
.map-tooltip {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 200px;
}

/* Search box styles */
.map-search-box {
    position: absolute;
    top: 10px;
    left: 50px;
    z-index: 1000;
    width: 250px;
}

.map-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}

.map-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
}

.map-search-result-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.map-search-result-item:hover {
    background-color: #f3f4f6;
}
