/**
 * Animation des volcans d'Auvergne dans le footer
 * Style AL Metallerie Soudure - Animation subtile
 * 
 * @package ALMetallerie
 * @since 1.0.0
 */

/* ============================================
   CONTAINER DES MONTAGNES
   ============================================ */

.footer-mountains {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: visible;
    margin: 150px 0 0 0;
    padding: 0;
}

/* Dégradé de transition qui couvre le margin-top pour fondre avec le contenu */
.footer-mountains::before {
    content: '';
    position: absolute;
    top: -150px;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent 0%, #191919 100%);
    pointer-events: none;
    z-index: 0;
}

.footer-mountains svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Silhouette des montagnes */
.mountain-silhouette {
    fill: url(#mountainGradient);
    opacity: 1;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.footer-mountains:hover .mountain-silhouette {
    opacity: 0.9;
}

/* ============================================
   ANIMATION ÉRUPTION - SOMMET
   ============================================ */

/* Point d'éruption (sommet du Puy de Dôme) */
.eruption-point {
    position: absolute;
    top: 5%;
    left: 51.5%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    z-index: 2;
}

/* Lueur au sommet - pulsation subtile */
.eruption-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, 
        rgba(240, 139, 24, 0.4) 0%, 
        rgba(240, 139, 24, 0.2) 30%, 
        transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* ============================================
   PARTICULES D'ÉRUPTION
   ============================================ */

.eruption-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    bottom: 0; /* Position initiale fixe */
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleRise 4s ease-out infinite;
    box-shadow: 0 0 6px rgba(240, 139, 24, 0.6);
    will-change: transform, opacity; /* Optimisation GPU */
}

/* Particule 1 */
.particle:nth-child(1) {
    left: 50%;
    animation-delay: 0s;
}

/* Particule 2 */
.particle:nth-child(2) {
    left: 48%;
    animation-delay: 0.8s;
}

/* Particule 3 */
.particle:nth-child(3) {
    left: 52%;
    animation-delay: 1.6s;
}

/* Particule 4 */
.particle:nth-child(4) {
    left: 49%;
    animation-delay: 2.4s;
}

/* Particule 5 */
.particle:nth-child(5) {
    left: 51%;
    animation-delay: 3.2s;
}

/* Animation de montée des particules - Utilise transform pour GPU compositing */
@keyframes particleRise {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) scale(1);
    }
    10% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.6;
        transform: translateX(var(--drift, 0px)) translateY(-40px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateX(var(--drift, 0px)) translateY(-80px) scale(0.3);
    }
}

/* Variation de dérive horizontale pour chaque particule */
.particle:nth-child(1) { --drift: -8px; }
.particle:nth-child(2) { --drift: 5px; }
.particle:nth-child(3) { --drift: -3px; }
.particle:nth-child(4) { --drift: 10px; }
.particle:nth-child(5) { --drift: -6px; }

/* ============================================
   FUMÉE SUBTILE
   ============================================ */

.eruption-smoke {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.smoke-puff {
    position: absolute;
    bottom: 0; /* Position initiale fixe */
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, 
        rgba(240, 139, 24, 0.15) 0%, 
        rgba(240, 139, 24, 0.05) 50%, 
        transparent 100%);
    border-radius: 50%;
    opacity: 0;
    animation: smokeRise 6s ease-out infinite;
    will-change: transform, opacity; /* Optimisation GPU */
}

.smoke-puff:nth-child(1) {
    left: 50%;
    animation-delay: 0s;
}

.smoke-puff:nth-child(2) {
    left: 48%;
    animation-delay: 2s;
}

.smoke-puff:nth-child(3) {
    left: 52%;
    animation-delay: 4s;
}

/* Animation de fumée - Utilise transform pour GPU compositing */
@keyframes smokeRise {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) scale(0.5);
    }
    20% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateX(20px) translateY(-100px) scale(2);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .footer-mountains {
        height: 100px;
    }
    
    .footer-mountains::before {
        top: -100px;
        height: 100px;
    }
    
    .eruption-point {
        width: 20px;
        height: 20px;
    }
    
    .eruption-glow {
        width: 30px;
        height: 30px;
    }
    
    .particle {
        width: 3px;
        height: 3px;
    }
}

@media (max-width: 480px) {
    .footer-mountains {
        height: 60px;
    }
    
    .footer-mountains::before {
        top: -80px;
        height: 80px;
    }
    
    .eruption-glow {
        width: 20px;
        height: 20px;
    }
    
    .particle {
        width: 2px;
        height: 2px;
    }
}

/* ============================================
   COULÉES DE LAVE
   ============================================ */

.lava-flows {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 60px;
    height: 80px;
    pointer-events: none;
}

.lava-flow {
    position: absolute;
    top: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, 
        rgba(240, 139, 24, 0.9) 0%, 
        rgba(255, 80, 20, 0.6) 40%, 
        rgba(240, 139, 24, 0.2) 80%, 
        transparent 100%);
    border-radius: 2px;
    animation: lavaFlow 4s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(240, 139, 24, 0.4);
}

.lava-flow-1 {
    left: 45%;
    animation-delay: 0s;
    --lava-height: 50px;
    --lava-drift: -8px;
}

.lava-flow-2 {
    left: 55%;
    animation-delay: 1.5s;
    --lava-height: 40px;
    --lava-drift: 6px;
}

.lava-flow-3 {
    left: 50%;
    animation-delay: 3s;
    --lava-height: 60px;
    --lava-drift: -3px;
}

@keyframes lavaFlow {
    0% {
        height: 0;
        opacity: 0;
        transform: translateX(0);
    }
    15% {
        opacity: 0.9;
    }
    50% {
        height: var(--lava-height, 50px);
        opacity: 0.7;
        transform: translateX(var(--lava-drift, 0px));
    }
    100% {
        height: var(--lava-height, 50px);
        opacity: 0;
        transform: translateX(var(--lava-drift, 0px));
    }
}

/* Couche arrière des montagnes */
.mountain-back {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.mountain-front {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* ============================================
   EFFETS AU SURVOL (subtil)
   ============================================ */

.footer-mountains:hover .particle {
    animation-duration: 3.5s;
}

.footer-mountains:hover .eruption-glow {
    animation-duration: 2.5s;
}

.footer-mountains:hover .lava-flow {
    animation-duration: 3s;
}
