.tooltip {
  @extend %posRelative;
  &:after {
    content: '';
    @extend %floatToXCenter;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px;
    @include opacity(0);
    visibility: hidden;
    @include transition(all 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
    @include user-select(none);
  }
  .tooltip-inner {
    @extend %posAbsolute;
    @extend %fw-5;
    margin: 0 !important;
    padding: 5px 10px;
    font-size: 11px;
    line-height: 13px;
    color: var(--white) !important;
    text-align: center;
    background-color: var(--black-light);
    border-radius: 3px;
    z-index: #{$zindex-dropdown};
    @include opacity(0);
    visibility: hidden;
    pointer-events: none;
    @include transition(all 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
    @include user-select(none);
    white-space: nowrap;
    &:after {
      border-color: var(--black-light);
    }
    &.top {
      bottom: 50%;
      @include transition(bottom 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
      @include translateX(-50%);
      &:after {
        bottom: 0;
        left: 50%;
        @include translateX(-50%);
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
      }
    }
    &.top-right {
      bottom: 50%;
      right: 0px;
      @include translateY(-0%);
      @include transition(bottom 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
      &:after {
        bottom: 0;
        right: 7px;
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
        @include translateY(-0%);
      }
    }
    &.right {
      left: 50%;
      top: 50%;
      @include translateY(-50%);
      @include transition(left 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
      &:after {
        top: 50%;
        left: 0;
        @include translateY(-50%);
        border-top-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
      }
    }
    &.bottom-right {
      top: 50%;
      right: -15px;
      @include translateY(0%);
      @include transition(top 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
      &:after {
        top: 0;
        right: 13px !important;
        @include translateY(0%);
        border-top-color: transparent;
        border-right-color: transparent;
        border-left-color: transparent;
      }
    }
    &.bottom {
      top: 50%;
      left: 50%;
      @include translateX(-50%);
      @include transition(top 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
      &:after {
        top: 0;
        left: 50% !important;
        border-top-color: transparent;
        border-right-color: transparent;
        border-left-color: transparent;
        @include translateX(-50%);
      }
    }
    &.bottom-left {
      top: 50%;
      left: -7px;
      @include translateY(0%);
      @include transition(top 150ms cubic-bezier(0.39, 0.575, 0.565, 1));
      &:after {
        top: 0;
        left: 4px;
        @include translateX(0%);
        border-top-color: transparent;
        border-right-color: transparent;
        border-left-color: transparent;
      }
    }
  }
  &:hover {
    &:after {
      @include opacity(1);
      visibility: visible;
      z-index: 990;
    }
    .tooltip-inner {
      @include opacity(1);
      visibility: visible;
      z-index: 990;
    }
  }
  &.left,
  &.right {
    .tooltip-inner {
      left: 50%;
      top: 50%;
      transform: translateY(-50%);
    }
    &:after {
      top: 50%;
      transform: translateY(-50%);
    }
  }
  &.left {
    .tooltip-inner {
      left: inherit;
      right: 50%;
    }
    &:after {
      left: inherit;
      right: 0;
      border-top-color: transparent;
      border-right-color: transparent;
      border-bottom-color: transparent;
    }
    &:hover {
      .tooltip-inner {
        right: calc(100% + 10px);
      }
      &:after {
        right: calc(100% - 6px);
      }
    }
  }
  &.right {
    .tooltip-inner {
      right: inherit;
      left: 50%;
    }
    &:after {
      right: inherit;
      left: 0;
      border-top-color: transparent;
      border-bottom-color: transparent;
      border-left-color: transparent;
    }
    &:hover {
      .tooltip-inner {
        left: calc(100% + 10px);
      }
      &:after {
        left: calc(100% - 6px);
      }
    }
  }
  &.top,
  &.top-left,
  &.top-right {
    .tooltip-inner {
      bottom: 50%;
    }
    &:after {
      bottom: 0;
      border-right-color: transparent;
      border-bottom-color: transparent;
      border-left-color: transparent;
    }
    &:hover {
      .tooltip-inner {
        bottom: calc(100% + 10px);
      }
      &:after {
        bottom: calc(100% - 6px);
      }
    }
  }
  &.bottom,
  &.bottom-left,
  &.bottom-right {
    .tooltip-inner {
      top: 50%;
    }
    &:after {
      top: 0;
      border-top-color: transparent;
      border-right-color: transparent;
      border-left-color: transparent;
    }
    &:hover {
      .tooltip-inner {
        top: calc(100% + 10px);
      }
      &:after {
        top: calc(100% - 6px);
      }
    }
  }
  &.top,
  &.bottom {
    .tooltip-inner {
      left: 50%;
      transform: translateX(-50%);
    }
  }
  &.top-left,
  &.bottom-left {
    .tooltip-inner {
      left: 0px;
    }
  }
  &.top-right,
  &.bottom-right {
    .tooltip-inner {
      right: 0px;
    }
  }
}

.popover {
  @extend %posAbsolute;
  top: 0;
  left: 0;
  z-index: 1060;
  display: none;
  max-width: 276px;
  padding: 1px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.42857143;
  text-align: left;
  background-color: #ffffff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  white-space: normal;
  &.top {
    margin-top: -10px;
    > .arrow {
      left: 50%;
      margin-left: -11px;
      border-bottom-width: 0;
      border-top-color: rgba(0, 0, 0, 0.25);
      bottom: -11px;
      &:after {
        content: ' ';
        bottom: 1px;
        margin-left: -10px;
        border-bottom-width: 0;
        border-top-color: #ffffff;
      }
    }
  }
  &.right {
    margin-left: 10px;
    > .arrow {
      top: 50%;
      left: -11px;
      margin-top: -11px;
      border-left-width: 0;
      border-right-color: rgba(0, 0, 0, 0.25);
      &:after {
        content: ' ';
        left: 1px;
        bottom: -10px;
        border-left-width: 0;
        border-right-color: #ffffff;
      }
    }
  }
  &.bottom {
    margin-top: 10px;
    > .arrow {
      left: 50%;
      margin-left: -11px;
      border-top-width: 0;
      border-bottom-color: rgba(0, 0, 0, 0.25);
      top: -11px;
      &:after {
        content: ' ';
        top: 1px;
        margin-left: -10px;
        border-top-width: 0;
        border-bottom-color: #ffffff;
      }
    }
  }
  &.left {
    margin-left: -10px;
    > .arrow {
      top: 50%;
      right: -11px;
      margin-top: -11px;
      border-right-width: 0;
      border-left-color: rgba(0, 0, 0, 0.25);
      &:after {
        content: ' ';
        right: 1px;
        border-right-width: 0;
        border-left-color: #ffffff;
        bottom: -10px;
      }
    }
  }
  .popover-title {
    margin: 0;
    padding: 8px 14px;
    font-size: 14px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ebebeb;
    border-radius: 5px 5px 0 0;
  }
  .popover-content {
    padding: 9px 14px;
  }
  > .arrow,
  > .arrow:after {
    @extend %posAbsolute;
    display: block;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
  }
  > .arrow {
    border-width: 11px;
  }
  > .arrow:after {
    border-width: 10px;
    content: '';
  }
}
//
.tooltip-main {
  > div {
    margin-bottom: 10px;
    padding: 10px;
    text-align: center;
  }
}
