$disabledColor: #666;
$border-radius-base: 6px;
$line-color: #e6e6e6;
$primary-color: $basic-aid-blue-color;
$tooltip-color: #fff;
$tooltip-bg: tint(#666, 4%);
$tooltip-arrow-width: 4px;
$tooltip-distance: $tooltip-arrow-width+4;
$tooltip-arrow-color: $tooltip-bg;
$ease-out-quint      : cubic-bezier(0.23, 1, 0.32, 1);
$ease-in-quint       : cubic-bezier(0.755, 0.05, 0.855, 0.06);


.slider {
  position: relative;
  height: 14px;
  padding: 5px 0;
  width: 100%;
  border-radius: $border-radius-base;
  touch-action: none;

  &-rail {
    position: absolute;
    width: 100%;
    background-color: $line-color;
    height: 4px;
    border-radius: $border-radius-base;
  }

  &-track {
    position: absolute;
    left: 0;
    height: 4px;
    border-radius: $border-radius-base;
    background-color: $primary-color;
    cursor: pointer;
    cursor: -webkit-grab;
    cursor: grab;
    touch-action: pan-x;
    z-index: 1;

    &:hover {
      top: 4px;
      height: 8px;
    }
  }

  &-handle {
    position: absolute;
    margin-left: -4px;
    margin-top: -3px;
    width: 8px;
    height: 12px;
    z-index: 2;

    &:focus {
      box-shadow: 0 0 0 5px tint($primary-color, 50%);
      outline: none;
    }

    &-click-focused:focus {
      box-shadow: unset;
    }

    &:hover {
      width: 10px;
      height: 14px;
    }

    &:active {
      cursor: -webkit-grabbing;
      cursor: grabbing;
    }
  }

  &-mark {
    position: absolute;
    top: 18px;
    left: 0;
    width: 100%;
    font-size: 12px;
  }

  &-mark-text {
    position: absolute;
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    cursor: pointer;
    color: #999;

    &-active {
      color: #666;
    }
  }

  &-step {
    position: absolute;
    width: 100%;
    height: 4px;
    background: transparent;
  }

  &-dot {
    position: absolute;
    bottom: -2px;
    margin-left: -4px;
    width: 8px;
    height: 8px;
    border: 2px solid #e9e9e9;
    background-color: #fff;
    cursor: pointer;
    border-radius: 50%;
    vertical-align: middle;
    &-active {
      border-color: tint($primary-color, 50%);
    }
  }

  &-disabled {
    opacity: 0.7;
    // background-color: #e9e9e9;

    .slider-track {
      background-color: $disabledColor;
    }

    .slider-handle, .slider-dot {
      border-color: $disabledColor;
      box-shadow: none;
      background-color: #fff;
      cursor: not-allowed;
    }

    .slider-mark-text, .slider-dot {
      cursor: not-allowed!important;
    }
  }
}

.slider-vertical {
  width: 14px;
  height: 100%;
  padding: 0 5px;

  .slider {
    &-rail {
      height: 100%;
      width: 4px;
    }

    &-track {
      left: 5px;
      bottom: 0;
      width: 4px;
    }

    &-handle {
      margin-left: -5px;
      margin-bottom: -7px;
      touch-action: pan-y;
    }

    &-mark {
      top: 0;
      left: 18px;
      height: 100%;
    }

    &-step {
      height: 100%;
      width: 4px;
    }

    &-dot {
      left: 2px;
      margin-bottom: -4px;
      &:first-child {
        margin-bottom: -4px;
      }
      &:last-child {
        margin-bottom: -4px;
      }
    }
  }
}

.slider-tooltip {
  position: absolute;
  left: -9999px;
  top: -9999px;
  visibility: visible;

  &-hidden {
    display: none;
  }

  &-placement-top {
    padding: $tooltip-arrow-width 0 $tooltip-distance 0;
  }

  &-inner {
    padding: 6px 2px;
    min-width: 24px;
    height: 24px;
    font-size: 12px;
    line-height: 1;
    color: $tooltip-color;
    text-align: center;
    text-decoration: none;
    background-color: $tooltip-bg;
    border-radius: $border-radius-base;
    box-shadow: 0 0 4px #d9d9d9;
  }

  &-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
  }

  &-placement-top &-arrow {
    bottom: $tooltip-distance - $tooltip-arrow-width;
    left: 50%;
    margin-left: -$tooltip-arrow-width;
    border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
    border-top-color: $tooltip-arrow-color;
  }
}
