$scrollbar-width: 4px;
$scrollbar-margin: 2px;

.#{$lib-name}-scroller {
  position: relative;
  overflow: hidden;
  // fix inline-block gap
  line-height: 1px;
  .scroll-area-wrapper {
    position: relative;
    top: 0;
    left: 0;
    display: inline-block;
    line-height: normal;
    &.scroll-transition {
      transition: transform $transition-time;
    }
    &:not(.scroll-transition) {
      pointer-events: none;
    }
  }
  .#{$lib-name}-v-scrollbar,
  .#{$lib-name}-h-scrollbar {
    position: absolute;
    z-index: 2;
    box-sizing: content-box;
    .scrollbar-thumb {
      position: relative;
      border-radius: $scrollbar-width;
      background: $border-color-light;
      transition: background-color $transition-time;
      &.scroll-transition {
        transition: transform $transition-time;
      }
      cursor: pointer;
    }

    &:hover, &.active {
      .scrollbar-thumb {
        background: darken($border-color-base, 10);
      }
    }
  }
  .#{$lib-name}-v-scrollbar {
    top: 0;
    right: 0;
    width: $scrollbar-width;
    height: 100%;
    padding: 0 0 0 $scrollbar-margin;
    &:hover, &.active {
      width: 8px;
    }
    .scrollbar-thumb {
      top: 0;
      width: 100%;
    }
  }
  .#{$lib-name}-h-scrollbar {
    left: 0;
    bottom: 0;
    width: 100%;
    height: $scrollbar-width;
    padding: $scrollbar-margin 0 0 0;
    &:hover, &.active {
      height: 8px;
    }
    .scrollbar-thumb {
      left: 0;
      height: 100%;
    }
  }
}



/**
 * gemini-scrollbar
 * @version 1.5.3
 * @link http://noeldelgado.github.io/gemini-scrollbar/
 * @license MIT
 */

/* disable selection while dragging */
.gm-scrollbar-disable-selection {
  user-select: none;
}

/* fallback for native floating scrollbars */
.gm-prevented {
  -webkit-overflow-scrolling: touch;
}
.gm-prevented > .gm-scrollbar {
  display: none;
}

/* actual gemini-scrollbar styles */
.gm-scrollbar-container {
  position: relative;
  overflow: hidden!important;
  width: 100%;
  height: 100%;
}

.gm-scrollbar {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 1;
  border-radius: 3px;
}

.gm-scrollbar.-vertical {
  width: 6px;
  top: 2px;
}

.gm-scrollbar.-horizontal {
  height: 6px;
  left: 2px;
}

.gm-scrollbar .thumb {
  position: relative;
  display: block;
  width: 0;
  height: 0;
  cursor: pointer;
  border-radius: inherit;
  background-color: rgba(0,0,0,.2);
  transform: translate3d(0,0,0);
}

.gm-scrollbar .thumb:hover,
.gm-scrollbar .thumb:active {
  background-color: rgba(0,0,0,.3);
}

.gm-scrollbar.-vertical .thumb {
  width: 100%;
}

.gm-scrollbar.-horizontal .thumb {
  height: 100%;
}

.gm-scrollbar-container .gm-scroll-view {
  width: 100%;
  height: 100%;
  overflow: scroll;
  transform: translate3d(0,0,0);
  -webkit-overflow-scrolling: touch;
  &::-webkit-scrollbar {
    display: none;
  }
}

/* @option: autoshow */
.gm-scrollbar-container.gm-autoshow .gm-scrollbar {
  opacity: 0;
  transition: opacity 120ms ease-out;
}
.gm-scrollbar-container.gm-autoshow:hover > .gm-scrollbar,
.gm-scrollbar-container.gm-autoshow:active > .gm-scrollbar,
.gm-scrollbar-container.gm-autoshow:focus > .gm-scrollbar {
  opacity: 1;
  transition: opacity 340ms ease-out;
}

.gm-resize-trigger {
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
}
