/**
 * Floating Action Buttons - Advanced Styles
 * 
 * Features:
 * - Ripple/Wave effect (hiệu ứng lan tỏa)
 * - Bounce animation (hiệu ứng nhảy)
 * - Pulse effect (hiệu ứng nhấp nháy)
 * - Phone ringing animation
 * - Smooth hover interactions
 * - Gradient backgrounds
 * 
 * @package YenSao_Premium
 */

/* ========== FLOATING ACTION BUTTONS CONTAINER ========== */
.floating-actions {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ========== BASE BUTTON STYLES ========== */
.floating-btn {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: floatingBounce 2s ease-in-out infinite;
  text-decoration: none;
}

/* ========== BOUNCE ANIMATION ========== */
@keyframes floatingBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ========== RIPPLE/WAVE EFFECT (Hiệu ứng lan tỏa) ========== */
.floating-btn-ripple {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  top: 0;
  left: 0;
  pointer-events: none;
  animation: rippleEffect 2s ease-out infinite;
  opacity: 0;
}

@keyframes rippleEffect {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* ========== ICON STYLES ========== */
.floating-btn i {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
  font-size: inherit;
}

/* ========== HOVER EFFECTS ========== */
.floating-btn:hover {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  animation: none; /* Stop bounce on hover */
}

.floating-btn:hover i {
  transform: scale(1.1);
  animation: wiggle 0.5s ease;
}

/* Wiggle animation for icon on hover */
@keyframes wiggle {
  0%, 100% { 
    transform: rotate(0deg); 
  }
  25% { 
    transform: rotate(-10deg); 
  }
  75% { 
    transform: rotate(10deg); 
  }
}

/* Active/Click state */
.floating-btn:active {
  transform: scale(0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.1s ease;
}

/* ========== ZALO BUTTON ========== */
.floating-btn-zalo {
  background: linear-gradient(135deg, #0068FF 0%, #0052CC 100%);
  padding: 0.5rem;
}

.floating-btn-zalo .floating-btn-ripple {
  background: radial-gradient(circle, rgba(0, 104, 255, 0.8) 0%, transparent 70%);
}

.floating-btn-zalo:hover {
  background: linear-gradient(135deg, #0080FF 0%, #0068FF 100%);
}

/* Zalo Icon Image */
.floating-btn-icon {
  width: 70%;
  height: 70%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.floating-btn-zalo:hover .floating-btn-icon {
  transform: scale(1.1);
}

.floating-btn-zalo:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
}

.floating-btn-zalo:hover:before {
  transform: translate(-50%, -50%) scale(1);
}

/* ========== PHONE BUTTON ========== */
.floating-btn-phone {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  animation-delay: 0.2s;
}

.floating-btn-phone .floating-btn-ripple {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.8) 0%, transparent 70%);
  animation-delay: 0.2s;
}

.floating-btn-phone:hover {
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
}

/* Phone ringing animation */
.floating-btn-phone i {
  animation: phoneRing 1.5s ease-in-out infinite;
}

@keyframes phoneRing {
  0%, 100% { 
    transform: rotate(0deg); 
  }
  10%, 30% { 
    transform: rotate(-15deg); 
  }
  20%, 40% { 
    transform: rotate(15deg); 
  }
  50% { 
    transform: rotate(0deg); 
  }
}

.floating-btn-phone:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
}

.floating-btn-phone:hover:before {
  transform: translate(-50%, -50%) scale(1);
}

/* ========== SCROLL TO TOP BUTTON ========== */
.floating-btn-top {
  background: linear-gradient(135deg, #D4AF37 0%, #C8A75A 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.4s ease;
}

.floating-btn-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-btn-top:hover {
  background: linear-gradient(135deg, #FFD700 0%, #D4AF37 100%);
}

/* Simple style - no animations for scroll to top */
.floating-btn-simple {
  animation: none !important;
}

.floating-btn-simple i {
  animation: none !important;
}

.floating-btn-simple:hover {
  transform: scale(1.1);
}

.floating-btn-simple:active {
  transform: scale(0.95);
}

/* ========== PULSE EFFECT (Hiệu ứng gây chú ý) ========== */
@keyframes pulse {
  0% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.3);
  }
  100% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
}

@keyframes pulseZalo {
  0% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 8px 30px rgba(0, 104, 255, 0.4), 0 0 20px rgba(0, 104, 255, 0.3);
  }
  100% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }
}

/* Apply pulse effect to grab attention */
.floating-btn-phone {
  animation: floatingBounce 2s ease-in-out infinite, pulse 3s ease-in-out infinite;
}

.floating-btn-zalo {
  animation: floatingBounce 2s ease-in-out infinite, pulseZalo 3s ease-in-out infinite;
  animation-delay: 0s, 0.5s;
}

/* ========== TOOLTIP (Optional) ========== */
.floating-btn[aria-label]:hover:after {
  content: attr(aria-label);
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  font-size: 0.875rem;
  white-space: nowrap;
  border-radius: 0.5rem;
  pointer-events: none;
  opacity: 0;
  animation: tooltipSlide 0.3s ease forwards;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

@keyframes tooltipSlide {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .floating-actions {
    right: 1rem;
    bottom: 1rem;
    gap: 0.75rem;
  }

  .floating-btn {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
  }

  /* Disable tooltip on mobile */
  .floating-btn[aria-label]:hover:after {
    display: none;
  }
}

@media (max-width: 480px) {
  .floating-actions {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.625rem;
  }

  .floating-btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  }

  /* Reduce animation on small screens for performance */
  .floating-btn {
    animation: none;
  }

  .floating-btn-ripple {
    animation: rippleEffect 2.5s ease-out infinite;
  }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  .floating-btn,
  .floating-btn-ripple,
  .floating-btn i {
    animation: none !important;
  }

  .floating-btn:hover {
    transform: scale(1.05);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .floating-btn {
    border: 2px solid white;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .floating-actions {
    display: none !important;
  }
}
