@import (reference) "../../../assets/css/index";
@prefixClass: @fishd-prefix;
@scrollbar-hover-background-color: @item-hover-bg;

.@{prefixClass}-scrollbar {
  overflow: hidden;
  position: relative;

  &:hover,
  &:active,
  &:focus {
    .@{prefixClass}-scrollbar__bar {
      opacity: 1;
      transition: opacity 340ms ease-out;
    }
  }

  &__wrap {
    overflow: auto;
    .scrollbar();
    overflow-x: hidden;

    &--hidden-default {
      &::-webkit-scrollbar {
        width: 0;
        height: 0;
      }
    }
  }

  &__thumb {
    position: relative;
    display: block;
    size: 0;
    cursor: pointer;
    border-radius: inherit;
    transition: 0.3s background-color;

    &:hover {
      background-color: @scrollbar-hover-background-color;
    }
  }

  &__bar {
    position: absolute;
    right: 2px;
    bottom: 2px;
    z-index: 1;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 120ms ease-out;

    .is-vertical {
      width: 6px;
      top: 2px;

      > div {
        width: 100%;
      }
    }

    .is-horizontal {
      height: 6px;
      left: 2px;

      > div {
        height: 100%;
      }
    }
  }
}
