@import "common/var";
@import "mixins/mixins";


@include b(time-slider) {
  display: block;
  background-color: $time-slider-bg;
  border: 1px solid $time-slider-border-color;
  box-sizing: border-box;
  position: relative;
  border-radius: $time-slider-border-radius;

  &_bar {
    background-color: transparent;
    position: absolute;
    cursor: grab;
    &.is-bar{
      cursor: grabbing;
    }
  }

  &_bar-left {
    background-color: $time-slider-bar-color;
    cursor: pointer;
    position: absolute;

    &.is-vertical {
      background-color: $time-slider-bar-color;
    }
  }
  &_bar-right {
    background-color: $time-slider-bar-color;
    cursor: pointer;
    position: absolute;

    &.is-vertical {
      background-color: $time-slider-bar-color;
    }
  }

  &-btn {
    background-color: $time-slider-btn-bg;
    border: 1px solid $time-slider-btn-border-color;
    box-sizing: border-box;
    position: absolute;
    top: 50%;

    &.is-vertical {
      cursor: n-resize;
      top: auto;
      right: 0;
    }

    &_inner {
      height: 100%;
      cursor: e-resize;
      overflow: hidden;
      &.is-vertical {
        cursor: n-resize;
        top: auto;
        right: 0;
      }
      & > i {
        color: $time-slider-btn-icon;
        font-size: 16px;
        &::before{
          height: 8px;
          display: flex;
          justify-content: center;
          align-items: center;
        }
      }
    }
  }

  &-btn_left {
    border-radius: 5px 0 0 5px;
    transform: translate(-100%, -50%);
    z-index: 1;

    & > .#{$namespace}-time-slider-btn_tooltip {
      position: absolute;
      padding: 1px 5px;
      border-radius: 3px;
      text-align: center;
      left: 0;
      top: 0;
      transform: translateY(-110%);
      font-size: 12px;
      background-color: $time-slider-tooltip-bg;
      color: $time-slider-tooltip-color;
      user-select: none;
    }
  }

  &-btn_right {
    border-radius: 0 5px 5px 0;
    transform: translateY(-50%);
    z-index: 1;

    & > .#{$namespace}-time-slider-btn_tooltip {
      position: absolute;
      padding: 1px 5px;
      border-radius: 3px;
      top: 100%;
      right: 0;
      transform: translateY(10%);
      font-size: 12px;
      background-color: $time-slider-tooltip-bg;
      color: $time-slider-tooltip-color;
      user-select: none;
    }
  }
  &-btn_top {
    border-radius: 5px 0 0 5px;
    transform: translate(1px,0);
    z-index: 1;

    & > .#{$namespace}-time-slider-btn_tooltip {
      position: absolute;
      padding: 0 5px;
      border-radius: 1px 3px 3px 1px;
      top: -50%;
      left: 200%;
      background-color: $time-slider-tooltip-bg;
      font-size: 12px;
      color: $time-slider-tooltip-color;
      height: 17px;
      line-height: 17px;
      white-space: nowrap;
      user-select: none;

      &::after {
        position: absolute;
        content: "";
        width: 13px;
        height: 13px;
        transform: rotate(45deg);
        background-color: $time-slider-tooltip-bg;
        left: -6px;
        top: 2px;
        z-index: -1;
        border-radius: 3px 0 3px 0;
      }
    }
  }

  &-btn_bottom {
    border-radius: 5px 0 0 5px;
    transform: translate(1px, 100%);
    z-index: 1;

    & > .#{$namespace}-time-slider-btn_tooltip {
      position: absolute;
      padding: 0 5px;
      border-radius: 1px 3px 3px 1px;
      left: 200%;
      top: -50%;
      background-color: $time-slider-tooltip-bg;
      font-size: 12px;
      color: $time-slider-tooltip-color;
      height: 17px;
      line-height: 17px;
      white-space: nowrap;
      user-select: none;

      &::after {
        position: absolute;
        content: "";
        width: 13px;
        height: 13px;
        transform: rotate(45deg);
        background-color: $time-slider-tooltip-bg;
        left: -6px;
        top: 2px;
        z-index: -1;
        border-radius: 3px 0 3px 0;
      }
    }
  }

  &-slot {
    position: absolute;
    inset: 0;
  }
}

