/* ==========================================================================
   Voice Agents 365 — Chat Widget Styles
   Floating chat bubble + panel, bottom-right corner
   ========================================================================== */

/* ---------- Chat Bubble ---------- */
.va-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent, #F97316);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.va-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(249, 115, 22, 0.5);
}

.va-chat-bubble svg {
  width: 28px;
  height: 28px;
  transition: opacity 0.2s;
}

.va-chat-bubble .va-icon-close { display: none; }
.va-chat-bubble.open .va-icon-chat { display: none; }
.va-chat-bubble.open .va-icon-close { display: block; }

/* ---------- Chat Panel ---------- */
.va-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-height: 560px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.va-chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---------- Panel Header ---------- */
.va-chat-header {
  background: var(--slate, #1A1D2E);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.va-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #F97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.va-chat-header-info h4 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.va-chat-header-info p {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ---------- Messages Area ---------- */
.va-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 360px;
}

.va-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.va-msg-ai {
  background: var(--gray-100, #F3F4F6);
  color: var(--charcoal, #1F2937);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.va-msg-user {
  background: var(--accent, #F97316);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.va-msg-typing {
  align-self: flex-start;
  background: var(--gray-100, #F3F4F6);
  padding: 12px 18px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.va-typing-dots {
  display: flex;
  gap: 4px;
}

.va-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-400, #9CA3AF);
  animation: va-bounce 1.4s infinite ease-in-out both;
}

.va-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.va-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.va-typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes va-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ---------- Quick Actions ---------- */
.va-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
}

.va-quick-btn {
  background: none;
  border: 1px solid var(--gray-200, #E5E7EB);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--charcoal, #1F2937);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.va-quick-btn:hover {
  background: var(--gray-50, #FAFAFA);
  border-color: var(--accent, #F97316);
  color: var(--accent, #F97316);
}

/* ---------- Input Area ---------- */
.va-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200, #E5E7EB);
}

.va-chat-input input {
  flex: 1;
  border: 1px solid var(--gray-200, #E5E7EB);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  outline: none;
  font-family: inherit;
}

.va-chat-input input:focus {
  border-color: var(--accent, #F97316);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.va-chat-input button {
  background: var(--accent, #F97316);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.15s;
  white-space: nowrap;
}

.va-chat-input button:hover {
  background: var(--accent-hover, #EA580C);
}

.va-chat-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .va-chat-panel {
    right: 8px;
    left: 8px;
    bottom: 88px;
    width: auto;
    max-height: 70vh;
  }

  .va-chat-bubble {
    bottom: 16px;
    right: 16px;
  }
}
