* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#map {
    width: 100%;
    height: 100%;
}

.map-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: white;
    padding: 10px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

body.dark-theme .map-legend {
    background-color: #2d2d2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-theme .leaflet-popup-content-wrapper {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-theme .leaflet-popup-tip {
    background-color: #2d2d2d;
}

body.dark-theme .leaflet-control-attribution {
    background-color: rgba(0, 0, 0, 0.8);
    color: #e0e0e0;
}

.map-legend h4 {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 600;
}

body.dark-theme .map-legend h4 {
    color: #8b9cff;
}

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

.legend-color {
    width: 24px;
    height: 14px;
    margin-right: 6px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-theme .legend-color {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-label {
    color: #666;
    font-size: 0.7rem;
}

body.dark-theme .legend-label {
    color: #b0b0b0;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 10px 15px;
    font-size: 0.9rem;
}

.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .map-legend {
        top: 5px;
        right: 5px;
        padding: 8px 10px;
        font-size: 0.7rem;
    }

    .map-legend h4 {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .legend-color {
        width: 20px;
        height: 12px;
    }

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

