/* ══════════════════════════════════════════════════════════════════
   SYNTHERION SOLUTIONS — FLOATING WHATSAPP CHAT WIDGET
   Inspired by modern reference models (syntherionsolutions_design)
   ══════════════════════════════════════════════════════════════════ */

:root {
  --wa-primary: #25D366;
  --wa-dark: #128C7E;
  --wa-darker: #075E54;
  --wa-light: #dcf8c6;
  --wa-bg: #0b141a;
  --wa-card-bg: #111b21;
  --wa-bubble-in: #202c33;
  --wa-text: #e9edef;
  --wa-muted: #8696a0;
  --wa-border: rgba(255, 255, 255, 0.08);
}

.wa-widget-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 999999 !important;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  pointer-events: auto !important;
}

/* ── Floating Main Button ── */
.wa-toggle-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.wa-toggle-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.55), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.wa-toggle-btn:active {
  transform: scale(0.95);
}

/* Icons inside toggle */
.wa-icon-svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.wa-close-svg {
  position: absolute;
  width: 26px;
  height: 26px;
  fill: #ffffff;
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.wa-widget-container.active .wa-icon-svg {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.wa-widget-container.active .wa-close-svg {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ── Pulse Rings ── */
.wa-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0.8;
  animation: waPulseRing 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

.wa-pulse-ring-2 {
  animation-delay: 1.2s;
}

@keyframes waPulseRing {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.wa-widget-container.active .wa-pulse-ring {
  display: none;
}

/* ── Unread Badge ── */
.wa-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0b141a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  animation: waBadgeBounce 2s ease infinite;
}

@keyframes waBadgeBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.wa-widget-container.active .wa-badge {
  display: none;
}

/* ── Floating Tooltip Bubble (Auto-shows initially) ── */
.wa-tooltip-bubble {
  position: absolute;
  bottom: 74px;
  right: 0;
  background: #1f2c34;
  color: #e9edef;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-tooltip-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wa-tooltip-bubble .wa-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 8px #25D366;
}

.wa-tooltip-close {
  background: none;
  border: none;
  color: #8696a0;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
}
.wa-tooltip-close:hover { color: #fff; }

.wa-widget-container.active .wa-tooltip-bubble {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Expandable Interactive Chat Card ── */
.wa-chat-card {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 32px);
  background: var(--wa-card-bg);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--wa-border);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.92);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-widget-container.active .wa-chat-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Card Header */
.wa-card-header {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  position: relative;
}

.wa-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.wa-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.wa-avatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.wa-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: #25D366;
  border: 2px solid #075E54;
  border-radius: 50%;
}

.wa-header-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-header-info h4 svg {
  width: 15px;
  height: 15px;
  fill: #25D366;
}

.wa-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Card Body */
.wa-card-body {
  padding: 18px 16px;
  background: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
}

/* Incoming Message Bubble */
.wa-msg-bubble {
  background: #202c33;
  color: var(--wa-text);
  padding: 12px 14px;
  border-radius: 4px 16px 16px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
}

.wa-msg-bubble .wa-msg-author {
  font-size: 11px;
  font-weight: 700;
  color: #25D366;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wa-msg-bubble .wa-msg-time {
  font-size: 10px;
  color: var(--wa-muted);
  text-align: right;
  margin-top: 4px;
}

/* Quick Action Chips */
.wa-quick-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wa-muted);
  margin-top: 4px;
}

.wa-quick-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wa-quick-btn {
  background: #182229;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--wa-text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.wa-quick-btn:hover {
  background: #202c33;
  border-color: #25D366;
  color: #25D366;
  transform: translateX(3px);
}

.wa-quick-btn span.icon {
  font-size: 15px;
}

/* Card Footer / Custom Input Area */
.wa-card-footer {
  padding: 12px 14px;
  background: #111b21;
  border-top: 1px solid var(--wa-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-input-field {
  flex: 1;
  background: #202c33;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 9px 14px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.wa-input-field:focus {
  border-color: #25D366;
}

.wa-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, background-color 0.2s;
}

.wa-send-btn:hover {
  background: #1ebe5d;
  transform: scale(1.08);
}

.wa-send-btn svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
  margin-left: 2px;
}

/* ── Mobile Responsive Adjustments ── */
@media (max-width: 480px) {
  .wa-widget-container {
    bottom: 16px !important;
    right: 16px !important;
  }
  
  .wa-toggle-btn {
    width: 54px !important;
    height: 54px !important;
  }
  
  .wa-icon-svg {
    width: 28px !important;
    height: 28px !important;
  }
  
  .wa-chat-card {
    width: calc(100vw - 32px) !important;
    max-width: 360px !important;
    right: 0 !important;
    bottom: 68px !important;
    max-height: calc(100vh - 90px) !important;
    border-radius: 18px !important;
  }

  .wa-card-body {
    max-height: calc(100vh - 220px) !important;
    -webkit-overflow-scrolling: touch;
  }

  .wa-tooltip-bubble {
    right: 0 !important;
    bottom: 68px !important;
    max-width: calc(100vw - 40px) !important;
    white-space: normal !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
}

