@import (reference) '../../common/variables.less';

eak-sidebar {
  .sidebar-nav-list {
    flex: 1 1 0;
  }

  // Nav Item Container
  .sidebar-nav-item {
    display: block;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 32px;

    & > .sidebar-nav-item-heading {
      font-size: 12px;
      opacity: 0.7;
      padding: 0 40px 0 25px;
    }
  }

  // Primary Heading
  .sidebar-nav-item-heading {
    position: relative;
    display: flex;
    padding: 6px 40px 6px 25px;
    color: inherit;
    @media @sm {
      padding-left: 36px;
    }
    @media @md-xl {
      padding-left: 26px;
    }

    &.active ::before,
    &.active ~ .sidebar-nav-secondary::before {
      content: '';
      position: absolute;
      top: 0;
      left: 1px;
      height: 100%;
      border-left: 3px solid @nav-accent;
    }
  }

  .sidebar-nav-item-trigger {
    flex: 1 0 auto;
    margin: 0;
    padding: 0;
    opacity: 0;

    transition: opacity 0.5s ease-in;

    &:hover {
      color: @nav-hover;
    }
  }
  &.open .sidebar-nav-item-trigger {
    opacity: 1;
  }
  &:not(.open) .sidebar-nav-item-trigger {
    pointer-events: none;
  }

  .sidebar-nav-item-arrow::after {
    content: '';
    display: inline-block;
    margin: 2px 10px;
    width: 12px;
    height: 6px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 9' xml:space='preserve'%3E%3Cpolyline points='0,0 8,8 16,0' fill='none' stroke='rgb(51,54,56)' stroke-width='2'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;

    transform: rotate(0deg);
    transform-origin: center;
    transition: transform 0.5s ease-in-out;
  }
  .sidebar-nav-item-trigger[active] {
    &.sidebar-nav-item-arrow::after {
      transform: rotate(180deg);
    }
  }
}
