/**
 * Custom Range Slider Styles
 */
.custom-range-slider {
    position: relative;
    width: 100%;
    padding: 24px 0 8px 0;
    /* Space for popup */
    user-select: none;
    cursor: pointer;
}

.range-track-wrapper {
    height: 24px;
    display: flex;
    align-items: center;
    background: transparent;
    cursor: pointer;
}

.range-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.range-fill {
    position: absolute;
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.1s ease;
}

.range-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: left 0.1s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.range-thumb:focus {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

.custom-range-slider.dragging .range-thumb {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Value Popup */
.range-value-popup {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--on-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    transition: left 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-value-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--color-accent);
}

/* Theme Adaptive Colors */
body.light .range-thumb {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.warm .range-thumb {
    border-color: var(--color-accent);
}