/* ═══════════════════════════════════════════════════
   WHATSAPP FLOATING BUTTON
   ═══════════════════════════════════════════════════ */

.whatsapp-float {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  animation: pulse-whatsapp 2s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
}

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

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.whatsapp-float:hover::before {
  opacity: 0.2;
  animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pulse-whatsapp {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 24px rgba(37, 211, 102, 0.6);
  }
}

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

/* WhatsApp notification badge */
.whatsapp-float .notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #FF0000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border: 2px solid #fff;
  animation: bounce-badge 2s ease-in-out infinite;
}

@keyframes bounce-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Tooltip */
.whatsapp-float .tooltip {
  position: absolute;
  right: 70px;
  background: #ffffff;
  color: #1f1f1f;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(10px);
}

.whatsapp-float .tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 6px;
  border-color: transparent transparent transparent #ffffff;
}

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

/* RTL Support */
body[dir="rtl"] .whatsapp-float {
  left: auto;
  right: 24px;
}

body[dir="rtl"] .whatsapp-float .tooltip {
  right: auto;
  left: 70px;
}

body[dir="rtl"] .whatsapp-float .tooltip::after {
  right: auto;
  left: -6px;
  border-width: 6px 6px 6px 0;
  border-color: transparent #ffffff transparent transparent;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .whatsapp-float {
    width: 56px;
    height: 56px;
    bottom: 20px;
    left: 20px;
  }
  
  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }
  
  .whatsapp-float .tooltip {
    display: none;
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 96px;
  left: 24px;
  width: 48px;
  height: 48px;
  background: var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 103, 184, 0.3);
  z-index: 998;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 103, 184, 0.4);
  background: var(--primary-hover);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

body[dir="rtl"] .back-to-top {
  left: auto;
  right: 24px;
}

@media (max-width: 768px) {
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: 88px;
  }
}
