/**
 * FourSquare Checkout Transition Styles
 * Grid-based flip animation for seamless cross-domain transitions
 */

/* Transition overlay container */
.fsq-transition-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    pointer-events: none;
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Individual tile styling */
.fsq-transition-tile {
    position: absolute;
    background: #ffffff;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    will-change: transform, opacity;
    transform-origin: center center;
}

/* Ensure tiles stay on top during animation */
.fsq-transition-overlay.active {
    pointer-events: all;
    background: rgba(255, 255, 255, 1);
}

/* Optional: Add a subtle pattern or gradient to tiles */
.fsq-transition-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fsq-transition-tile.flipping::before {
    opacity: 1;
}

/* Checkout form loading state */
.woocommerce-checkout.fsq-transitioning {
    position: relative;
}

.woocommerce-checkout.fsq-transitioning::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
}

/* Preloader styles for destination warming */
.fsq-preload-frame {
    position: absolute;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .fsq-transition-tile {
        /* Slightly larger tiles on mobile for better performance */
        box-shadow: none;
        border: 0.5px solid rgba(0, 0, 0, 0.03);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .fsq-transition-tile {
        transition: opacity 0.3s ease !important;
        transform: none !important;
    }
    
    .fsq-transition-overlay {
        background: white;
        transition: opacity 0.3s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fsq-transition-tile {
        border: 1px solid currentColor;
        box-shadow: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .fsq-transition-tile {
        background: #1a1a1a;
        box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
    }
    
    .fsq-transition-overlay.active {
        background: rgba(26, 26, 26, 1);
    }
}