/**
 * Sticky Contact Styles - Tailwind Inspired
 * Simple, clean and minimal design
 */

/* ================================
   STICKY CONTAINER
   ================================ */

.sticky-contact {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sticky-contact-right {
  right: 16px;
}

.sticky-contact-left {
  left: 16px;
}

/* ================================
   BUTTONS
   ================================ */

.sticky-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 200ms ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
}

.sticky-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  color: white;
}

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

/* Ensure all buttons are properly aligned */
.sticky-btn {
  position: relative;
  margin: 0;
  flex-shrink: 0;
}

/* ================================
   BUTTON COLORS
   ================================ */

.back-to-top {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  transform: none !important; /* Override any transform when hidden */
  bottom: unset !important;
  right: unset !important;
}

.back-to-top:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
  transform: scale(1.05) !important;
}

.back-to-top:active {
  transform: scale(0.95) !important;
}

.sticky-zalo {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.sticky-zalo:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.sticky-call {
  background: linear-gradient(135deg, #10b981, #059669);
}

.sticky-call:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.sticky-message {
  background: linear-gradient(135deg, var(--primary-color, #7b1113), #991b1b);
}

.sticky-message:hover {
  background: linear-gradient(135deg, #991b1b, #7f1d1d);
}

/* ================================
   ICONS
   ================================ */

.sticky-btn svg {
  flex-shrink: 0;
}

.sticky-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.w-4 {
  width: 16px;
}

.h-4 {
  height: 16px;
}

.w-5 {
  width: 20px;
}

.h-5 {
  height: 20px;
}

/* ================================
   TOOLTIPS (Simple)
   ================================ */

.sticky-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  animation: tooltipFade 150ms ease forwards;
}

.sticky-contact-left .sticky-btn[title]:hover::after {
  right: auto;
  left: 60px;
}

@keyframes tooltipFade {
  to {
    opacity: 1;
  }
}

/* ================================
   BACK TO TOP ANIMATION
   ================================ */

.back-to-top[style*="display: flex"],
.back-to-top:not([style*="display: none"]) {
  animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 768px) {
  .sticky-contact {
    right: 12px;
    gap: 6px;
  }

  .sticky-contact-left {
    left: 12px;
  }

  .sticky-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .sticky-btn img {
    width: 18px;
    height: 18px;
  }

  .w-4 {
    width: 14px;
    height: 14px;
  }

  .w-5 {
    width: 18px;
    height: 18px;
  }

  /* Hide tooltips on mobile */
  .sticky-btn[title]:hover::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .sticky-contact {
    right: 8px;
    gap: 4px;
  }

  .sticky-contact-left {
    left: 8px;
  }

  .sticky-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }

  .sticky-btn img {
    width: 16px;
    height: 16px;
  }

  .w-4 {
    width: 12px;
    height: 12px;
  }

  .w-5 {
    width: 16px;
    height: 16px;
  }
}

/* ================================
   ACCESSIBILITY
   ================================ */

.sticky-btn:focus {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sticky-btn {
    transition: none;
  }

  .sticky-btn:hover {
    transform: none;
  }

  .back-to-top {
    animation: none;
  }
}

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

/* Print */
@media print {
  .sticky-contact {
    display: none;
  }
}
