/**
 * Product Stories Animated Backgrounds
 */

/* Animation Container */
.ps-animated-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.showcase-container {
    position: relative;
    overflow: hidden;
}

.showcase-container > *:not(.ps-animated-bg) {
    position: relative;
    z-index: 1;
}

/* ========== PARTICLES ========== */
.ps-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ps-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float-particle 15s infinite ease-in-out;
}

@keyframes float-particle {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(20px, -30px) scale(1.2); opacity: 0.6; }
    50% { transform: translate(-15px, -60px) scale(0.8); opacity: 0.4; }
    75% { transform: translate(30px, -40px) scale(1.1); opacity: 0.5; }
}

/* ========== GRADIENT WAVE ========== */
.ps-gradient-wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        rgba(99, 102, 241, 0.1) 0%,
        rgba(168, 85, 247, 0.1) 25%,
        rgba(236, 72, 153, 0.1) 50%,
        rgba(251, 146, 60, 0.1) 75%,
        rgba(99, 102, 241, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: gradient-wave 15s ease infinite;
}

@keyframes gradient-wave {
    0% { background-position: 0% 50%; transform: rotate(0deg); }
    50% { background-position: 100% 50%; transform: rotate(180deg); }
    100% { background-position: 0% 50%; transform: rotate(360deg); }
}

/* ========== FLOATING SHAPES ========== */
.ps-floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ps-shape {
    position: absolute;
    opacity: 0.15;
    animation: float-shape 20s infinite ease-in-out;
}

.ps-shape.circle {
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ps-shape.square {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ps-shape.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(102, 126, 234, 0.3);
}

@keyframes float-shape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, -100px) rotate(90deg); }
    50% { transform: translate(-30px, -200px) rotate(180deg); }
    75% { transform: translate(70px, -150px) rotate(270deg); }
}

/* ========== BUBBLES ========== */
.ps-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ps-bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    border-radius: 50%;
    opacity: 0.6;
    animation: rise-bubble linear infinite;
}

@keyframes rise-bubble {
    0% {
        bottom: -100px;
        transform: translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        bottom: 110%;
        transform: translateX(100px) scale(1.5);
        opacity: 0;
    }
}

/* ========== STARS ========== */
.ps-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.ps-star {
    position: absolute;
    background: white;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ========== GEOMETRIC PATTERN ========== */
.ps-geometric {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ps-geo-element {
    position: absolute;
    border: 2px solid rgba(99, 102, 241, 0.2);
    animation: rotate-geo 20s linear infinite;
}

.ps-geo-element.hex {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

@keyframes rotate-geo {
    0% { transform: rotate(0deg) scale(1); opacity: 0.3; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 0.6; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.3; }
}

/* ========== WAVES ========== */
.ps-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0;
}

.ps-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.1));
    animation: wave-motion 10s linear infinite;
}

.ps-wave:nth-child(2) {
    animation-duration: 15s;
    animation-delay: -5s;
    opacity: 0.5;
}

.ps-wave:nth-child(3) {
    animation-duration: 20s;
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes wave-motion {
    0% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-25%) translateY(-10px); }
    100% { transform: translateX(-50%) translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ps-particle, .ps-bubble, .ps-star {
        display: none;
    }

    .ps-shape {
        opacity: 0.1;
    }
}

