body {

  &.menu-hidden {
    .left-menu {
      min-width: $left-menu-hidden-width;
      width: $left-menu-hidden-width;

      .left-menu-header {
        min-width: $left-menu-hidden-width;
        width: $left-menu-hidden-width;
        

        .left-menu-header-text {
          opacity: 0;
          visibility: hidden;
          width: 0;

          /* Change to this if we want to move the menu toggle icon to the right
          max-width: 0;
          transition-delay: 0s;
          */
        }
      }

      .left-menu-links {
        overflow-x: hidden;

        .left-menu-group .left-menu-group-header {
          height: 0;
        }
      }
    }

    nav.navbar {
      padding-left: $left-menu-hidden-width;
    }
  }

  .body-container {
    display: flex;
  }

  .left-menu {
    min-width: $left-menu-width;
    width: $left-menu-width;
    min-height: 100vh;
    transition: min-width $left-menu-hide-animation, width $left-menu-hide-animation;
    overflow: hidden;
    z-index: 1031; // Bootstrap top navbar has z-index: 1030W
    display: flex;
    flex-direction: column;

    @include box-shadow($shadow-3);

    .left-menu-header {
      position: fixed;
      width: $left-menu-width;
      min-width: $left-menu-width;
      height: $top-bar-height;
      min-height: $top-bar-height;
      max-height: $top-bar-height;
      display: flex;
      align-items: center;
      background-color: $left-menu-header-background-color;
      padding: $left-menu-header-padding;
      color: $top-bar-font-color;
      transition: width $left-menu-hide-animation, min-width $left-menu-hide-animation;
      z-index: 1031; // Fix for IE not showing header above navbar

      .left-menu-header-text {
        font-size: 16px;
        font-weight: 500;
        font-family: $font-family-headings;
        transition-property: opacity;
        transition-delay: .25s;
        visibility: visible;
        letter-spacing: 1px;
        margin-left: 13px; // Aligned with menu items, since hamburger icon is 23 width and menu icons are 20 width

        /* Change to this if we want to move the menu toggle icon to the right
        font-size: 16px;
        font-weight: 500;
        font-family: $font-family-headings;
        letter-spacing: 1px;
        overflow: hidden;
        max-width: $left-menu-width;
        transition-property: max-width;
        transition-delay: .25s;
        */
        

        a {
          color: $color-white;
          text-decoration: none;
        }
      }

      .left-menu-header-toggle {
        display: flex;
        align-items: center; // Fix for Firefox not aligning vertically centered
        cursor: pointer;
        min-height: 30px;
        min-width: 23px; // Fix for IE not giving the element any width
        margin-left: -2px;

        button.hamburger {
          display: flex;
          outline: 0;
        }
      }
    }

    .left-menu-links {
      flex-grow: 1;
      background-color: $color-white; // So you can't see top navbar shadow
      margin-top: $top-bar-height;
      padding: 24px 0;
      width: $left-menu-width;
      transition: width $left-menu-hide-animation;
      

      .menu-link {
        display: flex;
        color: $left-menu-link-color;
        text-decoration: none;
        padding: 12px $left-menu-link-horizontal-padding;
        align-items: center;

        &.active {
          border-left: 3px solid $color-primary;
          padding-left: $left-menu-link-horizontal-padding - 3; // Subtract border width
          background-color: $left-menu-link-background-color-active;

          .menu-link-icon svg {
            fill: $color-primary;
          }
        }

        &:hover {
          background-color: $left-menu-link-background-color-hover;
        }


        .menu-link-icon svg {
          width: 20px;
          height: 20px;
          min-width: 20px; // Fix for icon flex styling in IE when menu is hidden
          min-height: 20px; // Fix for icon flex styling in IE when menu is hidden
        }



        .menu-link-icon {
          margin-right: $left-menu-link-horizontal-padding;
          display: flex;
        }

        .menu-link-text {
          margin-top: 2px;
          margin-bottom: -2px;
          white-space: nowrap;

          &:first-child {
            margin-left: 20px + $left-menu-link-horizontal-padding; // Add padding since there is not icon
          }
        }
      }

      .sub-menu {

        .sub-menu-header {
          display: flex;
          align-items: center;

          .sub-menu-toggle-icon {
            display: flex;
            margin-left: auto;
          }

          &.collapsed {
            .sub-menu-toggle-icon svg {
              transform: rotate(-90deg);
            }
          }
        }

        .sub-menu-link {
          color: $left-menu-sub-link-color;

          .sub-menu-bullet {
            margin-left: 6px;
            margin-right: 6px;
          }
        }
      }



      .left-menu-group {

        &:not(:first-child) {
          margin-top: 24px;
        }

        .left-menu-group-separator {
          border-top: 1px solid $color-gray-85;
          margin-bottom: 24px;
        }

        .left-menu-group-header {
          font-weight: 500;
          color: $left-menu-group-header-color;
          line-height: 48px;
          margin-left: $left-menu-link-horizontal-padding;
          transition: height $left-menu-hide-animation;
          height: $left-menu-group-header-height;
          overflow: hidden;
        }
      }
    }
  }

  nav.navbar {
    height: $top-bar-height;
    padding-right: 32px;
    margin-bottom: 0;
    border-bottom: 0;
    padding-left: $left-menu-width;
    transition: padding-left $left-menu-hide-animation;

    @include box-shadow($shadow-1);

    svg.embla-icon {
      fill: $top-bar-font-color;
    }

    .navbar-nav {

      .dropdown-menu {
        margin-top: 8px;
        border-top-left-radius: $border-radius-base;
        border-top-right-radius: $border-radius-base;
      }

      > li > a {
        padding-top: 0;
        padding-bottom: 0;
        margin-top: ($top-bar-height - $top-bar-button-height) / 2;
        margin-bottom: ($top-bar-height - $top-bar-button-height) / 2;
        height: $top-bar-button-height;
        display: flex;
        align-items: center;
        margin-left: 16px;
        background-color: $top-bar-button-background-color;
        border-radius: $btn-border-radius;

        &:hover {
          .dropdown-image {
            opacity: .7;
          }
        }

        > span {
          display: flex;
        }

        .dropdown-image {
          border-bottom-left-radius: 2px;
          border-top-left-radius: 2px;
          margin-left: -15px;
          overflow: hidden;

          img, svg {
            height: 40px;
          }
        }

        .dropdown-toggle-icon {
          margin-left: 8px;
        }

        svg.embla-icon {
          width: 20px;
          height: 20px;
        }

        @media screen and (min-width: 767px) {
          &.btn-icon {
            padding: 10px;
          }
        }
      }
    }

    .navbar-collapse {
      border-top: 0;
    }

    .navbar-toggle {
      margin-right: 0;
    }
  }

  .page-content {
    margin-top: $top-bar-height;
    flex-grow: 1; // Makes content grow to fill the remaining horisontal space
    min-width: 0; // Allows flex child to shrink past content size. See https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size
  }

  .body-content {
    padding: $page-content-vertical-padding $page-content-horizontal-padding;
  }

  @media screen and (max-width: 767px) {

    .left-menu {
      position: absolute;
    }

    nav.navbar {
      padding-right: 0;
      min-height: $top-bar-height;
      height: auto;

      .navbar-nav {
        li a {
          margin-left: 0;
          border-radius: 0;
          background-color: transparent;

          &:hover {
            background-color: transparent;
          }

          .dropdown-image {
            border-radius: 2em;
            margin-left: 0;
          }

          .dropdown-toggle-icon {
            margin-left: auto;
          }
        }
      }
    }

    .body-content {
      margin-left: 0;
      padding-left: $page-content-responsive-horizontal-padding;
      padding-right: $page-content-responsive-horizontal-padding;
    }

    &.menu-hidden {
      overflow: visible;

      .left-menu {
        min-width: 0;
        width: 0;
        overflow: visible;

        .left-menu-header {
          min-width: $left-menu-hidden-width;
          width: $left-menu-hidden-width;
        }

        .left-menu-links {
          overflow: hidden;
          width: 0;
        }
      }

      nav.navbar {
        .navbar-collapse {
          margin-left: -1 * $left-menu-hidden-width;
        }
      }
    }
  }
}
