/* Share Button Container */
.share-button-container {
  position: absolute;
  bottom: 15px;
  right: 15px;
  z-index: 10;
}

/* Share Button Styles */
.share-button {
  background-color: rgba(255, 255, 255, 0.95);
  color: #ffa026;
  border: 2px solid #ffa026;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-button:hover {
  background-color: #ffa026;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 160, 38, 0.4);
}

.share-button:active {
  transform: scale(0.95);
}

/* Focus States for Accessibility */
.share-button:focus {
  outline: 2px solid #ffa026;
  outline-offset: 2px;
}

/* Social Icons Container */
.social-icons {
  display: none;
  position: absolute;
  bottom: 50px;
  right: 0;
  background-color: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  gap: 8px;
  min-width: 60px;
  backdrop-filter: blur(10px);
}

.social-icons.show {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Social Icon Links */
.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.social-icons a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.social-icons a:hover::before {
  transform: translateX(100%);
}

.social-icons a:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-icons a:active {
  transform: scale(0.95);
}

/* Focus States for Accessibility */
.social-icons a:focus {
  outline: 2px solid #ffa026;
  outline-offset: 2px;
}

/* Improved Animation Performance */
.social-icons a,
.share-button {
  will-change: transform, background-color, color;
}

.social-icons a:hover,
.share-button:hover {
  will-change: auto;
}

/* Tooltip for Copy Link */
.copy-link-container {
  position: relative;
}

.copy-link-container::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
}

.copy-link-container:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Error handling for missing Font Awesome icons */
.social-icons a i::before {
  font-family: "Font Awesome 5 Brands", "Font Awesome 5 Free", "FontAwesome";
}

.social-icons a.whatsapp i::before {
  content: "\f232";
}

.social-icons a.facebook i::before {
  content: "\f09a";
}

.social-icons a.instagram i::before {
  content: "\f16d";
}

.copy-link-btn i::before {
  content: "\f0c1";
}

/* Improved container positioning */
.share-button-container {
  pointer-events: none;
}

.share-button-container > * {
  pointer-events: auto;
}

/* Better z-index management */
.share-button-container {
  z-index: 100;
}

.social-icons {
  z-index: 101;
}

/* Ensure proper stacking in gallery slider */
.event-gallery-slider .share-button-container {
  z-index: 50;
}

.event-gallery-slider .social-icons {
  z-index: 51;
}

/* Copy Link Button */
.copy-link-btn {
  color: #ffa026;
  background-color: rgba(255, 160, 38, 0.1);
  font-size: 16px;
  transition: all 0.3s ease;
}

.copy-link-btn:hover {
  background-color: #ffa026;
  color: #fff;
}

/* Icon Sizes */
.social-icons a i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.social-icons a:hover i {
  transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .share-button-container {
    bottom: 10px;
    right: 10px;
  }

  .share-button {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .social-icons {
    bottom: 45px;
    right: -5px;
    padding: 10px;
  }

  .social-icons a {
    width: 35px;
    height: 35px;
  }

  .social-icons a i {
    font-size: 16px;
  }
}

@media (max-width: 320px) {
  .share-button {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .social-icons {
    bottom: 40px;
    padding: 8px;
  }

  .social-icons a {
    width: 30px;
    height: 30px;
  }

  .social-icons a i {
    font-size: 14px;
  }
}

/* Mobile improvements */
@media (max-width: 480px) {
  .social-icons {
    right: -10px;
    bottom: 45px;
  }

  .social-icons a {
    width: 36px;
    height: 36px;
  }

  .social-icons a i {
    font-size: 16px;
  }
}

/* Touch device improvements */
@media (pointer: coarse) {
  .share-button {
    min-width: 44px;
    min-height: 44px;
  }

  .social-icons a {
    min-width: 44px;
    min-height: 44px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .share-button {
    border-width: 2px;
  }

  .social-icons {
    border-width: 2px;
    border-color: #000;
  }

  .social-icons a {
    border: 1px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .social-icons a::before,
  .share-button,
  .social-icons a {
    transition: none !important;
    animation: none !important;
  }

  .social-icons a:hover,
  .share-button:hover {
    transform: none !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .share-button {
    background-color: rgba(26, 26, 26, 0.95);
    border-color: #ffa026;
  }

  .social-icons {
    background-color: rgba(26, 26, 26, 0.98);
    border-color: #333;
  }

  .social-icons a {
    background-color: #333;
    color: #fff;
  }
}

/* Fallback for older browsers */
@supports not (backdrop-filter: blur(10px)) {
  .social-icons {
    background-color: rgba(255, 255, 255, 0.95);
  }
}

/* Print styles */
@media print {
  .share-button-container {
    display: none !important;
  }
}
