/* ###### 4.8 RangeSlider ###### */

.irs-min, .irs-max {
  font-family: "Roboto", sans-serif;
  border-radius: 0;
}

.irs-from, .irs-to, .irs-single {
  font-family: "Roboto", sans-serif;
  background-color: #{$primary};
  border-radius: 0;
}

.irs-bar {
  background-image: none;
  background-color: #{$primary};
}

.irs-bar-edge {
  background-image: none;
  background-color: #{$primary};
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.irs-line-left {
  background-image: none;
  background-color: rgb($background-gradient-color);
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.irs-line-mid {
  background-image: none;
  background-color: rgb($background-gradient-color);
}

.irs-line-right {
  background-image: none;
  background-color: rgb($background-gradient-color);
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.irs-from::after, .irs-to::after, .irs-single::after {
  border-block-start-color: #{$primary};
}

.irs-slider {
  background-image: none;

  &:before {
    content: '';
    width: 2px;
    height: 18px;
    position: absolute;
    background-color: #{$primary};
    inset-inline-start: 50%;
    margin-inline-start: -1px;
  }

  &:hover:before, &:focus:before {
    background-color: #{$primary-hover};
  }
}

/* #################### COLOR VARIANT SKINS #################### */

.irs-primary {
  .irs-bar, .irs-bar-edge, .irs-slider::before, .irs-from, .irs-to, .irs-single {
    background-color: #{$primary};
  }

  .irs-from::after, .irs-to::after, .irs-single::after {
    border-block-start-color: #{$primary};
  }
}

.irs-success {
  .irs-bar, .irs-bar-edge, .irs-slider::before, .irs-from, .irs-to, .irs-single {
    background-color: #{$success};
  }

  .irs-from::after, .irs-to::after, .irs-single::after {
    border-block-start-color: #{$success};
  }
}

.irs-dark {
  .irs-bar, .irs-bar-edge, .irs-slider::before, .irs-from, .irs-to, .irs-single {
    background-color: #{$gray-800};
  }

  .irs-from::after, .irs-to::after, .irs-single::after {
    border-block-start-color: #{$gray-800};
  }
}

/* #################### MODERN SKIN #################### */

.irs-modern {
  .irs-line-left, .irs-line-mid, .irs-line-right {
    height: 6px;
    box-shadow: inset -2px 2px 2px 0 rgba(34, 34, 34, 0.1);
  }

  .irs-bar, .irs-bar-edge {
    height: 6px;
    box-shadow: inset 0 1px 1px 0 rgba(34, 34, 34, 0.1);
  }

  .irs-slider {
   inset-block-start: 18px;
    background-color: rgb($white);
    border: 2px solid #{$primary};
    border-radius: 4px;

    &::before {
      width: 4px;
      height: 9px;
      background-color: rgb($white) ;
      border-inline-start: 1px solid #{$primary};
      border-inline-end: 1px solid #{$primary};
      margin-inline-start: -2px;
      inset-block-start: 3px;
    }
  }

  &.irs-primary .irs-slider {
    border-color: #{$primary};

    &::before {
      border-color: #{$primary};
    }
  }

  &.irs-success .irs-slider {
    border-color: #{$success};

    &::before {
      border-color: #{$success};
    }
  }

  &.irs-dark .irs-slider {
    border-color: #{$gray-900};

    &::before {
      border-color: #{$gray-900};
    }
  }
}

/* #################### OUTLINE SKIN #################### */

.irs-outline {
  .irs-line {
    border: 1px solid #{$primary};
    height: 10px;
    border-radius: 4px;
  }

  .irs-line-left, .irs-line-mid, .irs-line-right {
    height: 10px;
    background-color: transparent;
  }

  .irs-bar {
    height: 10px;
  }

  .irs-bar-edge {
    height: 10px;
    border-start-start-radius: 5px;
    border-end-start-radius: 5px;
  }

  .irs-slider {
    inset-block-start: 21px;
    width: 18px;
    background-color: rgb($white) ;
    border: 1px solid #{$primary};
    border-radius: 100%;

    &::before {
      margin-inline-start: -4px;
      inset-block-start: 4px;
      width: 8px;
      height: 8px;
      border-radius: 100%;
    }

    &:hover::before, &:focus::before {
      background-color: #{$primary-hover};
    }
  }

  &.irs-primary {
    .irs-line, .irs-slider {
      border-color: #{$primary};
    }

    .irs-line {
      &:hover::before, &:focus::before {
        background-color: #1a53ff;
      }
    }

    .irs-slider {
      &:hover::before, &:focus::before {
        background-color: #1a53ff;
      }
    }
  }

  &.irs-success {
    .irs-line, .irs-slider {
      border-color: #{$success};
    }

    .irs-line {
      &:hover::before, &:focus::before {
        background-color: #339701;
      }
    }

    .irs-slider {
      &:hover::before, &:focus::before {
        background-color: #339701;
      }
    }
  }

  &.irs-dark {
    .irs-line, .irs-slider {
      border-color: #{$gray-800};
    }

    .irs-line {
      &:hover::before, &:focus::before {
        background-color: #313c53;
      }
    }

    .irs-slider {
      &:hover::before, &:focus::before {
        background-color: #313c53;
      }
    }
  }
}