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

.root {
  :global(.bubble) {
    width: calc(100vw - 4rem) !important;
    max-width: 27rem;
    border-radius: var(--border-radius-default-small);

    @media (max-width: 600px) {
      width: calc(100vw - 3rem) !important;
    }
  }

  :global(body.is-touch-env) & {
    :global(.bubble) {
      width: 100% !important;
    }
  }

  :global(.is-pointer-env) & {
    > :global(.backdrop) {
      position: absolute;
      top: -0.5rem;
      right: 0;
      bottom: auto;
      left: auto;

      width: 3.5rem;
      height: 4.5rem;
    }
  }
}

.content {
  overflow-y: scroll;
  display: flex;
  flex-direction: column;

  max-height: 75vh;
  padding: 0.1875rem 0.625rem;

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

.row {
  display: flex;
  flex-direction: row;

  & + & {
    margin-top: 0.375rem;
  }
}

.button {
  --secondary-bg: transparent;

  flex: 1;

  width: auto;
  height: auto;
  min-height: 3.0625rem;
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-messages-small);

  font-weight: var(--font-weight-medium);
  color: var(--color-primary);

  background: var(--color-background);

  &::before {
    content: '';

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
    border-radius: inherit;

    opacity: 80%;
    background-color: var(--secondary-bg);
  }

  & + & {
    margin-left: 0.375rem;
  }

  &:hover {
    border-color: var(--color-primary-shade);
    color: #fff;
    background: var(--color-primary-shade);
  }
}

.inlineButtonText {
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customEmojiIcon {
  margin-inline-end: 0.125rem;
  vertical-align: text-top;
}

.primaryTint,
.successTint,
.destructiveTint {
  border-width: 0;
  color: #fff;
  background-color: transparent;

  &:hover {
    border-color: transparent;
    opacity: 75%;
    background-color: transparent;
  }
}

.primaryTint {
  --secondary-bg: var(--color-primary);
}

.successTint {
  --secondary-bg: var(--color-success);
}

.destructiveTint {
  --secondary-bg: var(--color-error);
}
