$prefixClass = rc-slider;

$disabledColor = #ccc;
$border-radius-base = 6px;
$primary-color = #E75F87;
$tooltip-color = #df536b;
$tooltip-bg = transparent;
$tooltip-arrow-width = 4px;
$tooltip-distance = 5px;
$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);

.borderBox() {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); //  remove tap highlight color for mobile safari

  * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); //  remove tap highlight color for mobile safari
  }
}

.range-slider-wrap {
  display: flex;
  align-items: center;

  .range-max {
    margin-left 15px
  }

  .range-min {
    margin-right 15px
  }

  .range-min,
  .range-max {
    flex-shrink 0
  }
}

.rc-slider {
  position: relative;
  height: 4px;
  width: 100%;
  background-color: #d8d8d8;

  borderBox();

  &:before, &:after {
    content: ""
    display block
    width 10px
    height 10px
    border-radius 5px
    background-color #d8d8d8
    position: absolute
    top: -3px
  }

  &:after {
    right 0
  }

  .rc-slider-dot,
  .rc-slider-dot-active {
    border-color: #e75f87;
  }

  .range-handle {
    position absolute
    top: -25px;
  }

  &-track {
    position: absolute;
    left: 0;
    height: 4px;
    border-radius: $border-radius-base;
    background-color: $primary-color;
    z-index: 1;
  }

  &-handle {
    position: absolute;
    margin-top: -8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 50%;
    margin-left -10px
    // border: solid 2px $primary-color;
    // background-color #e29c9c
    background-color: $primary-color;
    z-index: 2;

    .range-value {
      position absolute
      left 50%
      transform translateX(-50%)
      top -25px
      margin-left 0
    }

    &:hover {
      // background-color: $primary-color;
    }
    &-active {
      &:active {
        // border-color: tint($primary-color, 20%);
        // background-color: $primary-color;
        box-shadow: 0 0 5px tint($primary-color, 20%);
      }
    }
  }

  &-mark {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    font-size: 12px;
    z-index: 3;
  }

  &-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;
    z-index: 1;
  }

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

  &-disabled {
    background-color: #e9e9e9;

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

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

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

motion-common()
  animation-duration: .3s;
  animation-fill-mode: both;
  display: block !important;

make-motion($className, $keyframeName)
  .rc-slider-enter, .rc-slider-appear {
    motion-common();
    animation-play-state: paused;
  }
  .rc-slider-leave {
    motion-common();
    animation-play-state: paused;
  }
  .rc-slider-enter.rc-slider-enter-active, .rc-slider-appear.rc-slider-appear-active {
    animation-name: '~'+$keyframeName+"In";
    animation-play-state: running;
  }
  .rc-slider-leave.rc-slider-leave-active {
    animation-name: '~'+$keyframeName+"Out";
    animation-play-state: running;
  }

zoom-motion($className, $keyframeName)
  make-motion($className, $keyframeName);
  +prefix-classes($className)
    .-enter, .-appear
      transform: scale(0, 0); // need this by yiminghe
      animation-timing-function: $ease-out-quint;

    .-leave
      animation-timing-function: $ease-in-quint;

zoom-motion('rc-slider-tooltip-zoom-down', rcSliderTooltipZoomDown);

@keyframes rcSliderTooltipZoomDownIn {
  0% {
    opacity: 0;
    transform-origin: 50% 100%;
    transform: scale(0, 0);
  }
  100% {
    transform-origin: 50% 100%;
    transform: scale(1, 1);
  }
}

@keyframes rcSliderTooltipZoomDownOut {
  0% {
    transform-origin: 50% 100%;
    transform: scale(1, 1);
  }
  100% {
    opacity: 0;
    transform-origin: 50% 100%;
    transform: scale(0, 0);
  }
}

.rc-tooltip {
  position: absolute;
  left: -9999px;
  top: -9999px;
  z-index: 4;
  visibility: visible;
  padding: $tooltip-arrow-width 0 $tooltip-distance 0;


  &-hidden {
    display: none;
  }

  &-inner {
    padding: 6px 2px;
    min-width: 24px;
    height: 24px;
    font-size: 16px;
    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;
    border none
  }

  &-arrow {
    display none
    position: absolute;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    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;
  }

}


/** WEBPACK FOOTER **
 ** assets/index.less
 **/
