.sidebar {
    position: absolute;
    top: 24px;
    height: calc(100vh - 48px);
    z-index: 1000;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: transform 0.3s ease;
}

.sidebar.left-sidebar {
    left: 24px;
    width: 320px;
}

body.collapse-left .sidebar.left-sidebar {
    transform: translateX(calc(-100% - 24px));
}

.sidebar.right-sidebar {
    right: 24px;
    width: 320px;
}

body.collapse-right .sidebar.right-sidebar {
    transform: translateX(calc(100% + 24px));
}

.sidebar header {
    margin-bottom: 32px;
}

.sidebar header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Layer Groups */
.layer-group {
    margin-bottom: 28px;
}

.layer-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

.layer-item:hover {
    color: var(--text-main);
}

/* Custom Radio Buttons for Forecast */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-item {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1.4;
}

.radio-item:hover,
.radio-item input:checked~.radio-label {
    color: var(--text-main);
}

.radio-item input {
    display: none;
}

.radio-custom {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    margin-right: 12px;
    margin-top: 2px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.radio-item:hover .radio-custom {
    border-color: rgba(255, 255, 255, 0.7);
}

.radio-item input:checked+.radio-custom {
    border-color: var(--accent);
}

.radio-item input:checked+.radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Custom UI Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s transform cubic-bezier(0.4, 0.0, 0.2, 1);
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider.disabled {
    cursor: not-allowed;
    background-color: rgba(255, 255, 255, 0.05);
}

.slider.disabled:before {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Legend in Sidebar */
footer {
    margin-top: auto;
}

.legend {
    padding: 16px;
    border-radius: 12px;
}

.legend h4 {
    font-size: 0.85rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.scale-bar {
    height: 10px;
    width: 100%;
    border-radius: 5px;
    /* Transparent -> Light Yellow -> Orange -> Red */
    background: linear-gradient(to right, rgba(254, 240, 138, 0) 0%, #fef08a 20%, #f97316 60%, #dc2626 100%);
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}
