/* ═══════════════════════════════════════════════════════════════
   SHAKHILE SPIRITUAL WISDOM — WhatsApp High-Conversion System
   ▸ Smart Auto Triggers  ▸ Multi-Step Chat Launcher
   ▸ Trust Indicators     ▸ Mobile-Optimised Widget
   ▸ Brand: Dark Charcoal + Gold Accent
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS TOKENS ─────────────────────────────────────────────── */
:root {
  --wa-bg:            #1c1c1f;
  --wa-bg-deep:       #111114;
  --wa-gold:          #d4af37;
  --wa-gold-glow:     rgba(212, 175, 55, 0.35);
  --wa-gold-border:   rgba(212, 175, 55, 0.25);
  --wa-green:         #25d366;
  --wa-green-dark:    #1da851;
  --wa-text:          #eaeaea;
  --wa-muted:         #a0a0a5;
  --wa-radius:        16px;
  --wa-shadow:        0 20px 60px rgba(0,0,0,0.6);
  --wa-transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --wa-z-widget:      99990;
  --wa-z-overlay:     99991;
  --wa-z-modal:       99992;
  --wa-z-invite:      99993;
}

/* ── STICKY WIDGET (mobile bottom / desktop side) ───────────── */
#wa-widget {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: var(--wa-z-widget);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none; /* children re-enable */
}

/* WhatsApp main button */
#wa-fab {
  pointer-events: all;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366 0%, #128c4c 100%);
  border: 3px solid rgba(37, 211, 102, 0.4);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--wa-transition);
  position: relative;
  text-decoration: none;
}
#wa-fab svg {
  width: 30px;
  height: 30px;
  fill: #fff;
  flex-shrink: 0;
}
#wa-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 40px rgba(37, 211, 102, 0.55), 0 0 0 8px rgba(37, 211, 102, 0.15);
}

#wa-fab .wa-tooltip {
  position: absolute;
  right: 78px;
  background: var(--wa-bg);
  color: var(--wa-text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid var(--wa-gold-border);
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: var(--wa-transition);
}

#wa-fab:hover .wa-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Pulse ring animation */
#wa-fab::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: wa-pulse 2.4s ease-out infinite;
}
#wa-fab::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.3);
  animation: wa-pulse 2.4s ease-out infinite 0.6s;
}

@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── PHONE CALL FAB ────────────────────────────────────────── */
#wa-phone-fab {
  pointer-events: all;
  position: relative;           /* needed for ::before pulse ring */
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #a07c1a 100%);
  border: 2px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--wa-transition);
  text-decoration: none;
  color: #111 !important;
  font-size: 20px;
}
#wa-phone-fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 10px 32px rgba(212, 175, 55, 0.55);
  color: #111 !important;
  text-decoration: none;
}

#wa-phone-fab .phone-tooltip {
  position: absolute;
  right: 68px;
  background: var(--wa-bg);
  color: var(--wa-text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid var(--wa-gold-border);
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: var(--wa-transition);
}

#wa-phone-fab:hover .phone-tooltip {
  opacity: 1;
  transform: translateX(0);
}
#wa-phone-fab::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.5);
  animation: wa-phone-pulse 2.8s ease-out infinite;
}
@keyframes wa-phone-pulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ── TAWK.TO DIRECT COUNSEL FAB ───────────────────────────── */
#tawk-trigger-fab {
  pointer-events: all;
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--wa-bg-deep); /* Charcoal base */
  border: 1px solid var(--wa-gold);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 10px rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--wa-transition);
  color: var(--wa-gold) !important;
  font-size: 18px;
  text-decoration: none;
}

#tawk-trigger-fab:hover {
  transform: scale(1.1) translateY(-2px);
  background: var(--wa-gold);
  color: var(--wa-bg-deep) !important;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

#tawk-trigger-fab .tawk-tooltip {
  position: absolute;
  right: 68px;
  background: var(--wa-bg);
  color: var(--wa-text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid var(--wa-gold-border);
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: var(--wa-transition);
}

#tawk-trigger-fab:hover .tawk-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Hide default Tawk.to bubble */
.tawk-minimized {
  display: none !important;
}


