// Disable sidenav animations while starting the app
// See https://github.com/angular/material2/blob/master/src/lib/sidenav/sidenav-transitions.scss
.starting.mat-sidenav-transition {
  .mat-sidenav,
  .mat-sidenav-content,
  .mat-sidenav-backdrop.mat-sidenav-shown {
    transition: none;
  }
}

// SMALL SCREEN -> TOP NAV SLIDES INTO SIDENAV
aio-nav-menu.top-menu .vertical-menu-item  {
  background-color: $lightgray;
  text-transform: uppercase;
}

md-sidenav.mat-sidenav.sidenav {
  position: fixed;
  bottom: 0;
  left: 0;
  padding: 80px 0px 0px;
  min-width: 260px;
  background-color: $offwhite;
  box-shadow: 6px 0 6px rgba(0,0,0,0.10);

  &.collapsed {
    padding-top: 32px;
  }
}

md-sidenav-container.sidenav-container {
    min-height: 100%;
    height: auto !important;
    max-width: 82%;
    margin: 0;
    transform: none;
    padding-top: 64px;

    @media (max-width: 800px) {
      max-width: 100%;
    }
}

md-sidenav-container div.mat-sidenav-content {
    height: auto;
}

.vertical-menu-item {
  box-sizing: border-box;
  color: $darkgray;
  cursor: pointer;
  display: block;
  max-width: 260px;
  overflow-wrap: break-word;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 16px;
  text-decoration: none;
  text-align: left;
  transition-duration: 180ms;
  transition-property: background-color, color;
  transition-timing-function: ease-in-out;
  width: 100%;
  word-wrap: break-word;
  outline: none;

  &:hover {
    background-color: $lightgray;

  }

  //icons _within_ nav
  .mat-icon {
    position: absolute;
    top: 0;
    right: 8px;
    margin: 4px;
  }
}

.vertical-menu-item.selected {
  color: $blue;
}

.heading {
  color: #444;
  cursor: pointer;
  position: relative;
  text-transform: uppercase;
  width: 100%;
}

.heading-children.expanded {
  visibility: visible;
  opacity: 1;
  max-height: 4000px; // Arbitrary max-height. Can increase if needed. Must have measurement to transition height.
  transition: visibility 500ms, opacity 500ms, max-height 500ms;
  -webkit-transition-timing-function: ease-in-out;
  transition-timing-function: ease-in-out;
}

.heading-children.collapsed {
  visibility: hidden;
  opacity: 0;
  max-height: 1px; // Must have measurement to transition height.
  transition: visibility 275ms, opacity 275ms, max-height 280ms;
  -webkit-transition-timing-function: ease-out;
  transition-timing-function: ease-out;
}

a.selected.level-1,
.heading.selected.level-1,
.heading-children.selected.level-1 {
  border-left: 3px $blue solid;
}

.level-1 {
  font-family: $main-font;
  font-size: 14px;
  font-weight: 400;
  padding-left: 16px;
  transition: background-color 0.2s;
}

.level-2 {
  font-family: $main-font;
  font-size: 14px;
  color: $mediumgray;
  font-weight: 400;
  padding-left: 20px;
  text-transform: none;
}

.level-3 {
  font-family: $main-font;
  font-size: 14px;
  color: $mediumgray;
}

.level-1.expanded .mat-icon, .level-2.expanded .mat-icon {
  @include rotate(90deg);
}

.level-1:not(.expanded) .mat-icon, .level-2:not(.expanded) .mat-icon {
  @include rotate(0deg);
  margin: 4px;
}

.promo-img-container img {
  max-width: 90%;
  @include bp(small) {
    max-width: 100%;
  }
}

aio-nav-menu.top-menu {
  aio-nav-item:first-child .vertical-menu-item {
    padding-top: 48px;
  }

  aio-nav-item:last-child div {
    border-bottom: 2px solid rgba($mediumgray, 0.5);
  }

}

// Angular Version Selector
md-sidenav .doc-version {
  padding: 10px;
  border-top: 1px solid $lightgray;

  select {
    outline: none;
    width: 100%;
    background: rgba($lightgray, 0.5);
    height: 32px;
    border: 1px solid $lightgray;
    color: $darkgray;

    option {
      font-family: $main-font;
      font-size: 14px;
    }
  }
}
