.sidemenu {
  position: fixed;
  display: flex;
  flex-flow: column;
  flex-direction: column;
  width: $side-menu-width;
  z-index: $zindex-sidemenu;
  a:focus {
    text-decoration: none;
  }

  .sidemenu__logo_small_breakpoint {
    display: none;
  }

  .sidemenu__close {
    display: none;
  }
}

// body class that hides sidemenu
.sidemenu-hidden {
  .sidemenu {
    display: none;
  }
}

@include media-breakpoint-up(sm) {
  .sidemenu-open {
    .sidemenu {
      background: $side-menu-bg;
      position: initial;
      height: auto;
      box-shadow: $side-menu-shadow;
      position: relative;
      z-index: $zindex-sidemenu;
    }
    .sidemenu__top,
    .sidemenu__bottom {
      display: block;
    }
  }
}

.sidemenu__top {
  padding-top: 3rem;
  flex-grow: 1;
  display: none;
}

.sidemenu__bottom {
  padding-bottom: $spacer;
  display: none;
}

.sidemenu-item {
  position: relative;
  @include left-brand-border();

  @include media-breakpoint-up(sm) {
    &.active,
    &:hover {
      background-color: $side-menu-item-hover-bg;
      @include left-brand-border-gradient();

      .dropdown-menu {
        margin: 0;
        display: block;
        opacity: 0;
        top: 0px;
        // important to overlap it otherwise it can be hidden
        // again by the mouse getting outside the hover space
        left: $side-menu-width - 2px;
        @include animation('dropdown-anim 150ms ease-in-out 100ms forwards');
        z-index: $zindex-sidemenu;
      }
    }
  }
}

.dropup.sidemenu-item:hover .dropdown-menu {
  top: auto !important;
}

.sidemenu-link {
  color: $link-color;
  line-height: 42px;
  padding: 0px 10px 0px 10px;
  display: block;
  position: relative;
  font-size: 16px;
  border: 1px solid transparent;
  text-align: center;

  img {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.05);
  }
}

@include keyframes(dropdown-anim) {
  0% {
    opacity: 0;
    //transform: translate3d(-5%,0,0);
  }
  100% {
    opacity: 1;
    //transform: translate3d(0,0,0);
  }
}

.icon-circle {
  width: 35px;
  height: 35px;
  display: inline-block;

  .fa,
  .icon-gf,
  .gicon {
    color: $side-menu-link-color;
    position: relative;
    opacity: 0.7;
    font-size: 130%;
  }

  .fa {
    top: 2px;
    position: relative;
  }

  .icon-gf {
    top: 5px;
  }

  img {
    position: relative;
  }
}

.side-menu-header {
  padding: 10px 10px 10px 20px;
  white-space: nowrap;
  background-color: $side-menu-item-hover-bg;
  font-size: 17px;
  color: #ebedf2;
}

li.sidemenu-org-switcher {
  border-bottom: 1px solid $dropdownDividerBottom;
}

.sidemenu-org-switcher__org-name {
  font-size: $font-size-base;
}

.sidemenu-org-switcher__org-current {
  font-size: $font-size-xs;
  color: $text-color-weak;
  position: relative;
  top: -2px;
}

.sidemenu-org-switcher__switch {
  font-size: $font-size-sm;
  padding-left: 1.5rem;
  display: flex;
  align-items: center;
  > i.fa.fa-random {
    margin-right: 4px;
    top: 1px;
  }
}

.sidemenu__logo {
  display: block;
  padding: 0.4rem 1rem 0.4rem 0.65rem;
  min-height: $navbarHeight;
  position: relative;

  &:hover {
    background: $navbarButtonBackgroundHighlight;
  }

  img {
    width: 30px;
    position: relative;
    top: 5px;
    left: 4px;
  }
}

@include media-breakpoint-down(xs) {
  .sidemenu-open--xs {
    li {
      font-size: $font-size-lg;
    }

    .sidemenu {
      width: 100%;
      background: $side-menu-bg-mobile;
      position: initial;
      height: auto;
      box-shadow: $side-menu-shadow;
      position: relative;
      z-index: $zindex-sidemenu;
    }

    .sidemenu__close {
      display: block;
      font-size: $font-size-md;
      position: relative;
      top: -3px;
    }

    .sidemenu__top,
    .sidemenu__bottom {
      display: block;
    }
    .sidemenu-item {
      border-right: 2px solid transparent;
    }
  }

  .sidemenu {
    .sidemenu__logo {
      display: none;
    }

    .sidemenu__logo_small_breakpoint {
      padding: 16px 10px 26px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: baseline;

      .fa-bars {
        font-size: 25px;
      }
    }

    .sidemenu__top {
      padding-top: 0rem;
    }

    .side-menu-header {
      padding-left: 10px;
    }

    .sidemenu-link {
      text-align: left;
    }

    .sidemenu-icon {
      display: none;
    }

    .dropdown-menu--sidemenu {
      display: block;
      position: unset;
      width: 100%;
      float: none;
      margin-top: 0.5rem;
      margin-bottom: 0.5rem;

      > li > a {
        padding-left: 15px;
      }
    }

    .sidemenu__bottom {
      .dropdown-menu--sidemenu {
        display: flex;
        flex-direction: column-reverse;
      }
    }
  }
}
