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 {

    @include box-shadow($shadow-3);
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    min-width: $left-menu-width;
    overflow: hidden;
    transition: min-width $left-menu-hide-animation, width $left-menu-hide-animation;
    width: $left-menu-width;
    z-index: 1031; // Bootstrap top navbar has z-index: 1030W

    .left-menu-header {
      align-items: center;
      background-color: $left-menu-header-background-color;
      color: $top-bar-font-color;
      display: flex;
      height: $top-bar-height;
      max-height: $top-bar-height;
      min-height: $top-bar-height;
      min-width: $left-menu-width;
      padding: $left-menu-header-padding;
      position: fixed;
      transition: width $left-menu-hide-animation, min-width $left-menu-hide-animation;
      width: $left-menu-width;
      z-index: 1031; // Fix for IE not showing header above navbar

      .left-menu-header-text {
        font-family: $font-family-headings;
        font-size: 16px;
        font-weight: $font-weight-bold;
        letter-spacing: 1px;
        margin-left: 13px; // Aligned with menu items, since hamburger icon is 23 width and menu icons are 20 width
        transition-delay: 0.25s;
        transition-property: opacity;
        visibility: visible;

        /* Change to this if we want to move the menu toggle icon to the right
        font-size: 16px;
        font-weight: $font-weight-bold;
        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 {
        align-items: center; // Fix for Firefox not aligning vertically centered
        cursor: pointer;
        display: flex;
        margin-left: -2px;
        min-height: 30px;
        min-width: 23px; // Fix for IE not giving the element any width

        button.hamburger {
          display: flex;
          outline: 0;
        }
      }
    }

    .left-menu-links {
      background-color: $color-white; // So you can't see top navbar shadow
      flex-grow: 1;
      margin-top: $top-bar-height;
      padding: 24px 0;
      width: $left-menu-width;

      .menu-link {
        align-items: center;
        color: $left-menu-link-color;
        display: flex;
        padding: 12px $left-menu-link-horizontal-padding;
        text-decoration: none;

        &.active {
          background-color: $left-menu-link-background-color-active;
          border-left: 3px solid $color-primary;
          padding-left: $left-menu-link-horizontal-padding - 3; // Subtract border width

          .menu-link-icon svg {
            fill: $color-primary;
          }
        }

        &:hover {
          background-color: $left-menu-link-background-color-hover;
        }


        .menu-link-icon svg {
          height: 20px;
          min-height: 20px; // Fix for icon flex styling in IE when menu is hidden
          min-width: 20px; // Fix for icon flex styling in IE when menu is hidden
          width: 20px;
        }



        .menu-link-icon {
          display: flex;
          margin-right: $left-menu-link-horizontal-padding;
        }

        .menu-link-text {
          margin-bottom: -2px;
          margin-top: 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 {
          align-items: center;
          display: flex;

          .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 {
          color: $left-menu-group-header-color;
          font-weight: $font-weight-bold;
          height: $left-menu-group-header-height;
          line-height: 48px;
          margin-left: $left-menu-link-horizontal-padding;
          overflow: hidden;
          transition: height $left-menu-hide-animation;
        }
      }
    }
  }

  nav.navbar {
    @include box-shadow($shadow-1);
    height: $top-bar-height;

    svg.embla-icon {
      fill: $top-bar-font-color;
    }

    .navbar-toggler {
      min-height: $top-bar-height;

      svg.embla-icon {
        height: 30px;
        width: 30px;
      }
    }

    .navbar-nav {
      .dropdown-menu {
        border-bottom-left-radius: $btn-border-radius;
        border-bottom-right-radius: $btn-border-radius;
        border-top-left-radius: $btn-border-radius;
        border-top-right-radius: $btn-border-radius;
      }

      > li.nav-item > a.nav-link {
        align-items: center;
        background-color: $top-bar-button-background-color;
        border-radius: $btn-border-radius;
        color: $color-white;
        display: flex;
        height: $top-bar-button-height;
        margin-bottom: ($top-bar-height - $top-bar-button-height) / 2;
        margin-left: 16px;
        margin-top: ($top-bar-height - $top-bar-button-height) / 2;
        padding-left: 15px;
        padding-right: 15px;
        text-decoration: none;

        &:hover {
          background-color: $nav-link-hover-bg;

          .dropdown-image {
            opacity: 0.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;
            width: 40px;
          }
        }

        .dropdown-toggle-icon {
          margin-left: 8px;
        }

        svg.embla-icon {
          height: 20px;
          width: 20px;
        }

        @media screen and (min-width: 767px) {
          &.btn-icon {
            padding: 10px;
          }
        }
      }
    }

    .navbar-collapse {
      border-top: 0;
    }
  }

  .page-content {
    flex-grow: 1; // Makes content grow to fill the remaining horisontal space
    margin-top: $top-bar-height;
    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 {
      height: auto;
      min-height: $top-bar-height;
      padding-bottom: 0;
      padding-right: 0;
      padding-top: 0;


      .navbar-nav {
        li.nav-item > a.nav-link {
          background-color: transparent;
          border-radius: 0;
          margin-left: 0;

          &:hover {
            background-color: transparent;
          }

          .dropdown-image {
            border-radius: 2em;
            margin-left: 0;
          }

          .dropdown-toggle-icon {
            margin-left: auto;
          }
        }

        li {
          div.dropdown-menu {
            margin-bottom: $margin-m;
          }
        }
      }
    }

    .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;
        overflow: visible;
        transition: none;
        width: 0;

        .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;
          padding-left: $padding-m;
          padding-right: $padding-m;
        }
      }
    }
  }
}
