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

#Settings {
  height: 100%;

  .with-notch::before {
    top: var(--header-height);
  }

  > .Transition_slide {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .left-header {
    padding-right: 0.8125rem;
  }

  .self-profile .ProfileInfo {
    margin: -0.5rem 0 0.75rem -0.5rem;
    margin-inline-end: calc(min(var(--scrollbar-width) - 0.5rem, 0px));
  }
}

.settings-main-header {
  display: flex;
  flex-grow: 1;
  align-items: center;
  justify-content: space-between;
}

.settings-more-menu {
  .bubble {
    width: auto;

    .MenuItem button {
      padding-right: 2rem !important;
      padding-left: 1rem !important;
    }
  }
}

.settings-content {
  overflow-y: scroll;
  height: calc(100% - var(--header-height));

  &.password-form .input-group.error label::first-letter {
    text-transform: uppercase;
  }

  &.infinite-scroll {
    overflow-y: hidden;
    display: flex;
    flex-direction: column;

    & > .custom-scroll {
      flex: 1 1 auto;
      height: auto;
    }
  }

  .settings-icon-locked {
    align-self: center;
    margin-right: 0.25rem !important;
    font-size: 1rem !important;
  }

  #monkey {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }

  .AnimatedEmoji {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
  }
}

.settings-content-header {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 0 1.5rem;

  text-align: center;

  &.no-border {
    margin-bottom: 0;
    box-shadow: none;
  }

  .input-group {
    width: 100%;
  }
}

.settings-content-icon {
  margin-bottom: 2.5rem;

  &.opacity-transition.not-shown {
    display: block;
    visibility: hidden;
  }
}

.settings-main-menu {
  padding: 0.5rem;

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

  .ListItem.narrow:not(.multiline) {
    margin-bottom: 0;

    .ListItem-button {
      min-height: 3.5rem;
    }
  }
}

.settings-range-value {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 2rem;
  color: var(--color-primary);
}

.settings-item-simple,
.settings-item {
  padding: 0.5rem 0.5rem 1rem;
  text-align: initial;

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

.settings-unlock-button {
  margin-top: 1rem;
  margin-inline: 1rem;
}

.fluid-container {
  display: flex;
  flex-direction: column;
}

.settings-unlock-button-title {
  display: flex;
  align-items: center;
}

.settings-unlock-button-icon {
  margin-inline-start: 0.25rem;
}

.settings-item {
  &.no-border {
    margin-bottom: 0;
    border-bottom: none;
    box-shadow: none;
  }

  &-header {
    position: relative;

    padding-inline-start: 1rem;

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

  &-slider {
    margin-top: 2rem;
  }

  &-description {
    margin: -0.5rem 1rem 1rem;
    font-size: 0.875rem;
    line-height: 1.3125;
    color: var(--color-text-secondary);

    .settings-content.two-fa &,
    .settings-content.password-form &,
    .settings-content.local-passcode & {
      font-size: 1rem;
    }

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

  &-description-larger {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    padding-inline-start: 1rem;

    font-size: 1rem;
    line-height: 1.3125rem;
    color: var(--color-text-secondary);

    &.premium-info {
      margin-top: 1rem;
    }

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

    .gift-icon {
      vertical-align: text-top;
    }
  }

  .ListItem {
    &.narrow {
      margin-bottom: 0;
    }

    .multiline-item {
      .subtitle.tight {
        line-height: 1rem;
      }

      .date {
        float: right;
        margin-left: 1rem;
        font-size: 0.75rem;
        color: var(--color-text-secondary);
      }
    }

    &.destructive {
      .ListItem-button {
        color: var(--color-error);

        .icon {
          color: inherit;
        }
      }
    }

    &.blocked-list-item {
      margin-bottom: 0.5rem;

      .ListItem-button {
        align-items: center;
        padding: 0.5rem;
        text-align: left;
      }

      .Avatar {
        width: 3rem;
        height: 3rem;
        margin-right: 1rem;
      }

      .contact-info {
        overflow: hidden;
      }

      .contact-name {
        margin-bottom: 0.25rem;
        font-size: 1rem;
        font-weight: var(--font-weight-medium);
        line-height: 1rem;
      }

      .contact-phone {
        font-size: 0.875rem;
        line-height: 1rem;
        color: var(--color-text-secondary);
      }
    }

    &[dir="rtl"] {
      .multiline-item .date {
        float: left;
        margin-right: 1rem;
        margin-left: 0;
      }
    }
  }

  .radio-group {
    .Radio:last-child {
      margin-bottom: 0;
    }

    .Checkbox {
      margin-left: 0;
    }
  }

  > .Checkbox, > .Radio {
    padding-inline-start: 4.1875rem;
  }

  &__current-value {
    margin-inline-start: auto;
    padding-inline-start: 0.5rem;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
  }
}

.settings-picker {
  padding-block: 0;
}

.settings-input {
  padding: 0.5rem 1rem 0 1rem;
}

.settings-group {
  padding: 1rem 1.5rem;
}

.settings-fab-wrapper {
  position: relative;
  height: calc(100% - var(--header-height));

  .settings-content {
    height: 100%;
  }

  .FloatingActionButton {
    right: 1.5rem;

    &[dir="rtl"] {
      right: auto;
      left: 1.5rem;
    }
  }
}

.settings-quick-reaction {
  .Radio-main .label {
    display: flex;
    align-items: center;
  }

  .ReactionStaticEmoji {
    width: 1.5rem;
    margin-inline-end: 1rem;
  }
}

.settings-dropdown-section {
  .DropdownList {
    position: relative;
    padding: 0 0 0 3rem;

    &--open {
      transform: translate(0, 0);
    }
  }
}

.SettingsDefaultReaction {
  .current-default-reaction {
    margin-inline-end: 1.75rem;
  }
}

.settings-item-chatlist {
  padding: 0;
}

.settings-item-chatlist .ListItem {
  margin: inherit;
}

.settings-item-picker {
  padding: 1.5rem 0.5rem 0.5rem;
}

.block-user-button {
  z-index: var(--z-chat-float-button);
}

.settings-button {
  font-weight: var(--font-weight-semibold);
}
