/* GlamBounce / Blast Wave AI chat widget — vanilla CSS, no dependencies.
   Brand colors are set via CSS variables; widget.js sets them per site
   (data-site="blastwave" or "glambounce"), overridable with
   data-primary / data-accent attributes on the <script> tag. */

:root {
  --gbw-primary: #6d28d9;
  --gbw-accent: #2563eb;
  --gbw-header-text: #ffffff;
}

#gbw-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gbw-primary), var(--gbw-accent));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
}

#gbw-bubble:hover { transform: scale(1.07); }
#gbw-bubble:focus-visible { outline: 3px solid var(--gbw-accent); outline-offset: 2px; }
#gbw-bubble svg { width: 30px; height: 30px; fill: #fff; }

/* Mascot character button: the bot's character fills the bubble and waves. */
#gbw-bubble {
  overflow: hidden;
  background: #ffffff;
  border: 3px solid var(--gbw-primary);
}
#gbw-bubble .gbw-mascot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform-origin: 50% 85%;
}
#gbw-bubble .gbw-close-icon { display: none; }
#gbw-bubble.gbw-open .gbw-mascot { display: none; }
#gbw-bubble.gbw-open .gbw-close-icon { display: block; }
#gbw-bubble.gbw-open {
  background: linear-gradient(135deg, var(--gbw-primary), var(--gbw-accent));
  border: none;
  overflow: visible;
}

/* Entrance pop */
@keyframes gbw-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
#gbw-bubble.gbw-enter { animation: gbw-pop 0.45s ease-out; }

/* Friendly wave */
@keyframes gbw-wave {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(11deg); }
  60% { transform: rotate(-7deg); }
  80% { transform: rotate(5deg); }
}
#gbw-bubble.gbw-waving .gbw-mascot { animation: gbw-wave 1.3s ease-in-out; }

#gbw-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  width: 372px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 130px);
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#gbw-panel.gbw-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.gbw-header {
  background: linear-gradient(135deg, var(--gbw-primary), var(--gbw-accent));
  color: var(--gbw-header-text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gbw-header .gbw-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.gbw-header .gbw-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gbw-header .gbw-titles { flex: 1; min-width: 0; }
.gbw-header .gbw-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.gbw-header .gbw-sub { font-size: 12px; opacity: 0.9; }

.gbw-lang {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.gbw-lang button {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
}

.gbw-lang button.gbw-active { background: rgba(255, 255, 255, 0.92); color: var(--gbw-primary); }

.gbw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f6f4fb;
}

.gbw-msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.gbw-msg.gbw-bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1f1b2d;
  border: 1px solid #e7e2f3;
  border-bottom-left-radius: 5px;
}

.gbw-msg.gbw-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gbw-primary), var(--gbw-accent));
  color: #fff;
  border-bottom-right-radius: 5px;
}

.gbw-msg a { color: var(--gbw-accent); font-weight: 600; }

.gbw-typing { display: flex; gap: 5px; padding: 13px 16px; }
.gbw-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #a79fc4;
  animation: gbw-blink 1.1s infinite;
}
.gbw-typing span:nth-child(2) { animation-delay: 0.18s; }
.gbw-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes gbw-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.gbw-quick {
  display: flex;
  gap: 8px;
  padding: 10px 12px 4px;
  overflow-x: auto;
  background: #f6f4fb;
  flex-shrink: 0;
}

.gbw-quick button {
  flex-shrink: 0;
  border: 1px solid var(--gbw-primary);
  background: #fff;
  color: var(--gbw-primary);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.gbw-quick button:hover { background: var(--gbw-primary); color: #fff; }

.gbw-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #ece7f7;
}

.gbw-input-row input {
  flex: 1;
  border: 1px solid #d9d2ec;
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.gbw-input-row input:focus { border-color: var(--gbw-primary); }

.gbw-input-row button {
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gbw-primary), var(--gbw-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.gbw-input-row button svg { width: 19px; height: 19px; fill: #fff; }
.gbw-input-row button:disabled { opacity: 0.5; cursor: default; }

.gbw-disclaimer {
  font-size: 10.5px;
  color: #8a84a3;
  text-align: center;
  padding: 7px 14px 9px;
  background: #ffffff;
  line-height: 1.4;
}

@media (max-width: 480px) {
  #gbw-panel {
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
    height: calc(100vh - 190px);
  }
  #gbw-bubble { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #gbw-bubble, #gbw-panel { transition: none; }
  .gbw-typing span { animation: none; opacity: 0.7; }
  #gbw-bubble.gbw-enter, #gbw-bubble.gbw-waving .gbw-mascot { animation: none; }
}
