/* General */
.gkmb-ai-chat__open {
  display: none;
  cursor: pointer;
  width: 46px;
  height: 46px;
  border-radius: 23px;
  line-height: 46px;
  text-align: center;
  position: fixed;
  z-index: 2000;
  right: 1.5rem;
  bottom: 1.5rem;
  background: rgb(var(--c-primary));

  &::after {
    content: "\f086";
    font-family: "FaLight";
    color: rgb(var(--c-neutral-lightest));
  }
}

.gkmb-ai-chat {
  position: fixed;
  z-index: 2000;
  max-width: calc(100vw - 3rem);
  width: 370px;
  right: 1.5rem;
  bottom: 1.5rem;
  background: rgb(var(--c-neutral-lightest));
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 10px 2px rgba(var(--c-neutral-darkest), .1);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 500px;
  max-height: calc(100vh - 3rem);
}

/* Resize Handle */
.gkmb-ai-chat__resize {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  z-index: 10;

  &::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(var(--c-neutral-lightest), .6);
    border-left: 2px solid rgba(var(--c-neutral-lightest), .6);
    border-radius: 1px;
  }
}

/* Header */
.gkmb-ai-chat__header {
  padding: 0.5rem 1rem;
  background: rgb(var(--c-primary));
  color: rgb(var(--c-neutral-lightest));
  display: flex;
  justify-content: space-between;
  align-items: center;

  & .-likeh3 {
    color: rgb(var(--c-neutral-lightest));
  }
}

.gkmb-ai-chat__minimize {
  cursor: pointer;
  width: 46px;
  height: 46px;
  line-height: 46px;
  text-align: center;

  &::after {
    content: "\f078";
    font-family: "FaLight";
  }
}

/* Messages */
.gkmb-ai-chat__messages {
  font-size: var(--f-size-s-1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.gkmb-ai-chat__message--user,
.gkmb-ai-chat__message--assistant,
.gkmb-ai-chat__welcome {
  padding: 0.5rem 1rem;
  background: rgb(var(--c-neutral-lighter));
  border-radius: 5px;
  max-width: calc(100% - 50px);
  align-self: flex-start;
}

.gkmb-ai-chat__message--user {
  align-self: flex-end;
}

.gkmb-ai-chat__typing {
  width: auto;
}

/* Typing Indicator */
.gkmb-ai-chat__typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.gkmb-ai-chat__typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgb(var(--c-neutral-dark));
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.gkmb-ai-chat__typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.gkmb-ai-chat__typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}


/* Form */
.gkmb-ai-chat__form {
  font-size: var(--f-size-s-1);
  padding: 1rem;
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.gkmb-ai-chat__submit {
  padding: 0;
  width: 46px;
  height: 46px;
  line-height: 46px;
  text-align: center;
  border-radius: 23px;
  flex: 0 0 46px;

  &::after {
    content: "\e20a";
    font-family: "FaLight"
  }
}

textarea.gkmb-ai-chat__input {
  padding: 10px 15px;
  height: 46px;
  min-height: 46px;
  max-height: 200px;
  resize: none;
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 23px;
  margin: 0;
  overflow-y: hidden;
}