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

.root {
  :global(.modal-dialog) {
    max-width: 26rem;
  }
}

.content {
  padding: 0 !important;
}

.modalTitle {
  margin-bottom: 0;
}

.container {
  padding: 1rem;
  border-bottom-right-radius: var(--border-radius-modal);
  border-bottom-left-radius: var(--border-radius-modal);
  background-color: var(--color-background-secondary);
}

.header {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 0.0625rem solid var(--color-borders);
}

.actionMessageView {
  position: relative;

  overflow: hidden;
  display: grid;
  flex: 0 0 auto;
  place-content: center;

  width: calc(100% - 1.5rem);
  height: 100%;
  min-height: 22.5rem;
  margin: 0.75rem;
  border-radius: var(--border-radius-default);

  background-color: var(--theme-background-color);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;

  &::before {
    content: "";

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    background-image: url('../../../assets/chat-bg-pattern-light.png');
    background-repeat: repeat;
    background-position: top right;
    background-size: 510px auto;
    mix-blend-mode: overlay;

    :global(html.theme-dark) & {
      background-image: url('../../../assets/chat-bg-pattern-dark.png');
      mix-blend-mode: unset;
    }

    @media (max-width: 600px) {
      bottom: auto;
      height: calc(var(--vh, 1vh) * 100);
    }
  }

  :global(.Message) {
    padding: 1rem;
  }

  :global(.message-content) {
    max-width: 20rem;
  }

  :global(html.theme-light) & {
    background-image: url('../../../assets/chat-bg-br.png');
  }
}

.info {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.background {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  overflow: hidden;

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

  &::before {
    content: "";

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  }

  :global(html.theme-light) &:not(.customBgImage)::before {
    background-image: url('../../../assets/chat-bg-br.png');
  }

  &:not(.customBgImage).customBgColor::before {
    display: none;
  }

  &.customBgImage::before {
    transform: scale(1.1);
    background-image: var(--custom-background) !important;
  }

  :global(body:not(.no-page-transitions)) &.withTransition {
    transition: background-color 0.2s;

    &.customBgImage::before {
      transition: background-image var(--layer-transition);
    }
  }

  &.customBgImage.blurred::before {
    filter: blur(12px);
  }

  :global(html.theme-light body:not(.no-page-transitions)) &:not(.customBgImage).withRightColumn::before {
    @media screen and (min-width: 1276px) {
      transform: scaleX(0.73) !important;
    }

    @media screen and (min-width: 1921px) {
      transform: scaleX(0.8) !important;
    }

    @media screen and (min-width: 2600px) {
      transform: scaleX(0.95) !important;
    }
  }

  /* stylelint-disable-next-line @stylistic/max-line-length */
  :global(html.theme-light body:not(.no-page-transitions)) &:not(.customBgImage).withRightColumn.withTransition::before {
    transition: transform var(--layer-transition);
  }

  &:not(.customBgImage):not(.customBgColor)::after {
    content: "";

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    background-image: url('../../../assets/chat-bg-pattern-light.png');
    background-repeat: repeat;
    background-position: top right;
    background-size: 510px auto;
    mix-blend-mode: overlay;

    :global(html.theme-dark) & {
      background-image: url('../../../assets/chat-bg-pattern-dark.png');
      mix-blend-mode: unset;
    }
  }

  @media screen and (min-width: 1276px) {
    :global(body:not(.no-page-transitions)) &:not(.customBgImage)::before {
      transform-origin: left center;
      transform: scale(1);
      overflow: hidden;
    }
  }
}
