/* WhatsApp Floating Widget - Official Styles */
:root {
  --wa-primary: #25D366;
  --wa-primary-hover: #1eb956;
  --wa-primary-dark: #128C7E;
  --wa-text: #ffffff;
  --wa-offset-x: 24px;
  --wa-offset-y: 24px;
  --wa-zindex: 999999;
}

/* Container */
.wa-widget-container {
  position: fixed;
  bottom: var(--wa-offset-y);
  right: var(--wa-offset-x);
  z-index: var(--wa-zindex);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.wa-widget-container *,
.wa-widget-container *::before,
.wa-widget-container *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Floating Action Button */
.wa-widget-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 60px; height: 60px; border-radius: 50%;
  background-color: var(--wa-primary);
  color: var(--wa-text);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-decoration: none;
  outline: none;
  user-select: none;
}

.wa-widget-btn:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28), 0 4px 10px rgba(0, 0, 0, 0.18);
  filter: brightness(1.05);
}

.wa-widget-btn:active {
  transform: scale(0.96);
}

.wa-widget-btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-widget-btn-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.wa-widget-btn-text {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Pulse Animation Ring */

.wa-widget-btn::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--wa-primary);
  opacity: 0.8;
  animation: wa-pulse 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes wa-pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}


/* Notification Badge */
.wa-widget-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  height: 20px;
  min-width: 20px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: wa-badge-bounce 3s infinite ease-in-out;
}

@keyframes wa-badge-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  90% { transform: translateY(-3px); }
}

/* Tooltip / Callout */
.wa-widget-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: #111827;
  color: #f9fafb;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s, transform 0.25s;
  animation: wa-float-bob 4s ease-in-out infinite;
}

.wa-widget-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 20px;
  border-width: 6px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
}

@keyframes wa-float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Chat Card Popup */
.wa-chat-popup {
  position: absolute;
  bottom: calc(100% + 16px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
  z-index: 10;
}

.wa-chat-popup.wa-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(12px);
  pointer-events: none;
}

.wa-chat-popup.wa-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Chat Header */
.wa-chat-header {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.wa-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.wa-chat-avatar svg {
  width: 28px;
  height: 28px;
  fill: #128C7E;
}

.wa-chat-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.wa-chat-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 12px;
  height: 12px;
  background-color: #25D366;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.wa-chat-meta h4 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.wa-chat-meta p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 3px;
  line-height: 1.2;
}

.wa-chat-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.wa-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Chat Body */
.wa-chat-body {
  padding: 20px 16px;
  background-color: #EFEAE2;
  background-image: radial-gradient(#d3c8ba 0.75px, transparent 0.75px);
  background-size: 16px 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.wa-chat-bubble {
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 12px;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.45;
  color: #1f2937;
  position: relative;
}

.wa-chat-bubble-time {
  font-size: 10px;
  color: #9ca3af;
  text-align: right;
  margin-top: 6px;
  display: block;
}

/* Chat Footer / Input */
.wa-chat-footer {
  padding: 12px 14px;
  background: #F0F2F5;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #e5e7eb;
}

.wa-chat-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
  color: #111827;
  font-family: inherit;
}

.wa-chat-input:focus {
  border-color: #128C7E;
}

.wa-chat-send-btn {
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
}

.wa-chat-send-btn:hover {
  background: #1eb956;
  transform: scale(1.05);
}

.wa-chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

@media (max-width: 480px) {
  .wa-widget-container {
    bottom: max(var(--wa-offset-y), env(safe-area-inset-bottom, 16px));
    right: 16px;
  }
  .wa-chat-popup {
    width: calc(100vw - 32px);
    right: 0;
  }
}
