/**
 * WhatsApp Floating Button Styles
 * D O'BRIEN ELECTRICAL LIMITED
 */

.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #25d366; /* Official WhatsApp green */
  color: var(--white);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8) translateY(20px);
}

.whatsapp-float.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.whatsapp-float.scrolling-down {
  transform: scale(0.8) translateY(80px);
  opacity: 0;
}

/* Hover effects */
.whatsapp-float:hover {
  background: #128c7e; /* Darker WhatsApp green */
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
  transform: scale(1.1) translateY(-5px);
}

.whatsapp-float:active {
  transform: scale(0.95) translateY(0);
}

/* Pulse animation */
.whatsapp-float::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid #25d366;
  animation: whatsapp-pulse 2s infinite;
  opacity: 0;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Tooltip */
.whatsapp-tooltip {
  position: absolute;
  right: 75px;
  background: var(--primary-black);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px var(--shadow);
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid var(--primary-black);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Focus state for accessibility */
.whatsapp-float:focus {
  outline: 3px solid var(--accent-gold);
  outline-offset: 4px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .whatsapp-tooltip {
    display: none; /* Hide tooltip on mobile to avoid clutter */
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .whatsapp-float {
    width: 58px;
    height: 58px;
    font-size: 30px;
  }
}

/* Print styles - hide button when printing */
@media print {
  .whatsapp-float {
    display: none;
  }
}
