/**
 * CSS personalizado para SAAF Background Controls
 * Compatible con los controles agregados via hooks
 */

/* Base styles for SAAF enhanced slides */
.elementor-widget-slides .swiper-slide-bg {
    background-attachment: scroll;
    transition: all 0.3s ease;
}

/* SAAF Ken Burns Effects */
.saaf-ken-burns-yes .swiper-slide-bg {
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-direction: alternate;
}

/* Ken Burns Directions */
.saaf-ken-burns-direction-zoom-in .swiper-slide-bg {
    animation-name: saafKenBurnsZoomIn;
}

.saaf-ken-burns-direction-zoom-out .swiper-slide-bg {
    animation-name: saafKenBurnsZoomOut;
}

.saaf-ken-burns-direction-pan-left .swiper-slide-bg {
    animation-name: saafKenBurnsPanLeft;
}

.saaf-ken-burns-direction-pan-right .swiper-slide-bg {
    animation-name: saafKenBurnsPanRight;
}

.saaf-ken-burns-direction-pan-up .swiper-slide-bg {
    animation-name: saafKenBurnsPanUp;
}

.saaf-ken-burns-direction-pan-down .swiper-slide-bg {
    animation-name: saafKenBurnsPanDown;
}

/* Ken Burns Keyframes */
@keyframes saafKenBurnsZoomIn {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

@keyframes saafKenBurnsZoomOut {
    0% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes saafKenBurnsPanLeft {
    0% {
        transform: scale(1.1) translateX(0);
    }
    100% {
        transform: scale(1.1) translateX(-5%);
    }
}

@keyframes saafKenBurnsPanRight {
    0% {
        transform: scale(1.1) translateX(0);
    }
    100% {
        transform: scale(1.1) translateX(5%);
    }
}

@keyframes saafKenBurnsPanUp {
    0% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1.1) translateY(-5%);
    }
}

@keyframes saafKenBurnsPanDown {
    0% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1.1) translateY(5%);
    }
}

/* Hover effects for enhanced interactivity */
.elementor-widget-slides .swiper-slide:hover .swiper-slide-bg {
    transform: scale(1.02);
    transition: transform 0.5s ease;
}

/* Disable hover effect when Ken Burns is active */
.saaf-ken-burns-yes .swiper-slide:hover .swiper-slide-bg {
    transform: none;
}

/* Additional responsive utilities */
@media (max-width: 767px) {
    /* Force better mobile background positioning */
    .elementor-widget-slides .swiper-slide-bg {
        background-attachment: scroll !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablet optimizations */
    .elementor-widget-slides .swiper-slide-bg {
        background-attachment: scroll;
    }
}

@media (min-width: 1025px) {
    /* Desktop optimizations */
    .elementor-widget-slides .swiper-slide-bg {
        background-attachment: scroll;
    }
}

/* Utility classes for manual control */
.saaf-bg-cover { background-size: cover !important; }
.saaf-bg-contain { background-size: contain !important; }
.saaf-bg-auto { background-size: auto !important; }

.saaf-bg-center { background-position: center center !important; }
.saaf-bg-top { background-position: center top !important; }
.saaf-bg-bottom { background-position: center bottom !important; }
.saaf-bg-left { background-position: left center !important; }
.saaf-bg-right { background-position: right center !important; }

/* Performance optimizations */
.elementor-widget-slides .swiper-slide-bg {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Improved slide transitions */
.elementor-widget-slides .swiper-slide-bg {
    transform-origin: center center;
}

/* Print styles */
@media print {
    .saaf-ken-burns-yes .swiper-slide-bg {
        animation: none !important;
        transform: none !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .saaf-ken-burns-yes .swiper-slide-bg {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    
    .elementor-widget-slides .swiper-slide:hover .swiper-slide-bg {
        transition: none;
        transform: none;
    }
}