/* legend.css */
.map-legend {
    position: fixed;
    top: calc(var(--navbar-height) + 10px);
    left: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 280px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.legend-header {
    padding: 12px 15px;
    background: white;
    color: var(--text-dark);
    border-bottom: 1px solid #E5E7EB;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

.legend-header:hover {
    background: #F9FAFB;
}

.legend-content {
    padding: 12px 15px;
    max-height: calc(100vh - var(--navbar-height) - 150px);
    overflow-y: auto;
    transition: max-height 0.3s ease-in-out;
}

.map-legend.collapsed .legend-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

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

.legend-item:last-child {
    margin-bottom: 0;
}

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

.legend-label {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.legend-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 13px;
}

.legend-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 10px;
}

.collapsed .legend-toggle-icon {
    transform: rotate(180deg);
}

/* Move zoom control to bottom left */
.leaflet-control-zoom {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    top: auto !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .map-legend {
        width: calc(100% - 40px);
        max-width: 280px;
    }
}