@import '../styles/variables';

$sliderHeight: 8px;
$sliderRadius: 10px;
$sliderBackground: #e6e6e6;
$sliderRangeBackground: linear-gradient(to bottom, #ffffff 0%, #f3f3f3 100%);
$sliderBorder: $duda-gray;
$sliderThumbBackground: $light-gray;
$sliderThumbSize: 12px;
$sliderThumbSizeFirefox: 10px;

.main {
    position: relative;
    border: 1px solid $sliderBorder;
    border-radius: $sliderRadius;
    height: $sliderHeight;
}

.full,
.percentsIndicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    border-radius: 5px;

    [dir='rtl'] & {
        right: 0;
        left: auto;
    }
}

.percentsIndicator {
    background: $sliderRangeBackground;
}

.full {
    background: $sliderBackground;
    box-shadow: $default-inset-box-shadow;
    width: 100%;
}

.rangeInput {
    -webkit-appearance: none;
    background: transparent;
    display: block;
    margin-block-start: 0;
    margin-inline-end: 0;
    margin-block-end: 0;
    margin-inline-start: 0;
    height: 100%;
    width: 100%;
    position: relative;

    &:focus {
        outline: none;
    }
    &::-webkit-slider-thumb {
        -webkit-appearance: none;
        background: $sliderThumbBackground;
        border: 1px solid $sliderBorder;
        cursor: pointer;
        width: $sliderThumbSize;
        height: $sliderThumbSize;
        border-radius: 50%;
    }

    &::-moz-range-thumb {
        background: $sliderThumbBackground;
        border: 1px solid $sliderBorder;
        cursor: pointer;
        width: $sliderThumbSizeFirefox;
        height: $sliderThumbSizeFirefox;
        position: relative;
        z-index: 0;
    }

    &::-webkit-slider-runnable-track {
        z-index: 1;
        &:focus {
            outline: none;
        }
    }

    &::-moz-focus-outer {
        border: 0;
    }
}
