/* =======================================
   Come & Enjoy — Widget CSS
   ======================================= */

:root {
  --aba-radius: 16px;
  --aba-shadow: 0 8px 32px rgba(0,0,0,0.18);
  --aba-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --aba-bot-bg: #f0f4f8;
  --aba-user-bg: var(--aba-primary, #0077b6);
  --aba-text: #1a2332;
  --aba-muted: #6b7a8d;
  --aba-border: #e2e8f0;
  --aba-white: #ffffff;
  --aba-link: #0077b6;
  --aba-success: #10b981;
}

/* ═══════════════════════════════════════════
   SPLASH ANIMATION — plays on page load
═══════════════════════════════════════════ */
.aba-splash-container {
  position: fixed !important;
  z-index: 2147483645 !important;
  pointer-events: none;
}
.aba-splash-container.aba-bottom-right { bottom: 14px !important; right: 14px !important; }
.aba-splash-container.aba-bottom-left  { bottom: 14px !important; left: 14px !important; }

.aba-splash-svg {
  width: 96px;
  height: 96px;
  position: absolute;
  bottom: 0; right: 0;
  overflow: visible;
}

.aba-splash-ring {
  transform-origin: 60px 60px;
  transform: scale(0);
  opacity: 0;
}
.aba-ring-1 { animation: aba-ring-out 0.7s cubic-bezier(0.2,0.6,0.4,1) 0.1s forwards; }
.aba-ring-2 { animation: aba-ring-out 0.9s cubic-bezier(0.2,0.6,0.4,1) 0.25s forwards; }
.aba-ring-3 { animation: aba-ring-out 1.1s cubic-bezier(0.2,0.6,0.4,1) 0.4s forwards; }

@keyframes aba-ring-out {
  0%   { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ═══════════════════════════════════════════
   LAUNCHER WRAP — fixed container
═══════════════════════════════════════════ */
.aba-launcher-wrap {
  position: fixed !important;
  z-index: 2147483647 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.aba-launcher-wrap.aba-bottom-right { bottom: 18px !important; right: 16px !important; }
.aba-launcher-wrap.aba-bottom-left  { bottom: 18px !important; left: 16px !important; }

/* ═══════════════════════════════════════════
   LAUNCHER BUTTON
═══════════════════════════════════════════ */
.aba-launcher {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  color: white;
  flex-shrink: 0;
  box-shadow:
    0 0 0 5px rgba(255,255,255,0.95),
    0 8px 28px rgba(0,0,0,0.28),
    0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease;
  animation: aba-launcher-drop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}
.aba-launcher:hover {
  transform: scale(1.12) rotate(-5deg);
  box-shadow: 0 0 0 5px rgba(255,255,255,0.95), 0 14px 40px rgba(0,0,0,0.32);
}
.aba-launcher:active { transform: scale(0.94); }
.aba-launcher svg { width: 32px; height: 32px; position: relative; z-index: 1; }

@keyframes aba-launcher-drop {
  0%   { opacity: 0; transform: scale(0) translateY(-20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Dual pulse rings */
.aba-launcher::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  animation: aba-pulse-a 2.4s ease-out 1.2s infinite;
}
.aba-launcher::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  animation: aba-pulse-a 2.4s ease-out 1.8s infinite;
}
@keyframes aba-pulse-a {
  0%   { transform: scale(1);   opacity: 0.5; }
  80%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ═══════════════════════════════════════════
   CATCHY LABEL — "Chat with us! 🌊"
═══════════════════════════════════════════ */
.aba-launcher-label {
  background: #fff;
  border-radius: 14px;
  padding: 9px 12px 9px 11px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.15),
    0 1px 4px rgba(0,0,0,0.08);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
  cursor: pointer;
  order: -1;
  border: 2px solid rgba(0,180,216,0.18);
  animation: aba-label-pop 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.8s both;
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.15s ease;
  /* Subtle wobble every few seconds */
  animation: aba-label-pop 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.8s both,
             aba-label-wobble 4s ease-in-out 3s infinite;
}
.aba-launcher-label:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

@keyframes aba-label-pop {
  0%   { opacity: 0; transform: scale(0.4) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes aba-label-wobble {
  0%,100% { transform: rotate(0deg); }
  15%     { transform: rotate(-3deg); }
  30%     { transform: rotate(3deg); }
  45%     { transform: rotate(-2deg); }
  60%     { transform: rotate(0deg); }
}

.aba-label-emoji {
  font-size: 22px;
  line-height: 1;
  animation: aba-wave-emoji 1.5s ease-in-out 1.2s 3;
  display: inline-block;
}
@keyframes aba-wave-emoji {
  0%,100% { transform: rotate(0deg); }
  25%     { transform: rotate(-15deg); }
  75%     { transform: rotate(15deg); }
}

.aba-label-inner {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.aba-label-top {
  font-size: 14px;
  font-weight: 800;
  background: linear-gradient(135deg, #0077b6, #00b4d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.aba-label-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: #6b7a8d;
  line-height: 1.2;
}
.aba-label-close-x {
  font-size: 12px;
  color: #aab;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  line-height: 1;
  margin-left: 2px;
  transition: color 0.12s, background 0.12s;
}
.aba-label-close-x:hover { color: #666; background: #f0f0f0; }


/* Chat window */
.aba-chat-window {
  position: fixed;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  border-radius: var(--aba-radius);
  box-shadow: var(--aba-shadow);
  background: var(--aba-white);
  display: flex;
  flex-direction: column;
  z-index: 2147483646 !important;
  overflow: hidden;
  font-family: var(--aba-font);
  animation: aba-slide-up 0.25s ease;
}
.aba-chat-window.aba-bottom-right { bottom: 110px !important; right: 18px !important; }
.aba-chat-window.aba-bottom-left  { bottom: 110px !important; left: 18px !important; }

@keyframes aba-slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.aba-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: white;
  flex-shrink: 0;
}
.aba-header-avatar {
  font-size: 24px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aba-header-info { flex: 1; }
.aba-header-name   { display: block; font-size: 14px; font-weight: 600; }
.aba-header-status { display: block; font-size: 11px; opacity: 0.85; }
.aba-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.8;
  padding: 4px;
  line-height: 1;
}
.aba-close-btn:hover { opacity: 1; }

/* Messages */
.aba-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.aba-messages-inline {
  height: 380px;
  border: 1px solid var(--aba-border);
  border-radius: 12px 12px 0 0;
}

/* Bubbles */
.aba-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.aba-bubble-wrap.aba-user { flex-direction: row-reverse; }

.aba-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--aba-bot-bg);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aba-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--aba-text);
  word-break: break-word;
}
.aba-bubble.aba-bot  {
  background: var(--aba-bot-bg);
  border-bottom-left-radius: 4px;
}
.aba-bubble.aba-user {
  background: var(--aba-user-bg, #0077b6);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.aba-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 14px;
}
.aba-typing span {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  animation: aba-bounce 1.2s infinite;
}
.aba-typing span:nth-child(2) { animation-delay: 0.2s; }
.aba-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aba-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%         { transform: translateY(-6px); }
}

/* Booking link button */
.aba-booking-link-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--aba-success);
  color: white !important;
  border-radius: 24px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s;
  text-align: center;
}
.aba-booking-link-btn:hover { opacity: 0.88; }

/* Quick action buttons */
.aba-quick-actions {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--aba-border);
  background: var(--aba-white);
  flex-shrink: 0;
}
.aba-quick-btn {
  padding: 5px 11px;
  border-radius: 16px;
  border: 1px solid var(--aba-border);
  background: var(--aba-white);
  font-size: 12px;
  color: var(--aba-text);
  cursor: pointer;
  transition: all 0.15s;
}
.aba-quick-btn:hover {
  border-color: var(--aba-link);
  color: var(--aba-link);
  background: #f0f8ff;
}

/* Input area */
.aba-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--aba-border);
  background: var(--aba-white);
  flex-shrink: 0;
}
.aba-input {
  flex: 1;
  border: 1px solid var(--aba-border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: var(--aba-font);
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color 0.2s;
  color: var(--aba-text);
  background: var(--aba-white);
}
.aba-input:focus { border-color: var(--aba-link); }
.aba-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s;
  padding: 0;
}
.aba-send:hover { opacity: 0.85; }
.aba-send svg { width: 16px; height: 16px; }

/* Footer */
.aba-footer {
  text-align: center;
  font-size: 11px;
  color: var(--aba-muted);
  padding: 4px 0 8px;
  flex-shrink: 0;
}
.aba-footer a { color: var(--aba-muted); text-decoration: none; }

/* Inline widget */
.aba-inline-widget {
  border: 1px solid var(--aba-border);
  border-radius: var(--aba-radius);
  overflow: hidden;
  font-family: var(--aba-font);
  max-width: 480px;
  margin: 0 auto;
}

/* Error bubble */
.aba-bubble.aba-error {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #ffd5d5;
}

/* Mobile */
@media (max-width: 480px) {
  .aba-chat-window {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    border-radius: var(--aba-radius) var(--aba-radius) 0 0;
  }
  .aba-launcher-wrap.aba-bottom-right,
  .aba-launcher-wrap.aba-bottom-left {
    bottom: 14px !important;
    right: 14px !important;
    left: auto !important;
  }
  .aba-launcher-wrap.aba-bottom-left {
    left: 14px !important;
    right: auto !important;
  }
}

/* ── Notification dot ── */
.aba-notif-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: aba-pulse 1.5s infinite;
}
@keyframes aba-pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ── Re-engagement popup bubble ── */
.aba-reopen-bubble {
  position: fixed;
  z-index: 2147483645 !important;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 16px 18px;
  width: 240px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: none;
}
.aba-bottom-right .aba-reopen-bubble,
.aba-reopen-bubble.aba-bottom-right {
  bottom: 90px;
  right: 20px;
}
.aba-bottom-left .aba-reopen-bubble,
.aba-reopen-bubble.aba-bottom-left {
  bottom: 90px;
  left: 20px;
}
.aba-reopen-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.aba-reopen-close:hover { color: #333; }
.aba-reopen-bubble p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a2332;
  padding-right: 14px;
}
.aba-reopen-btn {
  width: 100%;
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.aba-reopen-btn:hover { opacity: .88; }
