@use '../../../styles/mixins';

.businessLocation {
  flex-shrink: 0;

  width: 3rem;
  height: 3rem;
  margin-inline-start: 0.25rem;
  border-radius: 0.25rem;

  object-fit: cover;

  @include mixins.with-vt-type('chatExtra');
}

.personalChannel {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;

  margin-bottom: 1rem;

  @include mixins.with-vt-type('chatExtra');
}

.personalChannelTitle {
  grid-column: 1;
  grid-row: 1;

  margin-bottom: 0;
  margin-inline-start: 0.5rem;

  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.phone, .description, .link, .miniapp, .notifications, .location, .note, .savedMessages, .botEmojiStatus,
.botLocation, .subscribers {
  @include mixins.with-vt-type('chatExtra');
}

.switch {
  margin-inline-start: auto;
}

.botVerificationSection,
.sectionInfo {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.botVerificationSection {
  padding-inline: 1.25rem;

  @include mixins.with-vt-type('chatExtra');
}

.botVerificationIcon {
  --custom-emoji-size: 1rem;

  margin-inline-end: 0.25rem;
}

.personalChannelSubscribers {
  grid-column: 2;
  grid-row: 1;

  margin-inline-end: 0.5rem;

  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.personalChannelItem {
  grid-column: 1 / span 2;
  grid-row: 2;
  margin-top: 0.375rem;

  :global(.Avatar) {
    margin-right: 0.9375rem !important;
  }
}

.openAppButton {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.note {
  @include mixins.with-vt-type('profileNote');
}

.noteSubtitle {
  display: flex !important;
  align-items: center;

  @include mixins.with-vt-type('profileNote');
}

.noteListItemIcon {
  align-self: flex-start;
  padding-top: 1rem;
}

.noteHint {
  margin-left: auto;
}

.noteText {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;

  &::after {
    pointer-events: none;
    content: '';

    position: absolute;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 1.5rem;

    opacity: 0;
    background: linear-gradient(to top, var(--color-background) 0%, transparent 100%);

    transition: opacity 0.3s ease;
  }

  @include mixins.with-vt-type('profileNote');
}

.noteTextCollapsed::after {
  opacity: 1;
}

.noteExpandIcon {
  margin-inline-start: 0.125rem;
  font-size: 0.9375rem;
  line-height: 0.9375rem;

  @include mixins.with-vt-type('profileNote');
}

.clickable {
  cursor: var(--custom-cursor, pointer);
}

.securityRiskIsland {
  margin-bottom: 1rem;
}

.unofficialSecurityRisk {
  margin-bottom: 0.5rem;
  padding-inline: 0.5rem;
  line-height: 1.25;
  text-wrap: balance;
}

.riskIcon {
  margin-inline-end: 0.25rem;
  color: var(--color-error);
}

@include mixins.on-active-vt('profileNote') {
  &::view-transition-image-pair(.noteText) {
    overflow: hidden;
  }

  &::view-transition-old(.noteText),
  &::view-transition-new(.noteText) {
    animation-name: none;
  }
}

@include mixins.on-active-vt('profileNoteExpand') {
  &::view-transition-old(.noteExpandIcon) {
    animation-name: vt-expand-icon-spin;
  }

  &::view-transition-new(.noteExpandIcon) {
    display: none;
  }

  &::view-transition-old(.noteText) {
    display: none;
  }
}

@include mixins.on-active-vt('profileNoteCollapse') {
  &::view-transition-old(.noteExpandIcon) {
    animation-name: vt-collapse-icon-spin;
  }

  &::view-transition-new(.noteExpandIcon) {
    display: none;
  }

  &::view-transition-new(.noteText) {
    display: none;
  }
}
