/* =====================================================
   Waters Edge Chatbot — chatbot.css
   Luxury refined aesthetic · Brand: #2E3192
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=DM+Sans:wght@400;500&display=swap');

:root {
  --we-brand:        #2E3192;
  --we-brand-dark:   #1e2070;
  --we-brand-light:  #eeeffe;
  --we-gold:         #c9a84c;
  --we-white:        #ffffff;
  --we-bg:           #f8f8fc;
  --we-text:         #1a1a2e;
  --we-muted:        #6b6b8a;
  --we-border:       rgba(46,49,146,0.12);
  --we-radius:       18px;
  --we-shadow:       0 24px 60px rgba(20,20,80,0.18), 0 4px 16px rgba(20,20,80,0.08);
  --we-font-display: 'Cormorant Garamond', Georgia, serif;
  --we-font-body:    'DM Sans', sans-serif;
  --we-window-w:     360px;
  --we-window-h:     520px;
}

/* ── Wrapper ── */
#we-chatbot {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999999;
  font-family: var(--we-font-body);
}

/* ── Floating launcher button ── */
#we-chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--we-brand);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 28px rgba(46,49,146,0.38), 0 2px 6px rgba(46,49,146,0.2);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
  position: relative;
  outline: none;
}

#we-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 36px rgba(46,49,146,0.45), 0 4px 10px rgba(46,49,146,0.25);
  background: var(--we-brand-dark);
}

#we-chat-btn:active {
  transform: scale(0.96);
}

/* Pulse ring animation when window is closed */
#we-chat-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(46,49,146,0.35);
  animation: we-pulse 2.4s ease-out infinite;
}

#we-chatbot.we-open #we-chat-btn::before {
  animation: none;
}

@keyframes we-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Notification dot */
#we-notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: var(--we-gold);
  border-radius: 50%;
  border: 2px solid #fff;
  display: block;
}

#we-chatbot.we-open #we-notif-dot {
  display: none;
}

/* ── Chat window ── */
#we-chat-window {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: var(--we-window-w);
  max-height: var(--we-window-h);
  background: var(--we-white);
  border-radius: var(--we-radius);
  box-shadow: var(--we-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(.4,0,.2,1),
              transform 0.3s cubic-bezier(.34,1.4,.64,1);
  border: 1px solid var(--we-border);
}

#we-chatbot.we-open #we-chat-window {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ── */
#we-chat-header {
  background: var(--we-brand);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Subtle water-wave decoration */
#we-chat-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: -10%;
  width: 120%;
  height: 24px;
  background: var(--we-white);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.07;
}

#we-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--we-gold);
  flex-shrink: 0;
  border: 1.5px solid rgba(201,168,76,0.4);
}

#we-chat-header-info {
  flex: 1;
}

#we-chat-name {
  font-family: var(--we-font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

#we-chat-status {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

#we-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(74,222,128,0.25);
}

#we-chat-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

#we-chat-close:hover {
  background: rgba(255,255,255,0.25);
}

/* ── Messages area ── */
#we-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#we-chat-messages::-webkit-scrollbar {
  width: 4px;
}
#we-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#we-chat-messages::-webkit-scrollbar-thumb {
  background: var(--we-border);
  border-radius: 4px;
}

/* ── Message bubbles ── */
.we-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: we-msg-in 0.3s cubic-bezier(.34,1.4,.64,1) both;
}

@keyframes we-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.we-msg.bot  { align-self: flex-start; }
.we-msg.user { align-self: flex-end; }

.we-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
}

.we-msg.bot .we-bubble {
  background: var(--we-bg);
  color: var(--we-text);
  border-radius: 4px 16px 16px 16px;
  border: 1px solid var(--we-border);
}

.we-msg.user .we-bubble {
  background: var(--we-brand);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

.we-msg-label {
  font-size: 10.5px;
  color: var(--we-muted);
  margin-top: 3px;
  padding: 0 4px;
}

.we-msg.user .we-msg-label {
  text-align: right;
}

/* Category badge on bot reply */
.we-category-badge {
  display: inline-block;
  background: var(--we-brand-light);
  color: var(--we-brand);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 50px;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Typing indicator */
.we-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--we-bg);
  border-radius: 4px 16px 16px 16px;
  border: 1px solid var(--we-border);
  width: fit-content;
}

