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

.root {
  cursor: var(--custom-cursor, default);

  display: flex;
  flex-direction: row-reverse;
  align-items: center;

  margin-left: auto;

  background: var(--color-background);

  :global {
    .Button {
      margin-left: 0.25rem;

      &.tiny {
        margin-right: 0.625rem;
      }
    }
  }

  :global(body.no-page-transitions) & {
    transition: none !important;
    :global(.ripple-container) {
      display: none;
    }
  }

  > :global(.Button) {
    flex-shrink: 0;
  }
}

.mini {
  @media (min-width: 1276px) {
    transform: translate3d(0, 0, 0);
    transition: opacity 0.15s ease, transform var(--layer-transition);

    :global(body.no-right-column-animations) & {
      transition: opacity 0.15s ease;
    }

    :global(#Main.right-column-open) & {
      transform: translate3d(calc(var(--right-column-width) * -1), 0, 0);
    }
  }
}

.fullWidth {
  @include mixins.middle-header-pane;

  height: 3.5rem;

  .pinnedMessage {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
  }

  .messageText {
    max-width: none !important;
  }
}

.loading {
  --spinner-size: 1.5rem;
}

.pinListIcon {
  position: absolute;
  transition: 0.25s ease-in-out opacity, 0.25s ease-in-out transform;
}

.pinListIconHidden {
  transform: scale(0.6);
  opacity: 0;
}

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

  position: relative;
  z-index: 1;

  overflow: hidden;
  display: flex;
  flex-shrink: 1;
  align-items: center;

  margin-top: -0.25rem;
  margin-bottom: -0.25rem;
  padding: 0.25rem;
  padding-left: 0.375rem;
  border-radius: var(--border-radius-messages-small);

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

  &:hover:not(.no-hover) {
    background-color: var(--color-interactive-element-hover);
  }
}

.messageTextTransition {
  overflow: hidden;
  width: 100%;
  height: 1.125rem;
}

.messageText {
  overflow: hidden;
  flex-grow: 1;

  min-width: 15rem;
  max-width: 15rem;
  margin-top: 0.125rem;
  margin-inline-start: 0.375rem;

  transition: 0.25s ease-in-out transform;

  &.withMedia {
    transform: translateX(2.625rem);
    min-width: calc(15rem - 2.625rem);
    max-width: calc(15rem - 2.625rem);
    margin-right: 2.625rem;

    &[dir="rtl"] {
      transform: translateX(-0.25rem);
    }
  }

  :global(.emoji-small) {
    width: 1rem;
    height: 1rem;
  }

  @media (min-width: 1440px) and (max-width: 1500px) {
    max-width: 14rem;
  }
}

.title {
  height: 1rem;
  margin-bottom: 0.125rem;

  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  line-height: 1rem;
  color: var(--color-primary);
  text-align: initial;
  white-space: pre;

  :global(body.is-ios) & {
    font-size: 0.9375rem;
  }
}

.summary {
  --custom-emoji-size: 1.125rem;

  overflow: hidden;

  height: 1.125rem;
  margin: 0;

  font-size: 0.875rem;
  line-height: 1.125rem;
  text-overflow: ellipsis;
  white-space: nowrap;

  :global(body.is-ios) & {
    font-size: 0.9375rem;
  }
}

.inlineButton,
.inlineButton:global(.Button.tiny) {
  overflow: hidden;
  display: block;
  flex-shrink: 1;

  width: auto;
  max-width: 10rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 1.5rem;

  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.pictogramTransition {
  position: absolute;

  overflow: hidden;

  width: 2.25rem !important;
  height: 2.25rem;
  margin-top: 0.125rem;
  margin-inline-start: 0.5rem;
}

.pinnedThumb {
  overflow: hidden;
  flex-shrink: 0;

  width: 100%;
  height: 100%;
  border-radius: 0.25rem;

  & + .messageText {
    max-width: 12rem;
  }
}

@media (max-width: 600px) {
  .pinnedMessage {
    flex-grow: 1;

    max-width: unset;
    margin-top: -0.1875rem;
    padding-top: 0;
    padding-bottom: 0;

    &::before {
      top: 0.125rem;
      bottom: 0.125rem;
    }

    .messageText {
      max-width: none;
    }
  }
}
