@mixin focused() {
  outline: 0 none;
  outline-offset: 0;
  transition: box-shadow 0.2s;
  box-shadow: 0 0 0 0.1rem var(--p-primary-400);
}

@mixin focused-inset() {
  outline: 0 none;
  outline-offset: 0;
  transition: box-shadow 0.2s;
  box-shadow: inset 0 0 0 0.1rem var(--p-primary-400);
}

//#region TOPBAR

.layout-topbar {
  position: fixed;
  height: 4.5rem;
  z-index: 997;
  left: 0;
  top: 0;
  width: 100%;
  padding: 0 2rem;
  background-color: var(--p-surface-900);
  transition: left 0.2s;
  display: flex;
  align-items: center;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05),
    0px 1px 4px rgba(0, 0, 0, 0.08);
  border-radius: 6px 6px 0px 0px;

  .layout-topbar-logo {
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 500;
    width: 220px;
    border-radius: var(--p-content-border-radius);
  }

  .layout-menu-button {
    border-radius: 50%;
    width: 34px;
    height: 34px;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-right: 1rem;

    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;

    &:hover {
      color: var(--p-primary-400);
      background-color: var(--p-surface-800);
    }

    &:focus {
      @include focused();
    }

    i {
      font-size: 1.2rem;
    }
  }

  .profile-button {
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
    display: flex;
  }
}

.gray-separator {
  border-top: 1px solid var(--p-surface-700);
  width: 100%;
}

.hover-card {
  padding: 8px 10px;
  border-radius: var(--p-content-border-radius);
  cursor: pointer;
}

.hover-card:hover {
  background-color: var(--p-surface-800);
}

.card {
  background: var(--p-surface-900);
  border: 1px solid var(--p-surface-700);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: #000;
  border-radius: var(--p-content-border-radius);

  &:last-child {
    margin-bottom: 0;
  }
}

//#endregion

//#region LAYOUT

@media (min-width: 992px) {
  .layout-wrapper {
    height: 100%;

    &.layout-static {
      .layout-main-container {
        margin-left: 220px;
      }

      &.layout-static-inactive {
        .layout-sidebar {
          transform: translateX(-330%);
          left: 0;
        }

        .layout-main-container {
          margin-left: 0;
          padding-left: 2rem;
        }
      }
    }
  }
}

@media (max-width: 991px) {
  .layout-wrapper {
    .layout-main-container {
      margin-left: 0;
      padding-left: 2rem;
    }

    .layout-sidebar {
      transform: translateX(-330%);
      left: 0;
      top: 0;
      height: 100%;
      z-index: 999;
      // border: 0px solid var(--p-surface-700) !important;
    }

    &.layout-mobile-active {
      .layout-sidebar {
        transform: translateX(0);
      }
    }
  }
}

.layout-main-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  padding: 6.5rem 2rem 2rem 4rem;
  transition: margin-left 0.2s;
}

.layout-main {
  flex: 1 1 auto;
  overflow-y: auto;
}

//#endregion

//#region SIDEBAR

.layout-sidebar {
  position: fixed;
  width: 220px;
  height: calc(100% - 8.5rem);
  overflow-y: auto;
  user-select: none;
  top: 6.5rem;
  left: 2rem;
  transition: transform 0.2s, left 0.2s;
  background-color: var(--p-surface-900);
  box-shadow: 0 0 1px 1px var(--p-surface-700) !important;
  border-radius: var(--p-content-border-radius);
  padding: 1rem;
  box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05),
    0px 1px 4px rgba(0, 0, 0, 0.08);
}

.layout-menu {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.layout-menuitem {
  user-select: none;
  display: flex;
  align-items: center;
  position: relative;
  outline: 0 none;
  color: var(--p-text-color);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--p-content-border-radius);
  transition: background-color 0.2s, box-shadow 0.2s;

  .layout-menuitem-icon {
    margin-right: 0.5rem;
  }

  &.active-route {
    font-weight: 700;
    color: var(--p-primary-400);
  }

  &:hover {
    background-color: var(--p-surface-800);
    text-decoration: none;
  }

  &:focus {
    @include focused-inset();
  }
}

//#endregion
