/**
 * AOS Flip Card Fix
 * Additional CSS to ensure AOS animations work properly with 3D flip cards
 */

/* Ensure AOS animations don't break 3D transforms */
.service-card-wrapper {
    perspective: 1000px !important;
    transform-style: flat; /* Start flat for AOS animations */
}

.service-card-wrapper.aos-animate {
    transform-style: preserve-3d !important; /* Switch to preserve-3d after animation */
}

/* Fix for service cards to maintain 3D effect after AOS animation */
.service-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d !important;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Ensure card front and back maintain proper 3D positioning */
.card-front, .card-back {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

/* Ensure back face is properly rotated */
.card-back {
    transform: rotateY(180deg) !important;
}

/* Fix for user-initiated flips */
.service-card-wrapper.user-flipped .service-card {
    transform: rotateY(180deg) !important;
}

/* Override any AOS transforms that might interfere with the flip effect */
.service-card-wrapper.aos-animate[data-aos^="flip"] .service-card,
.service-card-wrapper.aos-animate[data-aos^="zoom"] .service-card {
    transform: rotateY(0deg);
}

.service-card-wrapper.aos-animate[data-aos^="flip"].user-flipped .service-card,
.service-card-wrapper.aos-animate[data-aos^="zoom"].user-flipped .service-card {
    transform: rotateY(180deg) !important;
}

/* Fix for hover effect after AOS animation */
.service-card-wrapper.aos-animate:hover .service-card {
    transform: rotateY(180deg);
}

/* Ensure AOS animations complete properly */
[data-aos].aos-animate {
    transition-property: transform, opacity !important;
}

/* Fix for mobile devices */
@media (max-width: 768px) {
    .service-card-wrapper {
        perspective: 1000px !important;
    }
    
    .service-card-wrapper[data-aos] {
        opacity: 1 !important; /* Ensure cards are visible on mobile */
    }
}
