@use "../../base/mixins";
@use "../../vars/variables";

.modal--add-group,
.modal--edit-group {
  .lwf-entity-list,
  .modal__body__col {
    @include mixins.list-borders-dark;
  }
}

.modal--add-group {
  // .modal {
  //   &__body {
  //     &__step {
  //       &__body {
  //         position: relative;
  //         width: 100%;
  //         max-width: 32.5rem;
  //         height: 100vh;
  //         height: 100dvh;
  //         max-height: fill-available;
  //         max-height: -webkit-fill-available;
  //         max-height: -moz-available;
  //         margin-left: auto;
  //         margin-right: auto;
  //       }
  //     }
  //   }
  // }

  &__base-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    gap: 1.875rem;

    @media screen and (max-width: variables.$bp-tablet) {
      padding-top: 1.875rem;
    }

    &__header-info {
      @include mixins.body-large;
      color: var(--uc-white);
      text-align: center;
    }

    .button-next {
      min-width: 10.75rem;
    }

    .list-with-filter {
      height: calc(100% - 7rem);
      width: 100%;

      @media screen and (max-width: variables.$bp-tablet) {
        height: calc(100% - 5rem);
      }

      &__items {
        @media screen and (max-width: variables.$bp-phone) {
          margin-bottom: 0;
        }
      }

      .lwf-entity-list__items {
        margin-bottom: 0;
      }
    }
  }
}

.modal--edit-group {
  &__meta-info {
    @include mixins.body-extrasmall;
    color: var(--uc-theme-color-50);
    padding: 0 1rem;

    @media screen and (max-width: variables.$bp-tablet) {
      display: none;
    }
  }

  &__available-entities {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--uc-background);
    z-index: 5;
    padding: 0 1.45rem 0 3.75rem;

    @media screen and (max-width: variables.$bp-tablet) {
      position: fixed;
      left: 0;
      width: 100vw;
      padding: 1.25rem 1.25rem 0;
      border-radius: 1rem 1rem 0 0;
      background: transparent;

      & > * {
        position: relative;
        background: var(--uc-background);
        padding: 0 1.25rem;
      }

      &::before {
        position: fixed;
        content: "";
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        content: "";
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 0;
      }
    }

    @media screen and (max-width: variables.$bp-phone) {
      top: 5vh;
      top: 5dvh;
      height: 95vh;
      height: 95dvh;
      padding: 1.25rem 0 0;
    }

    &__header {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 1rem;
      border-top-left-radius: 0.5rem;
      border-top-right-radius: 0.5rem;

      @media screen and (max-width: variables.$bp-tablet) {
        padding-top: 0.625rem;
      }
    }

    .lwf-entity-list {
      height: calc(100% - 3rem);
      margin-top: 0.5rem;

      @media screen and (max-width: variables.$bp-tablet) {
        height: calc(100% - 3rem);
        margin-top: 0;
        padding-bottom: 0.625rem;
      }
    }
  }

  .modal {
    &__wrapper {
      @media screen and (max-width: variables.$bp-phone) {
        height: 100%;
      }
    }

    &__container {
      @media screen and (max-width: variables.$bp-phone) {
        height: 100%;
      }
    }

    &__body {
      min-height: 80vh;
      min-height: 80dvh;

      @media screen and (max-width: variables.$bp-tablet) {
        gap: 2rem;
      }

      @media screen and (max-width: variables.$bp-phone) {
        overflow-x: hidden;
        overflow-y: scroll;
        width: calc(100% + 0.5rem);
        padding-right: 0.5rem;
        flex: 1;
      }

      &__col {
        position: relative;
        padding: 0 3.75rem;
        margin-top: 1.875rem;
        margin-bottom: auto;

        @media screen and (min-width: variables.$bp-tablet-plus) {
          height: calc(100% - 1.875rem);
        }

        @media screen and (max-width: variables.$bp-phone) {
          padding: 0;
          margin-top: 0;
          margin-bottom: 0;
          flex: none;
        }

        &--meta {
          position: relative;
          display: flex;
          flex-direction: column;
          gap: 1.25rem;

          @media screen and (max-width: variables.$bp-tablet) {
            align-items: center;
            max-height: 22rem;
          }

          @media screen and (max-width: variables.$bp-phone) {
            max-height: 100vh;
            max-height: 100dvh;
          }
        }
      }
    }
  }

  .included-entity-list {
    &__items {
      @media screen and (max-width: variables.$bp-tablet) {
        height: calc(100vh - 37rem);
        height: calc(100dvh - 37rem);
        margin-bottom: 0;
      }

      @media screen and (max-width: variables.$bp-phone) {
        height: calc(100vh - 33.5rem);
        height: calc(100dvh - 33.5rem);
      }
    }
  }
}
