/**
 * BackgroundEffects Control (BEC) - CSS
 * Provides animated background effects for images with Ken Burns and Hue Rotation
 */

.background-effects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* Image layers for crossfading */
.bec-image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000; /* Black background for letterboxing */
    opacity: 0;
    transition: opacity 2s ease-in-out;
    filter: blur(2px) brightness(0.75);
    transform-origin: center center;
}

/* Color overlay for B&W colorization - blended on top */
.bec-image-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 0, 150, 0.6) 0%, 
        rgba(0, 204, 255, 0.6) 100%);
    mix-blend-mode: color;
    opacity: 0;
    pointer-events: none;
}

.bec-image-layer.active {
    opacity: 0.9;
}

/* Ken Burns animation will be applied dynamically via inline styles */
/* Hue rotation animation - applies to both image and background */
/* Also adds saturation to colorize black and white images */
@keyframes bec-hue-rotate {
    0% {
        filter: blur(2px) brightness(0.75) saturate(2.5) hue-rotate(0deg);
        background-color: hsl(0, 0%, 0%);
    }
    100% {
        filter: blur(2px) brightness(0.75) saturate(2.5) hue-rotate(360deg);
        background-color: hsl(360, 0%, 0%);
    }
}

/* Animation for the color overlay (::before element) */
@keyframes bec-overlay-hue-rotate {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.bec-hue-rotation-enabled .bec-image-layer::before {
    opacity: 1;
    animation: bec-overlay-hue-rotate 30s linear infinite;
}

.bec-hue-rotation-enabled .bec-image-layer {
    animation: bec-hue-rotate 30s linear infinite;
}

/* Paused state */
.bec-paused .bec-image-layer {
    animation-play-state: paused !important;
}
