/* ──────────────────────────────────────────────────────────────────────── */
/* STYLESHEET: WhatsApp FAB (Floating Action Button) & Chat Panel          */
/* Version: 1.0 | Last Updated: June 2026                                  */
/* ──────────────────────────────────────────────────────────────────────── */

/* =============================================================================
   1. ANIMATIONS
   ============================================================================= */

/* Pulsing animation for FAB indicator dot */
@keyframes waPing {
  0% {
    transform: scale(1);
    opacity: 0.4;
  }
  75% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Status indicator pulse effect */
@keyframes wa-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(76, 175, 80, 0);
  }
}

/* Loading dots blinking animation */
@keyframes wa-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

/* =============================================================================
   2. FAB BUTTON (Floating Action Button)
   ============================================================================= */

/* FAB wrapper container (fixed position) */
.wa-fab-wrapper {
  position: fixed;
  display: block !important;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
}

/* Main FAB button styling */
.wa-btn {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 15px 35px -10px rgba(37, 211, 102, 0.6);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  border: none;
  padding: 0;
  font-family: inherit;
}

.wa-btn:hover {
  transform: scale(1.05);
}

/* FAB button icon */
.wa-btn-icon {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
}

/* Pulsing ring animation for FAB */
.wa-ping {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #25d366;
  animation: waPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.4;
  pointer-events: none;
}

/* =============================================================================
   3. CHAT PANEL
   ============================================================================= */

/* Panel container */
.wa-panel {
  position: absolute;
  display: block;
  bottom: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transform-origin: bottom right;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s;
  z-index: 999;
}

/* Hidden state for panel */
.wa-panel.hidden {
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  pointer-events: none;
  visibility: hidden;
}

/* =============================================================================
   4. PANEL HEADER
   ============================================================================= */

/* Header container */
.wa-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: #075e54;
  color: #fff;
}

/* Avatar circle for contact */
.wa-panel-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-panel-avatar svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

/* Contact info section */
.wa-panel-info {
  flex: 1;
  min-width: 0;
}

/* Contact name */
.wa-panel-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: #fff;
  font-family: inherit;
}

/* Contact status (online/offline) */
.wa-panel-status {
  font-size: 0.73rem;
  margin: 0;
  color: #b2dfdb;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

/* Status indicator dot */
.wa-status-dot {
  width: 7px;
  height: 7px;
  background: #4caf50;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
  animation: wa-pulse 2s infinite;
  flex-shrink: 0;
}

/* Close button */
.wa-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 0;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-panel-close:hover {
  color: #fff;
}

.wa-panel-close svg {
  width: 18px;
  height: 18px;
}

/* =============================================================================
   5. PANEL BODY
   ============================================================================= */

/* Body container */
.wa-panel-body {
  padding: 1.1rem 1.1rem 1.1rem;
}

/* Greeting message */
.wa-panel-greeting {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  line-height: 1.3;
  color: #333;
}

/* Subtitle message */
.wa-panel-sub {
  font-size: 0.8rem;
  color: #777;
  margin: 0 0 0.85rem;
}

/* =============================================================================
   6. LOADING STATE
   ============================================================================= */

/* Loading indicator container */
.wa-loading {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.5rem 0;
  justify-content: center;
}

/* Individual loading dot */
.wa-loading-dot {
  width: 7px;
  height: 7px;
  background: #ccc;
  border-radius: 50%;
  animation: wa-blink 1.2s infinite;
}

.wa-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.wa-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* =============================================================================
   7. QUICK REPLY BUTTONS
   ============================================================================= */

/* Container for quick action buttons */
.wa-quick-btns {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

/* Individual quick reply button */
.wa-quick-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  background: #f0faf4;
  border: 1.5px solid #c8e6c9;
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  color: #1b5e20;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
  line-height: 1.3;
  font-family: inherit;
  font-weight: 500;
}

.wa-quick-btn:hover {
  background: #e0f5e9;
  border-color: #25d366;
  transform: translateX(3px);
}

/* Icon inside quick button */
.wa-quick-btn-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-quick-btn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* =============================================================================
   8. INPUT AREA
   ============================================================================= */

/* Input row container (textarea + send button) */
.wa-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 0.5rem;
}

/* Message textarea */
.wa-textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  line-height: 1.4;
  color: #222;
  outline: none;
  transition: border-color 0.15s;
}

.wa-textarea:focus {
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.wa-textarea::placeholder {
  color: #aaa;
}

/* Send button */
.wa-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #25d366;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    transform 0.1s,
    opacity 0.15s;
  color: #fff;
  padding: 0;
  font-family: inherit;
}

.wa-send-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.wa-send-btn:not(:disabled):hover {
  background: #1ebe5a;
  transform: scale(1.07);
}

.wa-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Input helper text */
.wa-input-hint {
  font-size: 0.7rem;
  color: #bbb;
  margin: 0.4rem 0 0;
  text-align: right;
}

/* =============================================================================
   END OF STYLESHEET
   ============================================================================= */
