@use 'mixins/mixins' as *;
@use 'mixins/var' as *;
@use 'common/var' as *;

@include b(sidebar-item) {
  transition: getCssVar(transition-ease);
  @include flex(flex-start, center);
  width: 100%;

  padding: 14px 16px;
  padding-top: 15px;
  text-align: left;
  background: transparent;
  font-size: 1rem;
  font-weight: bold;
  opacity: 0.7;
  position: relative;
  color: getColor('text');
  border: 0px;

  @include when(has-icon) {
    padding: 0px;

    @include when(active) {
      padding-left: 8px;
    }

    &:hover {
      padding-left: 8px;
      opacity: 1;
    }
  }

  &:after {
    content: '';
    position: absolute;
    left: -4px;
    top: 0px;
    width: 10px;
    height: 100%;
    background: getColor('color');
    border-radius: 0px 20px 20px 0px;
    transform: translate(-7px);
    transition: getCssVar(transition-ease);
    z-index: 60;
  }
  @include when(active) {
    opacity: 1;
    color: getColor('color');

    &:after {
      transform: translate(-1px);
    }

    &:not(.is-has-icon) {
      padding-left: 25px;
    }
  }

  @include e(icon) {
    min-width: 50px;
    height: 47px;
    @include flex(center, center);
    font-size: 1.2rem;
    z-index: 50;
    background: getColor('background');
  }

  &:hover:not(.is-has-icon) {
    opacity: 1;
    padding-left: 25px;
  }

  @include e(text) {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    z-index: 10;
    transition: getCssVar(transition-ease);
    font-size: 0.9rem;
  }

  @include e(arrow) {
    width: 7px;
    height: 7px;
    position: relative;
    justify-self: flex-end;
    margin-left: auto;
    margin-right: 15px;
    transition: getCssVar(transition-ease);
    transform: rotate(-135deg) !important;
    z-index: 80;

    .#{$namespace}-icon-arrow {
      &:before {
        width: 2px;
      }
      &:after {
        height: 2px;
      }
    }
  }

  @include e(text-tooltip) {
    position: fixed;
    left: 50px;
    opacity: 0;
    pointer-events: none;
    transition: getCssVar(transition-ease);
    font-size: 0.85rem;
    white-space: nowrap;
  }
}
