/* Enhanced Import Destinations Styling */

/* CSS Custom Properties for Import Destinations */
:root {
    /* Enhanced Red-to-Black Gradient Variables */
    --gradient-red-black-destinations: linear-gradient(135deg, #DC2626, #B91C1C, #1F2937);
    --gradient-red-fade-destinations: linear-gradient(135deg, #EF4444, #DC2626, #B91C1C);
    --gradient-red-glow: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(185, 28, 28, 0.2));
    
    /* Animation Timing Functions */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Animation Durations */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    --duration-slower: 500ms;
}

/* Enhanced Destination Card Animations - Fixed Flickering */
.destination-card {
    position: relative;
    transition: transform var(--duration-normal) var(--ease-out-quart);
    will-change: transform;
}

.destination-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
    transition: left var(--duration-normal) var(--ease-out-expo);
    z-index: 1;
    border-radius: 0.75rem;
    pointer-events: none;
}

.destination-card:hover::before {
    left: 100%;
}

/* Enhanced Card Effects for White Background - Fixed Flickering */
.destination-card-white {
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 1);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
    transition:
        transform var(--duration-normal) var(--ease-out-quart),
        box-shadow var(--duration-normal) var(--ease-out-quart),
        border-color var(--duration-normal) var(--ease-out-quart);
    will-change: transform, box-shadow, border-color;
}

.destination-card-white:hover {
    border: 1px solid rgba(220, 38, 38, 0.3);
    box-shadow: 0 12px 32px 0 rgba(220, 38, 38, 0.15), 0 4px 16px 0 rgba(0, 0, 0, 0.1);
    transform: translateY(-4px) scale(1.01);
}

/* Enhanced Shadow Effects for White Background */
.shadow-red-glow {
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shadow-red-glow-lg {
    box-shadow: 0 12px 35px rgba(220, 38, 38, 0.25), 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* White Background Specific Shadows */
.shadow-white-card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.shadow-white-card-hover {
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Enhanced Country Icon Animations - Fixed Flickering */
.country-icon-wrapper {
    position: relative;
    transition: transform var(--duration-normal) var(--ease-out-quart);
    will-change: transform;
}

.country-icon-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform var(--duration-normal) var(--ease-out-expo);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.destination-card:hover .country-icon-wrapper::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Enhanced Trust Indicators for White Background - Fixed Flickering */
.trust-indicator {
    transition:
        transform var(--duration-normal) var(--ease-out-quart),
        box-shadow var(--duration-normal) var(--ease-out-quart),
        border-color var(--duration-normal) var(--ease-out-quart);
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 1);
    will-change: transform, box-shadow, border-color;
}

.trust-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.05), transparent);
    transition: left var(--duration-normal) var(--ease-out-expo);
    pointer-events: none;
}

.trust-indicator:hover::before {
    left: 100%;
}

.trust-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(220, 38, 38, 0.2);
}

/* Enhanced Stats Grid Animation */
.stats-grid {
    transition: all var(--duration-normal) var(--ease-out-quart);
}

.stats-item {
    transition: all var(--duration-normal) var(--ease-out-quart);
    position: relative;
}

.stats-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #DC2626, #EF4444);
    transition: all var(--duration-normal) var(--ease-out-quart);
    transform: translateX(-50%);
}

.destination-card:hover .stats-item::after {
    width: 80%;
}

/* Enhanced CTA Button Styling */
.cta-explore-destinations {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-slower) var(--ease-out-quart);
}

.cta-explore-destinations::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-slower) var(--ease-out-expo);
}

.cta-explore-destinations:hover::before {
    left: 100%;
}

.cta-explore-destinations:hover {
    box-shadow: 0 15px 30px rgba(220, 38, 38, 0.4);
}

/* Anti-Flickering Optimizations */
.destination-card,
.destination-card-white,
.country-icon-wrapper,
.trust-indicator {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* Prevent layout shifts during hover */
.destination-card::before,
.trust-indicator::before,
.country-icon-wrapper::after {
    will-change: transform, opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Enhanced Mobile Responsiveness for White Background */
@media (max-width: 768px) {
    .destination-card {
        margin-bottom: 1rem;
    }

    .destination-card-white {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .destination-card:hover {
        transform: translateY(-2px) scale(1.005);
    }

    .shadow-red-glow {
        box-shadow: 0 6px 20px rgba(220, 38, 38, 0.15), 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    .trust-indicator {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        background: #ffffff;
        border: 1px solid rgba(229, 231, 235, 1);
    }

    /* Reduce animations on mobile for better performance */
    .destination-card::before,
    .trust-indicator::before,
    .country-icon-wrapper::after {
        display: none;
    }
}

/* Enhanced Accessibility Support */
@media (prefers-reduced-motion: reduce) {
    .destination-card,
    .destination-glassmorphism,
    .country-icon-wrapper,
    .trust-indicator,
    .stats-item,
    .cta-explore-destinations {
        transition: none;
    }
    
    .destination-card::before,
    .country-icon-wrapper::after,
    .trust-indicator::before,
    .cta-explore-destinations::before {
        display: none;
    }
}

/* Enhanced Focus States for Accessibility */
.destination-card:focus-within,
.trust-indicator:focus,
.cta-explore-destinations:focus {
    outline: 2px solid #DC2626;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Enhanced High Contrast Mode Support */
@media (prefers-contrast: high) {
    .destination-glassmorphism {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #ffffff;
    }
    
    .trust-indicator {
        background: rgba(0, 0, 0, 0.9);
        border: 1px solid #ffffff;
    }
    
    .shadow-red-glow {
        box-shadow: 0 0 0 2px #ffffff;
    }
}

/* Enhanced Print Styles */
@media print {
    .destination-card,
    .trust-indicator,
    .cta-explore-destinations {
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border: 1px solid #000000 !important;
    }
    
    .destination-card::before,
    .country-icon-wrapper::after,
    .trust-indicator::before,
    .cta-explore-destinations::before {
        display: none !important;
    }
}

/* Smooth Transition Overrides to Prevent Flickering */
.destination-card * {
    transition-property: transform, opacity, box-shadow, border-color, background-color;
    transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Force GPU acceleration for smooth animations */
.destination-card,
.destination-card-white,
.country-icon-wrapper,
.trust-indicator {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Prevent text selection during hover animations */
.destination-card {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Enhanced Loading States */
.destination-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.destination-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
