.radar-legend-container {
    position: absolute;
    bottom: 70px;
    right: 10px;
    z-index: 1000;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.radar-legend-compact {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
    width: 250px;
    backdrop-filter: blur(2px);
}

.legend-section-horizontal {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.legend-title-compact {
    font-weight: 700;
    color: #444;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
}

.legend-bar-container {
    display: flex;
    height: 10px;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-segment {
    flex: 1;
    height: 100%;
    position: relative;
}

.legend-labels-horizontal {
    position: relative;
    height: 12px;
    color: #666;
    font-size: 9px;
    font-weight: 500;
    margin-top: 2px;
}

.legend-label-tick {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.legend-label-tick:first-child {
    transform: translateX(0);
}

.legend-label-tick:last-child {
    transform: translateX(-100%);
}

.legend-toggle-fab {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary, #0054a6);
    color: #fff;
    border: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: background 0.2s;
}

.legend-toggle-fab i { font-size: 18px; }
.legend-toggle-fab.active { background: var(--secondary, #f57f20); }

@media (min-width: 769px) {
    .legend-toggle-fab {
        display: none;
    }
}

@media (max-width: 768px) {
    .radar-legend-container {
        display: none !important;
        bottom: 64px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .radar-legend-container.visible {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
    }

    .radar-legend-compact {
        width: 100%;
    }
}
