@import '~gemini-scrollbar/gemini-scrollbar.css';
@import '~sass-flex-mixins/src/sass-flex-mixins.scss';
@import '../utils/theme/variables.scss';
$scrollbar-size: 7px !default;
$scrollbar-size-hover: $scrollbar-size * 1.25 !default;
$scrollbar-color: $brc-coolGrey !default;
$scrollbar-container-color: $brc-white !default;

// this is the way to make gemini consider a width of 0 for scrollbars in IE
body > div[style*='-ms-overflow-style: scrollbar'] {
  -ms-overflow-style: none !important;
}

body > div::-webkit-scrollbar {
  display: none;
}

.scrollview {
  overflow: hidden;
  height: 100%;
  width: 100%;

  @include flex_flex(1 1 auto);

  > .gm-scrollbar {
    z-index: 999;
    transition-duration: 250ms;
    transition-timing-function: ease;

    &.-vertical {
      right: 0;
      padding: 0 4px;
      width: auto;
      transition-property: background-color width;

      &:not(.visible) {
        visibility: hidden;
        pointer-events: none;
      }

      .thumb {
        position: static;
        margin: 0;
        width: $scrollbar-size;
        transition: width 250ms ease;
      }

      &:hover,
      &:active {
        .thumb {
          width: $scrollbar-size-hover;
        }
      }

      &:active .thumb {
        background-color: $scrollbar-color;
        transition: background-color 250ms ease;
      }
    }

    &.-horizontal {
      bottom: 0;
      padding: 4px 0;
      height: auto;
      transition-property: background-color height;

      &:not(.visible) {
        visibility: hidden;
        pointer-events: none;
      }

      .thumb {
        position: static;
        transition: height 250ms ease;
        margin: 0;
        height: $scrollbar-size;
      }

      &:hover,
      &:active {
        background: rgba($scrollbar-container-color, 0.8);

        .thumb {
          height: $scrollbar-size-hover;
        }
      }

      &:active .thumb {
        background-color: $scrollbar-color;
        transition: background-color 250ms ease;
      }
    }

    .thumb {
      border-radius: $scrollbar-size / 2;
      background-color: rgba($scrollbar-color, 0.6);

      &:hover {
        background-color: $scrollbar-color;
        transition: background-color 250ms ease;
      }
    }
  }

  > .gm-scroll-view {
    -ms-overflow-style: none;

    > * {
      -ms-overflow-style: auto; // reset -ms-overflow-style as it is inherited by default
    }

    &::-webkit-scrollbar {
      height: 0;
      width: 0;
      -webkit-appearance: none;
    }
  }
}
