@use "@tencentcloud/uikit-base-component-react/dist/styles/theme/util" as *;
@use "../bubble-mixins" as bubble;
@use "../../../../styles/mixins/text" as text;

.text-message {
  padding: 10px 12px;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: start;

  &--self {
    @include bubble.bubble-base-self();
  }

  &--other {
    @include bubble.bubble-base-other();
  }

  &__reference {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 4px;

    @include theme() {
      background-color: get(button-color-secondary-hover);
      border-left: 6px solid get(text-color-tertiary);

      &:hover {
        background-color: get(button-color-secondary-hover);
      }

      &:active {
        background-color: get(button-color-secondary-active);
      }
    }

    &--recalled {
      @include theme() {
        background-color: get(button-color-secondary-hover);
        color: get(text-color-tertiary);
        border-left: 6px solid get(text-color-tertiary);
      }
    }

    &__header {
      font-size: 14px;
      font-weight: 500;
      min-width: 150px;

      @include theme() {
        color: get(text-color-primary);
      }
    }

    &__content {
      word-break: break-word;

      @include text.multi-line-ellipsis(2);

      @include theme() {
        color: get(text-color-secondary);
      }
    }
  }

  &__content {
    display: block;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
    font-weight: 500;

    &__img {
      display: inline;
      height: 20px;
      width: 20px;
      vertical-align: text-bottom;
      object-fit: contain;
      user-select: text;
      pointer-events: none;
    }
  }
}
