/* GSAP Scroll Animations - Main Frontend Styles */

/* Base animation class */
.gsap-animate {
    will-change: transform, opacity;
}

/* Prevent flash of unstyled content before animation */
.gsap-animate:not(.gsap-animated) {
    opacity: 0;
}

/* Ensure smooth transitions */
.gsap-animate * {
    will-change: auto;
}

/* Stagger group container */
.gsap-stagger-group {
    position: relative;
}

.gsap-stagger-item {
    will-change: transform, opacity;
}

/* Parallax container */
.gsap-parallax {
    will-change: transform;
}

/* Pin container */
.gsap-pin {
    position: relative;
}

/* Optional: Add subtle initial states for different animation types */
.gsap-fade-in,
.gsap-fade-in-up,
.gsap-fade-in-down,
.gsap-fade-in-left,
.gsap-fade-in-right,
.gsap-scale-in,
.gsap-rotate-in,
.gsap-slide-in-up,
.gsap-slide-in-down,
.gsap-slide-in-left,
.gsap-slide-in-right {
    opacity: 0;
}

/* Utility classes for common layouts */
.gsap-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.gsap-section {
    padding: 80px 0;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gsap-section {
        padding: 40px 0;
    }
    
    /* Reduce animation distances on mobile for better performance */
    .gsap-animate[data-gsap-reduce-motion="true"] {
        transform: none !important;
    }
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gsap-animate {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
    
    .gsap-parallax {
        transform: none !important;
    }
}

/* Loading state */
.gsap-loading {
    opacity: 0;
    pointer-events: none;
}

/* Animated state */
.gsap-animated {
    opacity: 1;
}

/* Helper classes for common animation patterns */
.gsap-reveal-text {
    overflow: hidden;
}

.gsap-reveal-text > * {
    display: inline-block;
}

/* Split text animation support */
.gsap-split-line {
    display: block;
    overflow: hidden;
}

.gsap-split-word {
    display: inline-block;
}

/* Image reveal effect */
.gsap-image-reveal {
    position: relative;
    overflow: hidden;
}

.gsap-image-reveal img {
    display: block;
    width: 100%;
    height: auto;
}

/* Smooth performance optimizations */
.gsap-animate,
.gsap-parallax,
.gsap-pin {
    backface-visibility: hidden;
    perspective: 1000px;
    transform: translateZ(0);
}

/* Debug markers styling (when enabled) */
.gsap-marker-scroller-start,
.gsap-marker-scroller-end,
.gsap-marker-start,
.gsap-marker-end {
    z-index: 9999;
}

/* Video Animations */
.gsap-video-fadein,
.gsap-video-scalein,
.gsap-video-circlereveal,
.gsap-video-parallax {
    position: relative;
    overflow: hidden;
}

.gsap-video {
    width: 100%;
    height: auto;
    display: block;
}

.gsap-video-circlereveal video {
    border-radius: 20px;
}

.gsap-video-parallax {
    height: 100vh;
    position: relative;
}

.gsap-video-parallax video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Horizontal Scroll Section */
.gsap-horizontal-section {
    position: relative;
    overflow: hidden;
}

.gsap-horizontal-container {
    display: flex;
    height: 100%;
    align-items: center;
}

.gsap-horizontal-container > * {
    flex-shrink: 0;
    margin-right: 30px;
}

/* Example card styling for horizontal scroll */
.gsap-horizontal-container .card,
.gsap-horizontal-container .my-card {
    width: 400px;
    min-height: 300px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .gsap-horizontal-container > * {
        margin-right: 15px;
    }
    
    .gsap-horizontal-container .card,
    .gsap-horizontal-container .my-card {
        width: 300px;
        min-height: 250px;
        padding: 20px;
    }
}