/* Unread badge */
#wa-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--wa-gold);
  color: var(--wa-bg-deep);
  font-size: 11px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  line-height: 20px;
  text-align: center;
  border: 2px solid var(--wa-bg);
  display: none;
  animation: wa-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
#wa-badge.show {
  display: block;
}
@keyframes wa-badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* Trust label beside button */
#wa-trust-label {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  opacity: 0;
  transform: translateX(10px);
  transition: var(--wa-transition);
}
#wa-trust-label.visible {
  opacity: 1;
  transform: translateX(0);
}
.wa-trust-pill {
  background: rgba(17, 17, 20, 0.92);
  border: 1px solid var(--wa-gold-border);
  border-radius: 100px;
  padding: 4px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--wa-muted);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.wa-trust-pill i {
  color: var(--wa-gold);
  font-size: 0.65rem;
}

/* ── INVITE TOOLTIP (auto-trigger popup) ────────────────────── */
#wa-invite {
  pointer-events: all;
  position: fixed;
  bottom: 108px;
  right: 24px;
  z-index: var(--wa-z-invite);
  background: var(--wa-bg);
  border: 1px solid var(--wa-gold-border);
  border-radius: var(--wa-radius);
  padding: 18px 20px 14px;
  max-width: 300px;
  box-shadow: var(--wa-shadow);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#wa-invite.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
#wa-invite::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  background: var(--wa-bg);
  border-right: 1px solid var(--wa-gold-border);
  border-bottom: 1px solid var(--wa-gold-border);
  transform: rotate(45deg);
}
#wa-invite-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-muted);
  font-size: 12px;
  transition: var(--wa-transition);
  padding: 0;
  line-height: 1;
}
#wa-invite-close:hover {
  background: rgba(212,175,55,0.15);
  color: var(--wa-gold);
}
.wa-invite-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 24px;
}
.wa-invite-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c4c);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-invite-avatar svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.wa-invite-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--wa-text);
  margin: 0;
  line-height: 1.2;
}
.wa-invite-status {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: #25d366;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.wa-invite-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25d366;
  display: inline-block;
  animation: wa-blink 1.5s ease-in-out infinite;
}
@keyframes wa-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.wa-invite-message {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--wa-muted);
  line-height: 1.5;
  margin: 0 0 14px;
}
.wa-invite-message strong {
  color: var(--wa-text);
}
.wa-invite-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #25d366 0%, #128c4c 100%);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--wa-transition);
}
.wa-invite-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  color: #fff;
  text-decoration: none;
}
.wa-invite-disclaimer {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--wa-muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* ── MODAL OVERLAY ──────────────────────────────────────────── */
#wa-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--wa-z-overlay);
  background: rgba(8, 8, 10, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#wa-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── MULTI-STEP CHAT LAUNCHER MODAL ─────────────────────────── */
#wa-modal {
  position: fixed;
  bottom: 108px;
  right: 24px;
  z-index: var(--wa-z-modal);
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--wa-bg);
  border: 1px solid var(--wa-gold-border);
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#wa-modal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Modal header */
.wa-modal-header {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.wa-modal-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}
.wa-modal-avatar svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}
.wa-modal-title {
  flex: 1;
}
.wa-modal-title h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff !important;
  margin: 0 0 3px;
  line-height: 1.2;
}
.wa-modal-title p {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wa-modal-title p::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25d366;
  display: inline-block;
  flex-shrink: 0;
  animation: wa-blink 1.5s ease-in-out infinite;
}
.wa-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--wa-transition);
  padding: 0;
  line-height: 1;
}
.wa-modal-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Modal body */
.wa-modal-body {
  padding: 20px;
}
.wa-modal-question {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--wa-text);
  margin: 0 0 14px;
  letter-spacing: 0.2px;
}

