/* Next-Gen WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  filter: drop-shadow(0 0 30px rgba(37, 211, 102, 0.3));
}

.whatsapp-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 75px;
  background:
    linear-gradient(135deg, #00E676 0%, #00C853 50%, #00B248 100%);
  border-radius: 50%;
  text-decoration: none;
  color: white;
  font-size: 38px;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow:
    0 0 0 0 rgba(0, 230, 118, 0.7),
    0 0 0 0 rgba(0, 230, 118, 0.4),
    0 20px 40px rgba(0, 200, 83, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation:
    float-modern 4s ease-in-out infinite,
    pulse-waves 3s ease-out infinite,
    rotate-glow 8s linear infinite;
  border: none;
  overflow: visible;
}

/* Animated gradient border */
.whatsapp-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      #00E676,
      #00F5FF,
      #00E676,
      #FFD600,
      #00E676);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: spin-border 4s linear infinite;
  filter: blur(8px);
}

/* Inner glow effect */
.whatsapp-btn::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
      rgba(255, 255, 255, 0.5) 0%,
      rgba(255, 255, 255, 0.2) 30%,
      transparent 70%);
  pointer-events: none;
}

/* Magnetic hover effect */
.whatsapp-btn:hover {
  transform: scale(1.25) rotate(10deg);
  box-shadow:
    0 0 0 20px rgba(0, 230, 118, 0.15),
    0 0 0 40px rgba(0, 230, 118, 0.08),
    0 30px 60px rgba(0, 200, 83, 0.4),
    inset 0 2px 8px rgba(255, 255, 255, 0.4);
  filter: brightness(1.2) saturate(1.3);
}

.whatsapp-btn:hover::before {
  opacity: 1;
  inset: -6px;
}

.whatsapp-btn:active {
  transform: scale(1.1) rotate(5deg);
  transition: all 0.2s ease;
}

/* Orbiting particles effect */
.whatsapp-btn i {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: icon-bounce 2s ease-in-out infinite;
}

/* Ultra modern tooltip with glassmorphism */
.whatsapp-tooltip {
  position: absolute;
  right: 95px;
  top: 50%;
  transform: translateY(-50%) translateX(20px) scale(0.9);
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: white;
  padding: 16px 24px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
}

.whatsapp-tooltip::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 12px;
  border-color: transparent transparent transparent rgba(26, 26, 26, 0.85);
  filter: drop-shadow(3px 0 3px rgba(0, 0, 0, 0.2));
}

/* Shine effect on tooltip */
.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg,
      transparent 0%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.whatsapp-btn:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

.whatsapp-btn:hover .whatsapp-tooltip::after {
  transform: translateX(100%);
}

/* Next-gen chat bubble */
.whatsapp-initial-message {
  position: absolute;
  right: 100px;
  top: 50%;
  transform: translateY(-50%) translateX(25px) scale(0.85);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 14px 20px;
  border-radius: 20px 20px 6px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  max-width: 280px;
}

.whatsapp-initial-message::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 10px;
  border-color: transparent transparent transparent #ffffff;
  filter: drop-shadow(2px 0 2px rgba(0, 0, 0, 0.08));
}

/* Animated emoji */
.whatsapp-initial-message::after {
  content: '💬';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  animation: emoji-pulse 1.5s ease-in-out infinite;
}

.whatsapp-initial-message.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
  animation: bounce-in 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Advanced animations */
@keyframes float-modern {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  25% {
    transform: translateY(-8px) rotate(2deg);
  }

  50% {
    transform: translateY(-12px) rotate(0deg);
  }

  75% {
    transform: translateY(-8px) rotate(-2deg);
  }
}

@keyframes pulse-waves {
  0% {
    box-shadow:
      0 0 0 0 rgba(0, 230, 118, 0.7),
      0 0 0 0 rgba(0, 230, 118, 0.4),
      0 20px 40px rgba(0, 200, 83, 0.3);
  }

  50% {
    box-shadow:
      0 0 0 15px rgba(0, 230, 118, 0),
      0 0 0 30px rgba(0, 230, 118, 0),
      0 20px 40px rgba(0, 200, 83, 0.3);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(0, 230, 118, 0),
      0 0 0 0 rgba(0, 230, 118, 0),
      0 20px 40px rgba(0, 200, 83, 0.3);
  }
}

@keyframes spin-border {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes rotate-glow {

  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(37, 211, 102, 0.3)) hue-rotate(0deg);
  }

  50% {
    filter: drop-shadow(0 0 30px rgba(37, 211, 102, 0.5)) hue-rotate(30deg);
  }
}

@keyframes icon-bounce {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(40px) scale(0.7) rotate(-5deg);
  }

  60% {
    transform: translateY(-50%) translateX(-8px) scale(1.1) rotate(2deg);
  }

  100% {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1) rotate(0deg);
  }
}

@keyframes emoji-pulse {

  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }

  50% {
    transform: translateY(-50%) scale(1.2);
  }
}

/* Typing indicator dots */
@keyframes typing-dot {

  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
  }

  .whatsapp-btn {
    width: 68px;
    height: 68px;
    font-size: 32px;
  }

  .whatsapp-tooltip,
  .whatsapp-initial-message {
    display: none;
  }
}

@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 15px;
    right: 15px;
  }

  .whatsapp-btn {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .whatsapp-initial-message {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: #ffffff;
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .whatsapp-initial-message::before {
    border-color: transparent transparent transparent #2d2d2d;
  }
}

/* Accessibility */
.whatsapp-btn:focus-visible {
  outline: 3px solid rgba(0, 230, 118, 0.6);
  outline-offset: 6px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .whatsapp-btn,
  .whatsapp-btn::before,
  .whatsapp-btn i,
  .whatsapp-tooltip,
  .whatsapp-initial-message {
    animation: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
  }
}