/**
 * Animated Gradient Background - Styles
 * Fond dégradé animé effet blur/aurora appliqué au conteneur parent
 */

/* Widget trigger (peut être masqué) */
.animated-gradient-trigger {
    position: relative;
}

.animated-gradient-trigger.hidden-widget {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Notice dans l'éditeur */
.animated-gradient-editor-notice {
    display: none;
    padding: 15px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    color: #fff;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.animated-gradient-editor-notice span {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.animated-gradient-editor-notice small {
    opacity: 0.8;
    font-size: 12px;
}

.elementor-editor-active .animated-gradient-editor-notice {
    display: block;
}

.elementor-editor-active .animated-gradient-trigger.hidden-widget {
    position: relative;
    width: auto;
    height: auto;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}

/* Conteneur parent avec le gradient */
.has-animated-gradient {
    position: relative;
    overflow: hidden;
}

/* Zone des blobs animés */
.animated-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: var(--gradient-z-index, 0);
    pointer-events: none;
}

/* Blobs individuels */
.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(var(--blur-amount, 80px));
    opacity: var(--blob-opacity, 0.7);
    mix-blend-mode: screen;
    will-change: transform;
    pointer-events: none;
}

/* Blob 1 - Haut gauche */
.gradient-blob.blob-1 {
    width: var(--blob-size, 50%);
    height: var(--blob-size, 50%);
    top: -10%;
    left: -10%;
    animation: blob-move-1 var(--animation-speed, 20s) ease-in-out infinite;
}

/* Blob 2 - Haut droite */
.gradient-blob.blob-2 {
    width: calc(var(--blob-size, 50%) * 0.8);
    height: calc(var(--blob-size, 50%) * 0.8);
    top: -5%;
    right: -10%;
    animation: blob-move-2 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.25);
}

/* Blob 3 - Bas gauche */
.gradient-blob.blob-3 {
    width: calc(var(--blob-size, 50%) * 0.9);
    height: calc(var(--blob-size, 50%) * 0.9);
    bottom: -15%;
    left: 20%;
    animation: blob-move-3 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.5);
}

/* Blob 4 - Bas droite */
.gradient-blob.blob-4 {
    width: calc(var(--blob-size, 50%) * 0.7);
    height: calc(var(--blob-size, 50%) * 0.7);
    bottom: -10%;
    right: 10%;
    animation: blob-move-4 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.75);
}

/* Animations des blobs */
@keyframes blob-move-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(30%, 20%) scale(1.1) rotate(90deg);
    }
    50% {
        transform: translate(20%, 40%) scale(0.9) rotate(180deg);
    }
    75% {
        transform: translate(-10%, 20%) scale(1.05) rotate(270deg);
    }
}

@keyframes blob-move-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(-40%, 30%) scale(1.15) rotate(-90deg);
    }
    50% {
        transform: translate(-20%, 50%) scale(0.85) rotate(-180deg);
    }
    75% {
        transform: translate(10%, 20%) scale(1.1) rotate(-270deg);
    }
}

@keyframes blob-move-3 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(20%, -30%) scale(0.9) rotate(60deg);
    }
    50% {
        transform: translate(40%, -20%) scale(1.1) rotate(120deg);
    }
    75% {
        transform: translate(10%, -40%) scale(0.95) rotate(180deg);
    }
}

@keyframes blob-move-4 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(-30%, -20%) scale(1.1) rotate(-60deg);
    }
    50% {
        transform: translate(-10%, -40%) scale(0.9) rotate(-120deg);
    }
    75% {
        transform: translate(-40%, -10%) scale(1.05) rotate(-180deg);
    }
}

/* ========================
   STYLES AURORA
   ======================== */
.has-animated-gradient[data-gradient-style="aurora"] .gradient-blob {
    mix-blend-mode: screen;
}

/* ========================
   STYLES MESH
   ======================== */
.has-animated-gradient[data-gradient-style="mesh"] .gradient-blob {
    mix-blend-mode: soft-light;
    filter: blur(calc(var(--blur-amount, 80px) * 1.5));
}

/* ========================
   STYLES BLOB
   ======================== */
