/* Floating Contact Buttons Styles */
.floating-contact-buttons {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--fcb-button-spacing, 15px);
  bottom: var(--fcb-offset-bottom, 100px);
  transition: all 0.3s ease;
}

/* Position variants */
.floating-contact-buttons.right {
  right: var(--fcb-offset-side, 20px);
}

.floating-contact-buttons.left {
  left: var(--fcb-offset-side, 20px);
}

/* Button base styles */
.fcb-button {
  position: relative;
  width: var(--fcb-button-size, 60px);
  height: var(--fcb-button-size, 60px);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.6s ease-out forwards;
}

/* Staggered animation delays */
.fcb-button:nth-child(1) { animation-delay: 0.1s; }
.fcb-button:nth-child(2) { animation-delay: 0.2s; }
.fcb-button:nth-child(3) { animation-delay: 0.3s; }
.fcb-button:nth-child(4) { animation-delay: 0.4s; }

/* Button link */
.fcb-button a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: white;
  position: relative;
  overflow: hidden;
}

/* Button background with gradient rings - only when not showing tooltip */
.fcb-button:not(:hover)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 30%, 
    transparent 70%);
  z-index: 1;
}

/* Outer ring effect - only when not showing tooltip */
.fcb-button:not(:hover)::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at center, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 50%, 
    transparent 70%);
  z-index: -1;
  opacity: 0.6;
}

/* Font Awesome icons */
.fcb-button i {
  font-size: 24px;
  z-index: 2;
  position: relative;
  transition: transform 0.3s ease;
}

/* Button specific colors */
.fcb-zalo {
  background: linear-gradient(135deg, var(--fcb-zalo-color, #0068ff) 0%, #0052cc 100%);
}

.fcb-messenger {
  background: linear-gradient(135deg, var(--fcb-messenger-color, #0084ff) 0%, #0066cc 100%);
}

.fcb-phone {
  background: linear-gradient(135deg, var(--fcb-phone-color, #ff4444) 0%, #cc3333 100%);
}

.fcb-backtotop {
  background: linear-gradient(135deg, var(--fcb-backtotop-color, #666666) 0%, #555555 100%);
}

/* Hover effects */
.hover-scale-enabled .fcb-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.hover-scale-enabled .fcb-button:hover i {
  transform: scale(1.1);
}

/* Hover ring effect for buttons without tooltip */
.fcb-button:not([data-tooltip]):hover::after {
  opacity: 1;
  transform: scale(1.2);
}

/* Pulse animation */
.pulse-enabled .fcb-button {
  animation: slideInUp 0.6s ease-out forwards, pulse 2s infinite 1s;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 10px rgba(255, 255, 255, 0.1);
  }
}

/* Slide in animation */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tooltip styles */
.fcb-button[data-tooltip] {
  position: relative;
}

.fcb-button[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
  pointer-events: none;
}

/* Tooltip positioning based on button position */
.floating-contact-buttons.right .fcb-button[data-tooltip]:hover::before {
  right: calc(100% + 15px);
}

.floating-contact-buttons.left .fcb-button[data-tooltip]:hover::before {
  left: calc(100% + 15px);
}

/* Tooltip arrow - using pseudo element on hover only */
.fcb-button[data-tooltip]:hover::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border: 6px solid transparent;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.floating-contact-buttons.right .fcb-button[data-tooltip]:hover::after {
  right: calc(100% + 9px);
  border-left-color: rgba(0, 0, 0, 0.9);
}

.floating-contact-buttons.left .fcb-button[data-tooltip]:hover::after {
  left: calc(100% + 9px);
  border-right-color: rgba(0, 0, 0, 0.9);
}

/* Active/pressed state */
.fcb-button:active {
  transform: scale(0.95);
}

.hover-scale-enabled .fcb-button:active {
  transform: scale(1.05);
}

/* Focus states for accessibility */
.fcb-button a:focus {
  outline: none;
}

.fcb-button:focus-within {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Back to top specific styles */
.fcb-backtotop {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.fcb-backtotop.visible {
  opacity: 1;
  visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
  .floating-contact-buttons {
    bottom: var(--fcb-offset-bottom, 80px);
    gap: calc(var(--fcb-button-spacing, 15px) - 3px);
  }
  
  .floating-contact-buttons.right {
    right: var(--fcb-mobile-offset-side, 15px);
  }
  
  .floating-contact-buttons.left {
    left: var(--fcb-mobile-offset-side, 15px);
  }
  
  .fcb-button {
    width: var(--fcb-mobile-button-size, 50px);
    height: var(--fcb-mobile-button-size, 50px);
  }
  
  .fcb-button i {
    font-size: 20px;
  }
  
  /* Hide tooltips on mobile */
  .fcb-button[data-tooltip]:hover::before,
  .fcb-button[data-tooltip]:hover::after {
    display: none;
  }
  
  /* Adjust outer ring for mobile */
  .fcb-button::after {
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
  }
}

@media (max-width: 480px) {
  .floating-contact-buttons {
    bottom: var(--fcb-offset-bottom, 60px);
  }
  
  .fcb-button {
    width: calc(var(--fcb-mobile-button-size, 50px) - 5px);
    height: calc(var(--fcb-mobile-button-size, 50px) - 5px);
  }
  
  .fcb-button i {
    font-size: 18px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .fcb-button {
    border: 2px solid white;
  }
  
  .fcb-button[data-tooltip]:hover::before {
    background: black;
    border: 1px solid white;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .fcb-button,
  .fcb-button svg,
  .fcb-button::before,
  .fcb-button::after {
    transition: none;
    animation: none;
  }
  
  .pulse-enabled .fcb-button {
    animation: none;
  }
  
  .fcb-button {
    opacity: 1;
    transform: none;
  }
}

/* Print styles */
@media print {
  .floating-contact-buttons {
    display: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .fcb-button {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  .fcb-button:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  }
  
  .fcb-button[data-tooltip]:hover::before {
    background: rgba(255, 255, 255, 0.9);
    color: black;
  }
  
  .floating-contact-buttons.right .fcb-button[data-tooltip]:hover::after {
    border-left-color: rgba(255, 255, 255, 0.9);
  }
  
  .floating-contact-buttons.left .fcb-button[data-tooltip]:hover::after {
    border-right-color: rgba(255, 255, 255, 0.9);
  }
}

/* Custom scrollbar for smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading state */
.fcb-button.loading {
  pointer-events: none;
}

.fcb-button.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Success state animation */
.fcb-button.success {
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Error state */
.fcb-button.error {
  animation: shake 0.5s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
} 