/* ========================================
   CTA Images Animation Enhancement
   For About Us Section - 4 Images
   ======================================== */

/* Ensure proper grid layout */
.cta-wrapp {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
}

/* Tablet responsive */
@media (max-width: 767px) {
    .cta-wrapp {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile responsive */
@media (max-width: 575px) {
    .cta-wrapp {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* CTA Item styling */
.cta-wrapp .cta-item {
    border-radius: 16px;
    overflow: hidden;
    transform-origin: center center;
    position: relative;
}

/* Image styling */
.cta-wrapp .cta-item img {
    width: 100%;
    display: block;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

/* Hover effect */
.cta-wrapp .cta-item:hover img {
    transform: scale(1.05);
}

/* ========================================
   CSS Fallback Animation (if GSAP fails)
   ======================================== */

/* Initial state - hidden */
.cta-wrapp .cta-item {
    opacity: 0;
    transform: translateX(0) rotate(0deg);
}

/* Animated state - visible */
.cta-wrapp .cta-item.animated {
    opacity: 1;
    animation-duration: 1s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Individual animations for each image */
.cta-wrapp .cta-item:nth-child(1).animated {
    animation-name: slideInFromRight;
}

.cta-wrapp .cta-item:nth-child(2).animated {
    animation-name: slideInFromRightRotate;
}

.cta-wrapp .cta-item:nth-child(3).animated {
    animation-name: slideInFromLeftRotate;
}

.cta-wrapp .cta-item:nth-child(4).animated {
    animation-name: slideInFromLeft;
}

/* Stagger delay */
.cta-wrapp .cta-item:nth-child(1).animated {
    animation-delay: 0s;
}

.cta-wrapp .cta-item:nth-child(2).animated {
    animation-delay: 0.1s;
}

.cta-wrapp .cta-item:nth-child(3).animated {
    animation-delay: 0.2s;
}

.cta-wrapp .cta-item:nth-child(4).animated {
    animation-delay: 0.3s;
}

/* ========================================
   Keyframe Animations
   ======================================== */

/* Image 1: Slide from far right */
@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(150%) rotate(0deg);
    }

    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

/* Image 2: Slide from right with rotation */
@keyframes slideInFromRightRotate {
    0% {
        opacity: 0;
        transform: translateX(60%) rotate(10deg);
    }

    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

/* Image 3: Slide from left with rotation */
@keyframes slideInFromLeftRotate {
    0% {
        opacity: 0;
        transform: translateX(-80%) rotate(-10deg);
    }

    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

/* Image 4: Slide from far left */
@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-180%) rotate(0deg);
    }

    100% {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

/* ========================================
   Mobile Optimization
   ======================================== */

@media (max-width: 768px) {

    /* Simpler animations for mobile */
    .cta-wrapp .cta-item:nth-child(1).animated,
    .cta-wrapp .cta-item:nth-child(2).animated {
        animation-name: fadeInUp;
    }

    .cta-wrapp .cta-item:nth-child(3).animated,
    .cta-wrapp .cta-item:nth-child(4).animated {
        animation-name: fadeInUp;
    }

    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(30px);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   Accessibility - Respect reduced motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cta-wrapp .cta-item {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========================================
   Loading state
   ======================================== */

.cta-wrapp .cta-item:not(.animated) {
    opacity: 0;
}

/* Show images after 2 seconds if animation doesn't trigger */
.cta-wrapp.loaded .cta-item {
    opacity: 1;
}