.has-animated-gradient[data-gradient-style="blob"] .gradient-blob {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    mix-blend-mode: normal;
    filter: blur(calc(var(--blur-amount, 80px) * 0.5));
}

.has-animated-gradient[data-gradient-style="blob"] .blob-1 {
    animation: blob-morph-1 var(--animation-speed, 20s) ease-in-out infinite;
}

.has-animated-gradient[data-gradient-style="blob"] .blob-2 {
    animation: blob-morph-2 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.33);
}

.has-animated-gradient[data-gradient-style="blob"] .blob-3 {
    animation: blob-morph-3 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.66);
}

@keyframes blob-morph-1 {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: translate(20%, 10%) rotate(90deg);
    }
    50% {
        border-radius: 50% 50% 30% 70% / 50% 70% 30% 50%;
        transform: translate(10%, 30%) rotate(180deg);
    }
    75% {
        border-radius: 30% 70% 70% 30% / 70% 30% 70% 30%;
        transform: translate(-10%, 15%) rotate(270deg);
    }
}

@keyframes blob-morph-2 {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        border-radius: 30% 70% 70% 30% / 30% 70% 30% 70%;
        transform: translate(-30%, 20%) rotate(120deg);
    }
    66% {
        border-radius: 70% 30% 30% 70% / 70% 30% 70% 30%;
        transform: translate(-15%, 40%) rotate(240deg);
    }
}

@keyframes blob-morph-3 {
    0%, 100% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        border-radius: 30% 70% 50% 50% / 60% 40% 60% 40%;
        transform: translate(30%, -20%) rotate(180deg);
    }
}

/* ========================
   STYLES WAVE
   ======================== */
.has-animated-gradient[data-gradient-style="wave"] .animated-gradient-bg {
    background-size: 400% 400%;
    animation: wave-gradient var(--animation-speed, 20s) ease infinite;
}

.has-animated-gradient[data-gradient-style="wave"] .gradient-blob {
    display: none;
}

@keyframes wave-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ========================
   STYLES RADIAL
   ======================== */
.has-animated-gradient[data-gradient-style="radial"] .gradient-blob {
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.has-animated-gradient[data-gradient-style="radial"] .blob-1 {
    animation: radial-pulse-1 var(--animation-speed, 20s) ease-in-out infinite;
}

.has-animated-gradient[data-gradient-style="radial"] .blob-2 {
    animation: radial-pulse-2 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.25);
}

.has-animated-gradient[data-gradient-style="radial"] .blob-3 {
    animation: radial-pulse-3 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.5);
}

.has-animated-gradient[data-gradient-style="radial"] .blob-4 {
    animation: radial-pulse-4 var(--animation-speed, 20s) ease-in-out infinite;
    animation-delay: calc(var(--animation-speed, 20s) * -0.75);
}

@keyframes radial-pulse-1 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: var(--blob-opacity, 0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: calc(var(--blob-opacity, 0.7) * 0.5);
    }
}

@keyframes radial-pulse-2 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: var(--blob-opacity, 0.7);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: calc(var(--blob-opacity, 0.7) * 0.6);
    }
}

@keyframes radial-pulse-3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: calc(var(--blob-opacity, 0.7) * 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: var(--blob-opacity, 0.7);
    }
}

@keyframes radial-pulse-4 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: calc(var(--blob-opacity, 0.7) * 0.9);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: calc(var(--blob-opacity, 0.7) * 0.4);
    }
}

/* ========================
   Z-INDEX DU CONTENU
   ======================== */
.has-animated-gradient > .elementor-container,
.has-animated-gradient > .elementor-widget-wrap,
.has-animated-gradient > .e-con-inner {
    position: relative;
    z-index: 1;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .gradient-blob {
        filter: blur(calc(var(--blur-amount, 80px) * 0.6));
    }
}

/* ========================
   ACCESSIBILITÉ
   ======================== */
@media (prefers-reduced-motion: reduce) {
    .gradient-blob {
        animation: none !important;
    }
    
    .has-animated-gradient[data-gradient-style="wave"] .animated-gradient-bg {
        animation: none !important;
    }
}
