/* Styles for the Madagascar map */
.map-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 30px 0;
}

.map-wrapper {
    flex: 1;
    min-width: 600px;
    position: relative;
}

.deputies-sidebar {
    flex: 0 0 300px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 700px;
    overflow-y: auto;
    order: -1; /* Make the sidebar appear first (on the left) */
}

.region-info {
    margin-bottom: 20px;
}

.region-title {
    font-size: 1.5rem;
    color: #0e8040;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #0e8040;
}

.region-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    background-color: rgba(14, 128, 64, 0.1);
    padding: 10px;
    border-radius: 5px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0e8040;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.deputies-list {
    list-style: none;
    padding: 0;
}

.deputy-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.deputy-item:hover {
    background-color: rgba(14, 128, 64, 0.05);
}

.deputy-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #f9f9f9;
    margin-right: 15px;
    border: 2px solid #0e8040;
}

.deputy-info {
    flex: 1;
}

.deputy-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
}

.deputy-district {
    font-size: 0.9rem;
    color: #666;
}

.deputy-party {
    font-size: 0.8rem;
    color: #0e8040;
}

/* Folium Map Styles */
.folium-map {
    width: 100%;
    height: 700px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.folium-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Region label styles for the map */
.region-label {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 3px 8px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-align: center;
    pointer-events: none;
}

.no-deputies {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Map legend */
.map-legend {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.legend-title {
    font-size: 1.2rem;
    color: #0e8040;
    margin-bottom: 10px;
    font-weight: bold;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 3px;
}

.legend-label {
    font-size: 0.9rem;
}



/* Responsive styles */
@media (max-width: 992px) {
    .map-container {
        flex-direction: column;
    }

    .map-wrapper, .deputies-sidebar {
        width: 100%;
        min-width: auto;
    }

    .deputies-sidebar {
        order: 1; /* On mobile, show the sidebar below the map */
        max-height: 400px;
    }

    .folium-map {
        height: 500px;
    }
}
