/* ==========================================================================
   Lokality Design System - WhatsApp Intent Launcher FAB & Modal
   ========================================================================== */

/* WhatsApp FAB Button */
.wa-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 12px;
}

.wa-fab-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--wa-green);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-wa);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
}

.wa-fab-btn:hover {
  transform: scale(1.08);
  background: var(--wa-green-hover);
}

.wa-fab-icon {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* Pulsing radar waves behind FAB */
.wa-fab-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--wa-green);
  animation: fab-pulse 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes fab-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* FAB Floating Label / Pill */
.wa-fab-pill {
  background: #FFFFFF;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slide-pill 0.4s ease-out;
}

.wa-fab-pill-dot {
  width: 8px;
  height: 8px;
  background: var(--wa-green);
  border-radius: 50%;
}

/* WhatsApp Intent Sheet / Modal */
.wa-intent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
}

.wa-intent-overlay.open {
  opacity: 1;
  visibility: visible;
}

.wa-intent-modal {
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border-subtle);
}

.wa-intent-overlay.open .wa-intent-modal {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.wa-modal-header {
  background: var(--brand-dark);
  color: #FFFFFF;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--wa-green);
}

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

.wa-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wa-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.wa-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.wa-header-status {
  font-size: 0.75rem;
  color: #86EFAC;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-header-status-dot {
  width: 6px;
  height: 6px;
  background: #86EFAC;
  border-radius: 50%;
}

.wa-close-btn {
  color: #94A3B8;
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.wa-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* Modal Body */
.wa-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 75vh;
  overflow-y: auto;
}

.wa-intent-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Intent Choice Pills / Cards */
.wa-intent-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wa-intent-opt {
  background: #F8FAFC;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.wa-intent-opt:hover {
  background: #F1F5F9;
  border-color: var(--text-muted);
}

.wa-intent-opt.active {
  background: var(--brand-green-subtle);
  border-color: var(--brand-green);
  color: var(--brand-green);
}

/* Custom Details Input */
.wa-custom-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-custom-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  background: #F8FAFC;
  outline: none;
}

.wa-custom-input:focus {
  border-color: var(--wa-green);
  background: #FFFFFF;
}

/* Message Preview Bubble (WhatsApp Look) */
.wa-preview-bubble-wrapper {
  background: #ECE5DD;
  background-image: radial-gradient(#D1D7DB 10%, transparent 11%);
  background-size: 16px 16px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.wa-preview-bubble {
  background: #FFFFFF;
  border-radius: 8px 8px 8px 0;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #111B21;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
}

.wa-preview-time {
  text-align: right;
  font-size: 0.68rem;
  color: #667781;
  margin-top: 4px;
}

/* Launch Action Button */
.wa-launch-btn {
  background: var(--wa-green);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: all 0.2s;
}

.wa-launch-btn:hover {
  background: var(--wa-green-hover);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .wa-fab-container {
    bottom: 16px;
    right: 16px;
  }
  .wa-intent-overlay {
    padding: 0;
  }
  .wa-intent-modal {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
  }
  .wa-fab-pill {
    display: none;
  }
}
