/* Share Components Styling for Home Page */

.package-tags-home .package-tags {
    justify-content: center;
    margin-bottom: 0.5rem;
}

.package-tags-home .package-tags .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.package-share-home {
    display: flex;
    justify-content: center;
}

.package-share-home .share-buttons-container {
    transform: scale(0.9);
}

.category-share-home,
.destination-share-home {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.category-share-home .share-buttons-container,
.destination-share-home .share-buttons-container {
    transform: scale(0.85);
}

/* Responsive adjustments for home page */
@media (max-width: 768px) {
    .package-tags-home .package-tags .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .package-share-home .share-buttons-container,
    .category-share-home .share-buttons-container,
    .destination-share-home .share-buttons-container {
        transform: scale(0.8);
    }
}

/* Destination page package styling */
.package-tags-destination .package-tags {
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.package-share-destination {
    margin-top: 1rem;
}

/* Ensure share buttons don't overflow in card layouts */
.item .text {
    position: relative;
}

/* Override card overflow to allow modal to appear */
.card-carousel .item:has(.share-buttons-container) {
    overflow: visible !important;
}

/* Fallback for browsers that don't support :has() */
.card-carousel .item {
    overflow: visible !important;
}

/* Animation for share button appearance */
.share-buttons-container {
    animation: fadeInUp 0.3s ease-out;
}

/* Hide elements with x-cloak until Alpine.js is ready */
[x-cloak] {
    display: none !important;
}

/* Always hide horizontal scroll on body */
body {
    overflow-x: hidden !important;
}

/* Modal specific overrides */
.share-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    display: flex;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    margin: 0 !important;
    inset: 0 !important;
}

.share-modal-content {
    background: white !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
    width: 90% !important;
    max-width: 420px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 28px !important;
    position: relative !important;
    z-index: 2147483647 !important;
}

/* Ensure parent containers don't interfere */
.destination .item,
.package .item,
.card-carousel .item {
    position: relative;
}

/* Additional fallback styles - removed problematic body overflow rule */

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

/* Hover effects for better UX */
.share-trigger-btn {
    transition: all 0.3s ease;
}

.share-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Package tags animations */
.package-tags .badge {
    animation: slideInLeft 0.3s ease-out;
    animation-fill-mode: both;
}

.package-tags .badge:nth-child(1) { animation-delay: 0.1s; }
.package-tags .badge:nth-child(2) { animation-delay: 0.2s; }
.package-tags .badge:nth-child(3) { animation-delay: 0.3s; }
.package-tags .badge:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Special styling for trending packages */
.package-tags .badge-trending {
    position: relative;
    overflow: hidden;
}

.package-tags .badge-trending::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Print styles */
@media print {
    .share-buttons-container,
    .package-share-home,
    .category-share-home,
    .destination-share-home {
        display: none !important;
    }
}