@use "../../../styles/mixins";

.Management {
  height: 100%;

  & > .custom-scroll,
  & > .panel-content {
    overflow-x: hidden;
    overflow-y: scroll;

    height: 100%;
    padding: 1rem;

    background-color: var(--color-background-secondary);

    @include mixins.adapt-padding-to-scrollbar(1rem);
  }

  .personal-photo {
    transform: scale(1.25);
    margin-right: 2rem;
  }

  .section-icon {
    margin: 0 auto 2rem;
  }

  & > .custom-scroll > .ChatInfo,
  & > .panel-content > .ChatInfo {
    display: flex;
    flex-direction: column;
    align-items: center;

    margin-bottom: 1rem;
    padding: 1rem 1.5rem;

    text-align: center;
  }

  .ChatInfo .title h3 {
    margin-bottom: 0;
  }

  .ListItem {
    .Reaction {
      display: flex;
      align-items: center;
    }

    .ReactionStaticEmoji {
      width: 1.5rem;
      margin-right: 1.6875rem;
    }

    &.with-checkbox {
      body.is-ios &::after,
      body.is-android &::after {
        bottom: -1rem;
      }
    }

    &.exceptions-member {
      .ChatInfo .status {
        white-space: pre-wrap;
      }
    }
  }

  .invite-link {
    padding: 0;
  }

  .input-admin-title {
    margin-top: 0.875rem;
    margin-inline: 1rem;
  }

  textarea.form-control {
    height: auto;
  }

  .group-link {
    padding-left: 1rem;
    color: var(--color-text);
  }

  .RangeSlider {
    margin-top: 1rem;
  }

  .button-position {
    justify-content: initial;
  }

  &__filter {
    overflow-y: auto;
    display: flex;
    flex-flow: row wrap;
    flex-shrink: 0;

    max-height: 20rem;
    margin-bottom: 0.625rem;
    padding: 0 1rem 0.25rem 0.75rem;

    @include mixins.side-panel-section;

    .input-group {
      flex-grow: 1;
      margin-bottom: 0.5rem;
      margin-left: 0.5rem;
    }

    .form-control {
      height: 2rem;
      padding: 0;
      border: none;
      border-radius: 0;

      box-shadow: none;
    }
  }

  .create-item {
    .icon-group {
      margin-inline-start: 0.1875rem;
      margin-inline-end: 1.1875rem;
    }
  }

  .Spinner {
    margin: 2rem auto;
  }
}

.ManageGroupMembers > .panel-content {
  overflow: hidden;
  display: flex;
  flex-direction: column;

  .island-list {
    overflow: hidden;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;

    min-height: 0;
    padding-block: 0;

    .picker-list {
      overflow-x: hidden;
      overflow-y: auto;
      flex-grow: 1;
      padding-block: 0.5rem;
    }
  }
}

.ManageInvites {
  .create-item {
    margin-bottom: 0.5rem;
    .icon-add {
      margin-inline-start: 0.1875rem;
      margin-inline-end: 1.1875rem;
    }
  }

  .ListItem-button {
    align-items: center;
  }

  .link-status-icon {
    position: static !important;

    display: block;

    aspect-ratio: 1;
    margin-right: 1rem !important;
    padding: 0.5rem;
    border-radius: 50%;

    color: white !important;

    &-gray {
      background-color: #707579;
    }

    &-green {
      background-color: #4fae4e;
    }

    &-red {
      background-color: #e17076;
    }

    &-blue {
      background-color: #3390ec;
    }
  }

  .invite-title {
    white-space: nowrap;
  }
}

.ManageInvite {
  .link-name {
    margin-bottom: 1rem;
  }

  .expire-limit {
    margin-top: 1rem;
  }

  .usage-limit {
    margin-top: 1rem;
    -moz-appearance: textfield;
    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }
  }

  .custom-scroll {
    padding-bottom: 4rem;
  }
}

.ManageInviteInfo {
  .copy-link {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .link-title {
    text-align: center;
  }
}

.ManageJoinRequests {
  .bulk-actions {
    display: flex;
    justify-content: space-around;
  }

  .bulk-action-button {
    width: auto;
    height: auto;
  }
}

.ManageInvite,
.ManageInvites {
  .hint {
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.875rem;
  }
}

.DropdownList {
  position: absolute;
  left: 0;
  transform: translateY(calc(-100%));

  width: 100%;
  padding: 0 0.5rem 0 3.5rem;

  background: var(--color-background);

  transition: 0.25s ease-in-out transform;

  &--open {
    transform: translateY(0.025rem);
  }
}

.DropdownListTrap {
  width: 100%;
  height: 0;

  /* stylelint-disable-next-line plugin/no-low-performance-animation-properties */
  transition: height 0.25s ease-in-out;

  &::before {
    content: "";

    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    left: 0;

    height: calc(var(--before-shift-height) + 2.5rem);

    background: var(--color-background);
  }
}

.with-shifted-dropdown {
  .ListItem, .section-heading {
    position: relative;
    z-index: 2;
  }

  .without-bottom-shadow {
    --before-shift-height: 48px;

    position: relative;
    overflow: hidden;
    padding: 0.5rem 0.5rem 0;
    box-shadow: none;

    &.dropdown-open .DropdownListTrap {
      height: var(--shift-height);
    }
  }

  .part {
    padding-bottom: 0.5rem;
  }

  .section, .part {
    position: relative;
  }
}

.settings-edit {
  padding: 0.125rem;
  padding-bottom: 0 !important;
}
