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

#Settings {
  height: 100%;

  .multiline-item .title-with-date {
    display: flex;
    justify-content: space-between;

    .date {
      flex-shrink: 0;

      margin-inline-start: 1rem;

      font-size: 0.75rem;
      font-weight: normal;
      color: var(--color-text-secondary);
    }
  }

  .chat-list {
    padding-bottom: 0;

    @media (max-width: 600px) {
      padding-block: 0;
    }
  }

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

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

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

    &:has(~ .scrolled),
    &:has(~ .settings-fab-wrapper .scrolled) {
      background-color: var(--color-background);
    }
  }
}

.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));
  padding: 1rem;
  padding-top: 0;

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

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

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

  margin-bottom: 1rem;
  padding-block: 0;
  padding-inline: 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-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: 0.5rem;
}

.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-block: 0;
    margin-inline: 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;
      }
    }

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

        .icon {
          color: inherit;
        }
      }
    }

    & + .settings-item-description {
      margin-top: 0.5rem;
    }
  }

  .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-language-transition {
  height: auto;
  margin-top: 1rem;
}

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

.settings-picker-islands {
  padding: 1rem;
  background-color: var(--color-background-secondary);
}

.settings-input {
  padding: 0.125rem;
}

.settings-input > :last-child {
  --input-group-margin: 0;
}

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

.ListItem.blocked-list-item {
  .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);
  }
}

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

  .with-notch::before {
    top: 0 !important;
  }

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

.settings-birthday-date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}
