@import '../../scss/mixin';

.trigger {
  position: absolute;
  display: flex;
  justify-content: center;
  font-size: 0;
  pointer-events: auto;
  cursor: pointer;
}

.button {
  @include button();
  position: relative;
  overflow: hidden;
  width: 50px;
  height: 50px;
  will-change: transform;
  transition: 0.4s;

  .buttonLabel {
    font-size: 0px;
  }

  @include hover {
    scale: 1.1;
  }

  &.buttonHover {
    @include hover {

      &+.popup {
        .popupMessage {
          opacity: 0;
          // translate: -50% 10%;

          &:nth-child(2) {
            opacity: 1;
            // translate: -50% 0%;
          }
        }
      }
    }
  }
}

.popup {
  position: static;
}

.popupMessage {
  position: absolute;
  padding: size(2) size(3);
  width: calc(100vw - rem(2));
  max-width: var(--llm-popup-max-width);
  text-align: center;
  transition: 0.4s;
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
  pointer-events: auto;
  overflow: hidden;
  background: var(--neutral-900);
  color: var(--neutral-100);
  cursor: pointer;

  &>span {
    position: relative;
  }

  &:nth-child(2) {
    opacity: 0;
  }
}

.popupCta {
  position: relative;
  display: block;
  margin: 12px auto 0 auto;
  background: var(--llm-trigger-cta-background);
  color: var(--llm-trigger-cta-foreground);
  font-weight: var(--llm-typography-cta1-font-weight);
  font-size: inherit;
}

.top-left {
  top: 1.25rem;
  left: 1.25rem;

  .popupMessage {
    top: calc(100% + 12px);
    left: 0;
    translate: 0% 0%;
  }
}

.top {
  top: 1.25rem;

  .popupMessage {
    top: calc(100% + 12px);
    left: 50%;
    translate: -50% 0%;
  }
}

.top-right {
  top: 1.25rem;
  right: 1.25rem;

  .popupMessage {
    top: calc(100% + 12px);
    right: 0;
    translate: 0% 0%;
  }
}

.left {
  left: 1.25rem;
  top: 50vh;

  .popupMessage {
    bottom: calc(100% + 12px);
    left: 0;
    translate: 0% 0%;
  }
}

.right {
  right: 1.25rem;
  top: 50vh;

  .popupMessage {
    bottom: calc(100% + 12px);
    right: 0;
    translate: 0% 0%;
  }
}

.bottom-left {
  bottom: 1.25rem;
  left: 1.25rem;

  .popupMessage {
    bottom: calc(100% + 12px);
    left: 0;
    translate: 0% 0%;
  }
}

.bottom {
  bottom: 1.25rem;

  .popupMessage {
    bottom: calc(100% + 12px);
    left: 50%;
    translate: -50% 0%;
  }
}

.bottom-right {
  bottom: 1.25rem;
  right: 1.25rem;

  .popupMessage {
    bottom: calc(100% + 12px);
    right: 0;
    translate: 0% 0%;
  }
}
