@import "variables";

$bgcolor-menu-hover: #1a75c4; // #1e88e5;
$nav-width: 190px;
$nav-width-collapsed: 50px;
$nav-trans-time: 0.1s;
$topbar-height: 50px;

.evo-sidebar {
  position: fixed;
  left: 0;
  top: $topbar-height;
  height: calc(100% - $topbar-height);
  width: $nav-width;
  z-index: 5;
  padding: 10px 0 0;
  overflow: hidden;
  transition: width $nav-trans-time ease;
  color: $color-almostwhite;
  border-right: 1px solid #e0e0e0;
  background: #1976d2 url("./spirals.png");
  user-select: none;
  -moz-user-select: none;
  &:hover {
    overflow-y: auto;
  }
  a {
    display: block;
    color: $color-almostwhite !important;
    text-decoration: none !important;
    &:hover,
    &.active {
      text-decoration: none;
    }
  }
  > div {
    line-height: 22px;
    padding: 7px;
    font-weight: bold;
    font-size: 16px;
  }
  > ul {
    list-style-type: none;
    padding: 0;
    > li {
      position: relative;
      font-size: 14px;
      margin: 0 0 4px 10px;
      border-radius: 10px;
      transition: padding-left $nav-trans-time ease;
      height: 28px;
      > a {
        padding: 5px;
        @include ellipsis();
        border-radius: 10px;
        outline: none;
        img {
          width: $icon-size;
          height: $icon-size;
        }
        > span {
          transition: display 0 $nav-trans-time;
        }
        &:focus {
          background-color: $bgcolor-menu-hover;
        }
      }
      transition: background-color $ease-time;
      &:hover,
      &.active {
        background-color: $bgcolor-menu-hover;
        color: $color-almostwhite;
        > .x-icons {
          display: inline-block;
          width: 65px;
          visibility: visible;
          margin-right: 10px;
          transition: width $ease-time ease $delay-time2;
        }
      }
    }
  }
  .x-icons {
    position: absolute;
    top: 6px;
    right: -5px;
    text-align: right;
    width: 0;
    visibility: hidden;
    overflow: hidden;
    transition: width $ease-time ease 0s;
    height: 20px;
    font-size: 12px;
    padding: 0;
    z-index: 100;
    > a {
      display: inline-block;
      outline: none;
      &:hover,
      &:focus {
        svg {
          fill: orange;
        }
      }
      > svg {
        fill: $color-almostwhite;
        height: $icon-size;
        width: $icon-size;
        margin: 0 2px;
      }
    }
  }

  > .sections-links {
    > a {
      overflow-x: hidden;
      white-space: nowrap;
      outline: none;
      > img {
        position: relative;
        top: -1px;
        margin-right: 10px;
        width: 24px;
        height: 24px;
      }
      min-width: 40px;
      margin-bottom: 20px;
      padding: 5px;
      border-radius: 10px;
      &:last-child {
        margin-bottom: 5px;
      }
      &:focus,
      &:hover {
        background-color: $bgcolor-menu-hover;
      }
    }
  }
}

.page-content {
  position: relative;
  flex: 1 0 auto;
  margin-left: $nav-width;
  padding: 10px 30px;
  margin-top: $topbar-height;
  min-height: 90%;
  transition: margin-left $nav-trans-time ease;
}

.nav-toggle {
  position: absolute;
  top: 0;
  right: -2px;
  padding: 0;
  z-index: 10;
  cursor: pointer;
  > svg {
    width: 30px;
    transition: transform 0.5s ease 0.1s;
    transform: rotate(90deg);
  }
  &:hover {
    > svg {
      fill: orange;
    }
  }
}

.side-collapsed {
  > .evo-sidebar {
    width: $nav-width-collapsed;
    > .nav-toggle {
      > svg {
        transform: rotate(-90deg);
      }
    }
    > ul > li {
      > a > span {
        display: none;
      }
    }
    .x-icons {
      display: none !important;
    }
  }
  > .page-content {
    margin-left: $nav-width-collapsed;
  }
}

/* skip nav #508 */
a.skipNav {
  left: -800px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -100;
}
#afterNav {
  height: 0;
  width: 0;
}
