/**
 * GW Assistant — Genesis Bot chat widget styles.
 * Self-contained. No Vite pipeline dependency.
 * GW Red: #dc2626 | Dark Red: #b91c1c
 * Pill: 1.25x | Panel: 1.5x
 */

/* ===== Animations ===== */
@keyframes gw-bot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes gw-bot-blink {
  0%, 42%, 46%, 100% { ry: 4; }
  44% { ry: 0.8; }
}
@keyframes gw-bot-wave {
  0%, 40%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-20deg); }
  25% { transform: rotate(15deg); }
}
@keyframes gw-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}
@keyframes gw-panel-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.gw-bot-float {
  animation: gw-bot-float 3s ease-in-out infinite;
}
.gw-bot-eye {
  animation: gw-bot-blink 4s ease infinite;
}
.gw-bot-arm-l {
  transform-origin: 4px 18px;
  animation: gw-bot-wave 2.5s ease infinite;
}

/* ===== Wrapper (controls open/closed) ===== */
.gw-assistant-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ===== Pill launcher (1.25x + yellow bg) ===== */
.gw-assistant-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fef3c7;
  border: 2.5px solid #dc2626;
  border-radius: 35px;
  padding: 10px 19px 10px 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 5px 18px rgba(220, 38, 38, 0.15);
  font-size: 0;
  line-height: 1;
}
.gw-assistant-pill:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(220, 38, 38, 0.25);
}
.gw-assistant-pill__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gw-assistant-pill__avatar svg {
  width: 40px;
  height: 40px;
}
.gw-assistant-pill__text {
  font-size: 15px;
  font-weight: 700;
  color: #dc2626;
}

/* Hide pill when panel is open */
.gw-assistant-wrapper[data-open="true"] .gw-assistant-pill {
  display: none;
}

/* ===== Panel (1.5x) ===== */
.gw-assistant-panel {
  display: none;
  flex-direction: column;
  width: 520px;
  height: 720px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: gw-panel-slide-up 0.25s ease;
}
.gw-assistant-wrapper[data-open="true"] .gw-assistant-panel {
  display: flex;
}

/* ===== Header — GW Red ===== */
.gw-assistant-header {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.gw-assistant-header__avatar {
  flex-shrink: 0;
}
.gw-assistant-header__avatar svg {
  width: 52px;
  height: 52px;
}
.gw-assistant-header__info {
  flex: 1;
}
.gw-assistant-header__name {
  font-size: 19px;
  font-weight: 700;
}
.gw-assistant-header__badge {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 3px;
}
.gw-assistant-header__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-assistant-header__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== Messages area ===== */
.gw-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

/* Bubbles (1.5x) */
.gw-assistant-bubble {
  max-width: 82%;
  padding: 14px 18px;
  font-size: 15.5px;
  line-height: 1.55;
  word-wrap: break-word;
}
.gw-assistant-bubble--bot {
  background: #fef3c7;
  color: #78350f;
  align-self: flex-start;
  border-radius: 18px 18px 18px 5px;
}
.gw-assistant-bubble--user {
  background: #dbeafe;
  color: #1e3a8a;
  align-self: flex-end;
  border-radius: 18px 18px 5px 18px;
}

/* Suggestion chips (1.5x, blue borders) */
.gw-assistant-chips {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-self: flex-start;
  width: 82%;
}
.gw-assistant-chip {
  background: #fff;
  border: 1.5px solid #2563eb;
  color: #2563eb;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.gw-assistant-chip:hover {
  background: #2563eb;
  color: #fff;
}

/* Typing indicator (1.5x) */
.gw-assistant-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: #fef3c7;
  align-self: flex-start;
  border-radius: 18px 18px 18px 5px;
}
.gw-assistant-typing__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #78350f;
  opacity: 0.35;
  animation: gw-bounce 1.2s infinite;
}
.gw-assistant-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.gw-assistant-typing__dot:nth-child(3) { animation-delay: 0.4s; }

/* ===== Composer (1.5x + GW Red accents) ===== */
.gw-assistant-composer {
  border-top: 1px solid #e2e8f0;
  padding: 14px 16px 10px;
  background: #fff;
  flex-shrink: 0;
}
.gw-assistant-composer__row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.gw-assistant-composer__input {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15.5px;
  color: #1e293b;
  background: #dbeafe;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  max-height: 100px;
  overflow-y: auto;
}
.gw-assistant-composer__input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.gw-assistant-composer__send {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #dc2626;
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.gw-assistant-composer__send:hover {
  background: #b91c1c;
}
.gw-assistant-composer__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gw-assistant-composer__disclaimer {
  font-size: 11.5px;
  color: #94a3b8;
  text-align: center;
  margin-top: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 560px) {
  .gw-assistant-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    border-radius: 16px;
  }
  .gw-assistant-wrapper {
    bottom: 12px;
    right: 12px;
  }
}

/* ===== Mood Avatar System ===== */
@keyframes gw-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes gw-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.gw-assistant-pill__powered {
  display: block;
  font-size: 12px;
  font-weight: 600;
  font-style: italic;
  color: #2563eb;
  margin-top: 2px;
}

.gw-bolt {
  font-size: 32px;
  color: #dc2626;
  font-style: normal;
  font-weight: bolder !important;
  margin-right: -13px;
  margin-left: -13px;
}

.gw-assistant-header__avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  position: relative;
}

/* All mood SVGs hidden by default */
.gw-mood {
  display: none;
  width: 100%;
  height: 100%;
}

/* Show only the active mood */
[data-mood="hello"] .gw-mood--hello { display: block; }
[data-mood="thinking"] .gw-mood--thinking { display: block; }
[data-mood="talking"] .gw-mood--talking { display: block; }
[data-mood="oops"] .gw-mood--oops { display: block; }
[data-mood="search"] .gw-mood--search { display: block; }

/* Thinking spinner */
.gw-spinner {
  animation: gw-spin 1.5s linear infinite;
  transform-origin: 20px 22px;
}

/* Thinking arm wiggle */
.gw-wiggle {
  animation: gw-wiggle 0.8s ease infinite;
}

/* Smooth transition between moods */
.gw-assistant-header__avatar svg {
  transition: opacity 0.3s ease;
}