@import 'base.css';

/* ── AI Chat Widget ──────────────────────────────────────────────────────── */
.vdx-ai-selector {
  background: #fff;
  border: 1.5px solid var(--vdx-border);
  border-radius: var(--vdx-radius-lg);
  box-shadow: var(--vdx-shadow-lg);
  max-width: 520px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--vdx-font-body);
}

/* Header */
.vdx-ai-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--vdx-green-dark);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.vdx-ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.vdx-ai-avatar svg { width: 44px; height: 44px; }
.vdx-ai-info strong { display: block; color: #fff; font-size: 15px; font-weight: 700; }
.vdx-ai-status { font-size: 12px; color: #a5d6a7; }

/* Messages */
.vdx-ai-messages {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 400px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--vdx-cream);
}
.vdx-ai-messages::-webkit-scrollbar { width: 4px; }
.vdx-ai-messages::-webkit-scrollbar-track { background: transparent; }
.vdx-ai-messages::-webkit-scrollbar-thumb { background: #c8e6c9; border-radius: 2px; }

.vdx-ai-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: vdx-msg-in .25s ease;
}
@keyframes vdx-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vdx-ai-message--bot  { align-self: flex-start; }
.vdx-ai-message--user { align-self: flex-end; }

.vdx-ai-message p {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.vdx-ai-message--bot  p { background: #fff; color: var(--vdx-text); border-bottom-left-radius: 4px; border: 1px solid var(--vdx-border); }
.vdx-ai-message--user p { background: var(--vdx-green); color: #fff; border-bottom-right-radius: 4px; }

/* Typing indicator */
.vdx-ai-typing p {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 52px;
}
.vdx-ai-typing-dot {
  width: 7px; height: 7px;
  background: var(--vdx-text-muted);
  border-radius: 50%;
  animation: vdx-bounce .9s infinite;
  display: inline-block;
}
.vdx-ai-typing-dot:nth-child(2) { animation-delay: .2s; }
.vdx-ai-typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes vdx-bounce {
  0%, 80%, 100% { transform: scale(.8); opacity: .5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Quick replies */
.vdx-ai-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vdx-ai-quick {
  font-family: var(--vdx-font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--vdx-green);
  background: var(--vdx-green-light);
  border: 1.5px solid #c8e6c9;
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--vdx-transition);
}
.vdx-ai-quick:hover { background: var(--vdx-green); color: #fff; border-color: var(--vdx-green); }

/* Product cards in chat */
.vdx-ai-product-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.vdx-ai-product-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--vdx-green-light);
  border: 1px solid #c8e6c9;
  border-radius: var(--vdx-radius-sm);
  padding: 10px 14px;
  text-decoration: none;
  color: var(--vdx-green-dark);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--vdx-transition);
}
.vdx-ai-product-link:hover { background: #c8e6c9; }

/* Input area */
.vdx-ai-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--vdx-border);
  background: #fff;
}
.vdx-ai-input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--vdx-border);
  border-radius: 50px;
  font-family: var(--vdx-font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--vdx-transition);
}
.vdx-ai-input:focus { border-color: var(--vdx-green); }
.vdx-ai-send {
  width: 42px; height: 42px;
  background: var(--vdx-green);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--vdx-transition);
}
.vdx-ai-send:hover { background: var(--vdx-green-dark); }
.vdx-ai-send:disabled { background: #ccc; cursor: not-allowed; }
