/* Map Container */
.map-container {
    position: relative;
    height: 600px;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 150px;
}

.map-legend h4 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 0.85em;
}

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

.legend-gradient {
    width: 100%;
    height: 20px;
    border-radius: 3px;
    margin: 8px 0;
    border: 1px solid #ccc;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.district-popup {
    padding: 15px;
}

.district-popup h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.district-popup .popup-field {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    font-size: 0.9em;
}

.district-popup .popup-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.district-popup .popup-value {
    color: var(--text-primary);
}

.district-popup .party-republican {
    color: var(--republican-color);
    font-weight: bold;
}

.district-popup .party-democratic {
    color: var(--democratic-color);
    font-weight: bold;
}

/* Leaflet Attribution */
.leaflet-control-attribution {
    font-size: 0.7em;
}

/* District Highlighting */
.district-highlighted {
    stroke-width: 3px !important;
    stroke: #333 !important;
    fill-opacity: 0.8 !important;
}

.district-hover {
    fill-opacity: 0.7 !important;
    cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .map-container {
        height: 400px;
    }

    .map-legend {
        bottom: 10px;
        right: 10px;
        padding: 10px;
        font-size: 0.85em;
    }
}
