@use "mixins";
@use "variables";

label.fwe-slider {
  span {
    margin-bottom: 4px;
    display: inline-block;
    font-size: variables.$font-size-md;
    color: variables.$text-light;
  }
}

input[type="range"].fwe-slider-input {
  appearance: none;
  width: 100%;
  background: transparent;
  padding: 0px;
  padding-top: 16px;
  padding-bottom: 16px;

  cursor: pointer;

  @include mixins.firefox-only {
    height: 32px;
  }
  &:focus {
    outline: none;
  }

  &::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    background: variables.$hero;
    cursor: pointer;
    border-radius: 50%;
    margin-top: -3px;
  }

  &::-moz-range-thumb {
    width: 8px;
    height: 8px;
    background: variables.$hero;
    cursor: pointer;
    border-radius: 50%;
    border: none;
  }

  &::-ms-thumb {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: variables.$hero;
    cursor: pointer;
    border: 1px solid variables.$hero;
  }

  &::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: variables.$control;
    border: none;
  }
  &::-moz-range-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: variables.$control;
    border: none;
  }
  &::-moz-range-progress {
    height: 2px;
    cursor: pointer;
    background: variables.$hero;
    border: none;
  }
  &::-ms-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    border-width: 16px 0;
    color: transparent;
  }
  &::-ms-fill-lower {
    background: variables.$hero;
  }
  &::-ms-fill-upper {
    background: variables.$control;
  }

  &:hover:not(:disabled) {
    &::-webkit-slider-thumb {
      margin-top: -7px;
      height: 16px;
      width: 16px;
    }
    &::-moz-range-thumb {
      height: 16px;
      width: 16px;
    }
    &::-ms-thumb {
      box-shadow: 0px 0px 0px 4px variables.$hero;
    }
  }

  &:active:not(:disabled) {
    &::-webkit-slider-thumb {
      box-shadow: 0px 0px 0px 8px rgba(0, 145, 220, 0.3);
    }
    &::-moz-range-thumb {
      box-shadow: 0px 0px 0px 8px rgba(0, 145, 220, 0.3);
    }
    &::-ms-thumb {
      box-shadow: 0px 0px 0px 4px variables.$hero, 0px 0px 0px 12px rgba(0, 145, 220, 0.3) !important;
    }
  }

  &:disabled {
    &::-webkit-slider-runnable-track {
      background: variables.$control-disabled;
    }
    &::-moz-range-track {
      background: variables.$control-disabled;
    }
    &::-moz-range-progress {
      background: variables.$control;
    }
    &::-ms-fill-lower {
      background: variables.$control;
    }
    &::-ms-fill-upper {
      background: variables.$control-disabled;
    }

    &::-webkit-slider-thumb {
      cursor: auto;
      background: variables.$control;
    }
    &::-moz-range-thumb {
      background: variables.$control;
    }
    &::-ms-thumb {
      background: variables.$control;
      border: 1px solid variables.$control;
    }
  }
}
