/* WhatsApp-style chatbot widget */

.qb-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100000;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #25d366;
  color: #0b141a;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.qb-chat-launcher--whatsapp i {
  font-size: 22px;
}

.qa-header-chat-btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #25d366;
  color: #0b141a;
  font-weight: 700;
}

.qa-header-chat-btn i {
  font-size: 14px;
}

.qb-chat-launcher svg {
  display: block;
  color: #0b141a;
}

.qb-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 99999;
}

.qb-chat-window {
  position: fixed;
  right: 100px;
  bottom: 72px;
  width: min(420px, calc(100vw - 36px));
  height: min(680px, calc(100vh - 96px));
  border-radius: 18px;
  background: #efeae2;
  border: 2px solid rgba(37, 211, 102, 0.55);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  /* Allow the whole chat surface to scroll when content is taller than the window */
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 100000;
}

.qb-chat-window,
.qb-chat-card,
.qb-chat-messages,
.qb-chat-quick {
  font-family: inherit;
}

body.qb-chat-open .qb-chat-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.qb-chat-open .qb-chat-window {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.qb-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #128c7e;
  color: #fff;
}

.qb-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qb-chat-header-title {
  font-weight: 900;
  font-size: 16px;
}

.qb-chat-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.qb-chat-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.qb-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 14px 12px 10px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%20viewBox='0%200%20180%20180'%3E%3Cg%20fill='none'%20stroke='%23d9d0c3'%20stroke-width='2'%20opacity='0.35'%3E%3Cpath%20d='M36%2030c10-10%2026-10%2036%200%2010%2010%2010%2026%200%2036-10%2010-26%2010-36%200-10-10-10-26%200-36z'/%3E%3Cpath%20d='M120%2024c14%200%2026%2012%2026%2026s-12%2026-26%2026-26-12-26-26%2012-26%2026-26z'/%3E%3Cpath%20d='M22%20114c18-8%2036%200%2044%2018%2018%208%2018%200%2036-18%2044-18%200-36%2018-44%2018z'/%3E%3Cpath%20d='M144%20134l12-6%206%2012%2012-12z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}

.qb-msg {
  display: flex;
  margin-bottom: 10px;
  max-width: 92%;
}

.qb-msg--user {
  margin-left: auto;
  justify-content: flex-end;
}

.qb-bubble {
  padding: 10px 12px;
  border-radius: 16px;
  white-space: pre-line;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.5;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.qb-msg--user .qb-bubble {
  background: #d9fdd3;
  color: #0b141a;
}

.qb-msg--assistant .qb-bubble {
  background: #ffffff;
  color: #0b141a;
}

.qb-chat-quick {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 12px 14px;
  max-height: 42%;
  overflow: auto;
}

.qb-quick-hint {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 10px;
}

.qb-section-title {
  font-size: 12px;
  font-weight: 900;
  opacity: 0.9;
  margin: 14px 0 8px;
}

.qb-qbtn {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13.5px;
  color: #0b141a;
}

.qb-qbtn:hover {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .qb-chat-overlay,
  .qb-chat-window {
    transition: none !important;
  }
}

@media (max-width: 480px) {
  /* On small screens, avoid the TOP button by moving chat above it. */
  .qb-chat-launcher {
    right: 18px;
    bottom: 86px;
  }

  .qb-chat-window {
    right: 10px;
    bottom: 92px;
    width: calc(100vw - 20px);
    height: calc(100vh - 112px);
  }

  .qb-chat-messages {
    padding-left: 10px;
    padding-right: 10px;
  }

  .qb-chat-quick {
    max-height: 46%;
  }
}