.we-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--we-brand);
  opacity: 0.4;
  animation: we-bounce 1.2s ease-in-out infinite;
}
.we-typing span:nth-child(2) { animation-delay: 0.2s; }
.we-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes we-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: 0.4; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Quick chips — row 1 ── */
#we-chip-row {
  display: flex;
  gap: 6px;
  padding: 8px 14px 4px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
#we-chip-row::-webkit-scrollbar { display: none; }

/* ── Quick chips — row 2 ── */
#we-chip-row-2 {
  display: flex;
  gap: 6px;
  padding: 0 14px 10px;
  flex-shrink: 0;
}

.we-chip {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1.5px solid var(--we-border);
  background: var(--we-bg);
  color: var(--we-brand);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--we-font-body);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  flex-shrink: 0;
}

.we-chip:hover {
  background: var(--we-brand);
  color: #fff;
  border-color: var(--we-brand);
}

/* ── Floating WhatsApp button ── */
#we-wa-float {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 999998;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(37,211,102,0.5), 0 2px 8px rgba(37,211,102,0.3);
  text-decoration: none !important;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease, background 0.2s;
  cursor: pointer;
}

#we-wa-float:hover {
  transform: scale(1.12);
  background: #1ebe5d;
  box-shadow: 0 10px 30px rgba(37,211,102,0.6), 0 4px 12px rgba(37,211,102,0.35);
  text-decoration: none !important;
}

#we-wa-float:active {
  transform: scale(0.95);
}

/* Pulse ring on WhatsApp button */
#we-wa-float::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(37,211,102,0.45);
  animation: we-wa-pulse 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes we-wa-pulse {
  0%   { transform: scale(1);    opacity: 0.9; }
  70%  { transform: scale(1.3);  opacity: 0; }
  100% { transform: scale(1.3);  opacity: 0; }
}

/* Tooltip label */
#we-wa-float::after {
  content: 'Chat on WhatsApp';
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,10,10,0.8);
  color: #fff;
  font-size: 11.5px;
  font-family: var(--we-font-body);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#we-wa-float:hover::after {
  opacity: 1;
}

/* ── Recreational sub-chips ── */
.we-rec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.we-chip.we-rec-sub {
  font-size: 11.5px;
  padding: 4px 11px;
  background: var(--we-brand-light);
  border-color: var(--we-brand);
  color: var(--we-brand);
}

.we-chip.we-rec-sub:hover {
  background: var(--we-brand);
  color: #fff;
  border-color: var(--we-brand);
}

/* ── Mobile responsive ── */
@media (max-width: 480px) {
  #we-chatbot {
    bottom: 16px;
    right: 16px;
  }
  #we-chat-window {
    width: calc(100vw - 32px);
    right: 0;
    bottom: 70px;
    max-height: 70vh;
  }
  #we-chat-btn {
    width: 54px;
    height: 54px;
  }
  #we-wa-float {
    bottom: 88px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
}

/* ── Inline WhatsApp button (under restaurant reply) ── */
.we-inline-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 14px;
  background: #25D366;
  color: #fff !important;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none !important;
  font-family: var(--we-font-body);
  transition: background 0.18s, transform 0.15s;
  width: fit-content;
}

.we-inline-wa:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
  color: #fff !important;
  text-decoration: none !important;
}

.we-inline-wa:active {
  transform: translateY(0);
}

/* ── Input bar ── */
#we-chat-inputbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--we-border);
  flex-shrink: 0;
  background: var(--we-white);
}

#we-chat-input {
  flex: 1;
  border: 1.5px solid var(--we-border);
  border-radius: 50px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: var(--we-font-body);
  color: var(--we-text);
  background: var(--we-bg);
  outline: none;
  transition: border-color 0.2s;
}

#we-chat-input:focus {
  border-color: var(--we-brand);
  background: #fff;
}

#we-chat-input::placeholder {
  color: var(--we-muted);
}

#we-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--we-brand);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

#we-send-btn:hover  { background: var(--we-brand-dark); transform: scale(1.08); }
#we-send-btn:active { transform: scale(0.93); }