/* Choice buttons */
.wa-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--wa-transition);
  text-decoration: none;
  width: 100%;
  text-align: left;
}
.wa-choice-btn:hover,
.wa-choice-btn:focus {
  background: rgba(212,175,55,0.08);
  border-color: var(--wa-gold-border);
  transform: translateX(4px);
  outline: none;
  text-decoration: none;
}
.wa-choice-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(212,175,55,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  color: var(--wa-gold);
  transition: var(--wa-transition);
}
.wa-choice-btn:hover .wa-choice-icon {
  background: var(--wa-gold);
  color: var(--wa-bg-deep);
}
.wa-choice-text {
  flex: 1;
}
.wa-choice-text strong {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--wa-text) !important;
  margin-bottom: 2px;
  line-height: 1.2;
}
.wa-choice-text span {
  font-family: 'Inter', sans-serif;
  font-size: 0.73rem;
  color: var(--wa-muted);
  line-height: 1.3;
}
.wa-choice-arrow {
  color: var(--wa-muted);
  font-size: 12px;
  transition: var(--wa-transition);
}
.wa-choice-btn:hover .wa-choice-arrow {
  color: var(--wa-gold);
  transform: translateX(4px);
}

/* Trust footer in modal */
.wa-modal-trust {
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: center;
  gap: 20px;
}
.wa-modal-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--wa-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
}
.wa-modal-trust-item i {
  color: var(--wa-gold);
  font-size: 14px;
}

/* ── MOBILE OVERRIDES ────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Widget anchor — sits above the bottom nav safe area */
  #wa-widget {
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    right: 16px;
    left: 16px; /* Span screen width */
    width: calc(100% - 32px);
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }

  /* Larger tap target — 60px minimum for accessibility */
  #wa-fab {
    width: 60px;
    height: 60px;
    /* Extra pulse rings slightly tighter on mobile */
  }
  #wa-fab::before { inset: -5px; }
  #wa-fab::after  { inset: -10px; }

  /* Trust pills hidden — no space on small screens */
  #wa-trust-label { display: none !important; }

  /* Tawk trigger mobile positioning */
  #tawk-trigger-fab .tawk-tooltip {
    right: auto;
    left: 50%;
    bottom: 68px;
    transform: translateX(-50%) translateY(10px);
  }
  #tawk-trigger-fab:hover .tawk-tooltip {
    transform: translateX(-50%) translateY(0);
  }

  /* WhatsApp & Phone tooltip mobile positioning */
  #wa-fab .wa-tooltip,
  #wa-phone-fab .phone-tooltip {
    right: auto;
    left: 50%;
    bottom: 78px;
    transform: translateX(-50%) translateY(10px);
  }
  #wa-fab:hover .wa-tooltip,
  #wa-phone-fab:hover .phone-tooltip {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  
  #wa-phone-fab .phone-tooltip {
    bottom: 68px;
  }

  /* ── Invite tooltip: full-width, above FAB ── */
  #wa-invite {
    left: 12px;
    right: 12px;
    bottom: calc(max(20px, env(safe-area-inset-bottom, 20px)) + 76px);
    max-width: none;
    width: auto;
    border-radius: 12px;
  }

  /* ── Modal: full-width bottom-sheet ── */
  #wa-modal {
    /* Anchor to bottom of viewport */
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);

    /* Slide-up animation for bottom-sheet feel */
    transform: translateY(24px) scale(1) !important;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  }
  #wa-modal.active {
    transform: translateY(0) scale(1) !important;
  }

  /* Modal header gets a drag-handle for bottom-sheet feel */
  .wa-modal-header::before {
    content: '';
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.25);
  }
  .wa-modal-header {
    padding-top: 24px; /* extra room for the drag handle */
    border-radius: 20px 20px 0 0;
  }

  /* Choice buttons — taller tap targets */
  .wa-choice-btn {
    padding: 14px 16px;
    border-radius: 12px;
  }
  .wa-choice-icon {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  /* Trust footer — smaller on mobile */
  .wa-modal-trust {
    gap: 14px;
    padding: 10px 16px 14px;
  }
  .wa-modal-trust-item { font-size: 0.6rem; }
}

/* ── HIDE OLD DUPLICATE FLOATING MENUS ──────────────────────── */
/* We replace the old template buttons with our new system.
   Hide ALL old floating-menu wrappers, floating-btn items,
   and the old owp-floating-bar elements. */
.floating-menu:not(#wa-widget),
.floating-btn,
.btn-whatsapp:not(#wa-fab),
.btn-call,
.owp-floating-bar,
[class*="floating"]:not(#wa-widget):not(#wa-fab):not(#wa-invite):not(#wa-modal):not(.wa-choice-btn):not(.wa-invite-cta):not(.wa-modal-close):not(#tawk-trigger-fab) {
  display: none !important;
}
