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

.Management {
  height: 100%;

  & > .custom-scroll {
    overflow-x: hidden;
    overflow-y: scroll;
    height: 100%;
  }

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

  .section {
    padding: 1rem 0.5rem;

    @include mixins.adapt-padding-to-scrollbar(0.5rem);
    @include mixins.side-panel-section;

    &.wide {
      padding: 1.5rem;
    }

    &:first-of-type {
      padding-top: 1rem;
    }

    &.no-border {
      border-top: none;
    }

    &.section-with-fab {
      padding-bottom: 3.5rem;
    }

    > .ChatInfo {
      margin: 0 0 2rem !important;

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

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

    .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;
        }
      }
    }

    .section-heading {
      position: relative;

      padding-inline-start: 1rem;

      font-size: 1rem;
      font-weight: var(--font-weight-semibold);
      color: var(--color-text-secondary);

      &[dir="auto"] {
        text-align: initial;
      }
    }

    .section-help {
      padding: 0 1rem;
      line-height: 1.375rem;
      color: var(--color-text-secondary);

      &[dir="auto"] {
        text-align: initial;
      }
    }

    .section-info {
      padding: 0 1rem;
      font-size: 0.875rem;
      color: var(--color-text-secondary);
    }

    .invite-link {
      padding: 0 1rem;
    }

    .section-info_push {
      margin-top: 0.25rem;
    }

    &[dir="rtl"] {
      text-align: right;
    }
  }

  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 {
  padding: 0.5rem 1rem;
}

.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;
    padding: 0 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;

  &::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 {
    padding-bottom: 0;
    box-shadow: none;
  }

  .part {
    margin: 0 -1.5rem;
    padding: 0 1.5rem 1rem;

    @include mixins.side-panel-section;
  }

  .section, .part {
    position: relative;
    transition: 0.25s ease-in-out transform;

    &.shifted {
      transform: translateY(var(--shift-height));
    }
  }
}

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