/* WooCommerce AI Chat - Styles */
:root {
  --wac-primary: #2563eb;
  --wac-primary-dark: #1d4ed8;
  --wac-bg: #ffffff;
  --wac-surface: #f8fafc;
  --wac-border: #e2e8f0;
  --wac-text: #1e293b;
  --wac-text-muted: #64748b;
  --wac-radius: 16px;
  --wac-shadow: 0 20px 60px rgba(0,0,0,.15), 0 4px 16px rgba(0,0,0,.08);
  --wac-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wac-w: 380px;
  --wac-h: 560px;
}

/* Root container */
#wac-chat-root {
  position: fixed;
  z-index: 99999;
  font-family: var(--wac-font);
}
#wac-chat-root.wac-pos-bottom-right { bottom: 24px; right: 24px; }
#wac-chat-root.wac-pos-bottom-left  { bottom: 24px; left: 24px; }

/* Intro popup card (deasupra butonului) */
#wac-intro-popup {
  position: absolute;
  bottom: 74px;
  width: 280px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
  padding: 16px 16px 14px;
  animation: wacSlideIn .25s ease-out;
  border: 1px solid rgba(0,0,0,.07);
}
.wac-pos-bottom-right #wac-intro-popup { right: 0; }
.wac-pos-bottom-left  #wac-intro-popup { left: 0; }

#wac-intro-popup::after {
  content: '';
  position: absolute;
  bottom: -8px;
  width: 16px; height: 16px;
  background: #fff;
  border-right: 1px solid rgba(0,0,0,.07);
  border-bottom: 1px solid rgba(0,0,0,.07);
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,.05);
}
.wac-pos-bottom-right #wac-intro-popup::after { right: 28px; }
.wac-pos-bottom-left  #wac-intro-popup::after { left: 28px; }

#wac-intro-close {
  position: absolute;
  top: 8px; right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color .15s;
}
#wac-intro-close:hover { color: #475569; }

.wac-intro-body {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.wac-intro-icon {
  width: 42px; height: 42px;
  background: var(--wac-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.wac-intro-text { flex: 1; padding-right: 14px; }
.wac-intro-title {
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  margin: 0 0 5px;
}
.wac-intro-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 12px;
}
.wac-intro-cta {
  display: block;
  width: 100%;
  background: var(--wac-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s, transform .1s;
  font-family: var(--wac-font);
}
.wac-intro-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Toggle button */
#wac-toggle-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wac-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  transition: transform .2s, box-shadow .2s, filter .2s;
  position: relative;
  margin-left: auto;
}
#wac-toggle-btn:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,.3);
}
#wac-toggle-btn:active { transform: scale(.96); }

#wac-unread-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Chat window */
#wac-chat-window {
  position: absolute;
  bottom: 70px;
  width: var(--wac-w);
  height: var(--wac-h);
  background: var(--wac-bg);
  border-radius: var(--wac-radius);
  box-shadow: var(--wac-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--wac-border);
  animation: wacSlideIn .22s ease-out;
}
.wac-pos-bottom-right #wac-chat-window { right: 0; }
.wac-pos-bottom-left  #wac-chat-window { left: 0; }

@keyframes wacSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.wac-header {
  background: var(--wac-primary);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  flex-shrink: 0;
}
.wac-header-info { display: flex; align-items: center; gap: 10px; }
.wac-avatar {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.wac-header-title { font-weight: 600; font-size: 15px; }
.wac-status { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.wac-dot {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: wacPulse 2s infinite;
}
@keyframes wacPulse {
  0%,100% { opacity: 1; }
  50% { opacity: .4; }
}
#wac-clear-btn {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  transition: background .15s;
}
#wac-clear-btn:hover { background: rgba(255,255,255,.25); }

/* Auth panel */
#wac-auth-panel {
  padding: 14px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  flex-shrink: 0;
}
.wac-auth-hint { margin: 0 0 10px; font-size: 13px; color: #92400e; }
.wac-auth-form { display: flex; flex-direction: column; gap: 7px; }
.wac-auth-form input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  font-family: var(--wac-font);
}
.wac-auth-form input:focus { border-color: var(--wac-primary); }
#wac-verify-btn {
  background: var(--wac-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  transition: background .15s;
}
#wac-verify-btn:hover { background: var(--wac-primary-dark); }
#wac-verify-btn:disabled { opacity: .6; cursor: not-allowed; }
.wac-skip-auth {
  background: none;
  border: none;
  color: var(--wac-text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 0 0;
  text-decoration: underline;
}
.wac-skip-auth:hover { color: var(--wac-text); }

/* Auth success banner */
#wac-auth-success {
  padding: 8px 16px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  flex-shrink: 0;
}

/* Messages */
#wac-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#wac-messages::-webkit-scrollbar { width: 4px; }
#wac-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.wac-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
  animation: wacMsgIn .18s ease-out;
}
@keyframes wacMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wac-msg.wac-user  { align-self: flex-end; flex-direction: row-reverse; }
.wac-msg.wac-bot   { align-self: flex-start; }

.wac-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.wac-bot .wac-msg-avatar  { background: #eff6ff; }
.wac-user .wac-msg-avatar { background: var(--wac-primary); font-size: 12px; color: #fff; font-weight: 700; }

.wac-msg-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--wac-text);
  word-break: break-word;
}
.wac-bot .wac-msg-bubble {
  background: var(--wac-surface);
  border: 1px solid var(--wac-border);
  border-bottom-left-radius: 4px;
}
.wac-user .wac-msg-bubble {
  background: var(--wac-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.wac-msg-time {
  font-size: 11px;
  color: var(--wac-text-muted);
  margin-top: 4px;
  text-align: right;
}
.wac-user .wac-msg-time { color: rgba(255,255,255,.7); }

/* Typing indicator */
#wac-typing {
  padding: 10px 14px;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}
#wac-typing span {
  width: 7px; height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: wacBounce 1.3s infinite;
}
#wac-typing span:nth-child(2) { animation-delay: .15s; }
#wac-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wacBounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Quick suggestions */
#wac-suggestions {
  padding: 6px 10px 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  border-top: 1px solid var(--wac-border);
}
.wac-chip {
  background: var(--wac-surface);
  border: 1px solid var(--wac-border);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  color: var(--wac-text);
  white-space: nowrap;
  font-family: var(--wac-font);
}
.wac-chip:hover {
  background: #eff6ff;
  border-color: var(--wac-primary);
  color: var(--wac-primary);
}

/* Input row */
.wac-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--wac-border);
  background: var(--wac-bg);
  flex-shrink: 0;
}
#wac-input {
  flex: 1;
  border: 1.5px solid var(--wac-border);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 14px;
  font-family: var(--wac-font);
  resize: none;
  outline: none;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color .15s;
  color: var(--wac-text);
  line-height: 1.45;
}
#wac-input:focus { border-color: var(--wac-primary); }
#wac-input::placeholder { color: #94a3b8; }

#wac-send-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--wac-primary);
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
#wac-send-btn:hover:not(:disabled) { background: var(--wac-primary-dark); transform: scale(1.05); }
#wac-send-btn:disabled { background: #cbd5e1; cursor: not-allowed; }

#wac-send-btn svg {
    position: absolute;
}
/* Error message */
.wac-error-bubble {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #991b1b !important;
}

/* Responsive */
@media (max-width: 440px) {
  #wac-chat-window {
    width: calc(100vw - 32px);
    height: calc(100dvh - 110px);
    bottom: 70px;
  }
  .wac-pos-bottom-right #wac-chat-window { right: 0; }
  .wac-pos-bottom-left  #wac-chat-window { left: 0; }
}
