/* WP AI Chatbot — Styles */
:root {
  --waicb-accent: #2563eb;
  --waicb-radius: 16px;
  --waicb-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

#waicb-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--waicb-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--waicb-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  z-index: 999998;
  transition: transform 0.2s, box-shadow 0.2s;
}
#waicb-fab:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(0,0,0,0.22); }

#waicb-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  max-height: 540px;
  background: #fff;
  border-radius: var(--waicb-radius);
  box-shadow: var(--waicb-shadow);
  display: flex;
  flex-direction: column;
  z-index: 999999;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: opacity 0.2s, transform 0.2s;
}
#waicb-window.waicb-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
}
#waicb-window.waicb-left { right: auto; left: 24px; }
#waicb-fab.waicb-left    { right: auto; left: 24px; }

/* Header */
#waicb-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: var(--waicb-accent);
  flex-shrink: 0;
}
#waicb-header .waicb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
#waicb-header .waicb-info { flex: 1; }
#waicb-header .waicb-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
#waicb-header .waicb-status { font-size: 12px; opacity: 0.85; }
#waicb-close {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; padding: 0 4px;
  line-height: 1; opacity: 0.8;
}
#waicb-close:hover { opacity: 1; }

/* Messages */
#waicb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f8fa;
}
.waicb-msg { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.waicb-msg.waicb-user { align-self: flex-end; align-items: flex-end; }
.waicb-msg.waicb-bot  { align-self: flex-start; align-items: flex-start; }
.waicb-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.waicb-msg.waicb-user .waicb-bubble {
  background: var(--waicb-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.waicb-msg.waicb-bot .waicb-bubble {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.waicb-time { font-size: 11px; color: #9ca3af; }

/* Typing dots */
.waicb-typing { display: flex; gap: 5px; align-items: center; padding: 4px 2px; }
.waicb-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  animation: waicb-bounce 1.2s infinite;
}
.waicb-typing span:nth-child(2) { animation-delay: 0.2s; }
.waicb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes waicb-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-7px); }
}

/* Input area */
#waicb-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  align-items: flex-end;
  flex-shrink: 0;
}
#waicb-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  resize: none;
  max-height: 80px;
  min-height: 38px;
  line-height: 1.4;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
#waicb-input:focus { border-color: var(--waicb-accent); }
#waicb-send {
  width: 38px; height: 38px;
  border: none;
  border-radius: 10px;
  background: var(--waicb-accent);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
#waicb-send:hover { opacity: 0.88; }
#waicb-send:disabled { opacity: 0.45; cursor: not-allowed; }

/* Inline shortcode button */
#waicb-inline-btn {
  background: var(--waicb-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  margin: 8px 0;
}

/* Mobile */
@media (max-width: 420px) {
  #waicb-window { width: calc(100vw - 24px); right: 12px; bottom: 80px; }
  #waicb-window.waicb-left { left: 12px; right: auto; }
  #waicb-fab { right: 14px; bottom: 14px; }
  #waicb-fab.waicb-left { left: 14px; right: auto; }
}
