/* planeAnimation.css - Estilos para la animación del avión MEJORADA */

/* === Contenedor principal === */
.plane-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(to bottom, #000000 0%, #0a0a0a 100%);
    opacity: 0;
    transition: opacity 1s ease-in;
}

.plane-container.visible {
    opacity: 1;
}

/* === VIGNETTE (se cierra al acelerar) === */
.plane-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.6s ease-in;
    pointer-events: none;
    z-index: 5;
}

.plane-container.vignette-active::before {
    opacity: 1;
}

/* === SCREEN SHAKE === */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-4px, 2px); }
    20% { transform: translate(4px, -2px); }
    30% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    50% { transform: translate(-4px, -2px); }
    60% { transform: translate(4px, 2px); }
    70% { transform: translate(-3px, -3px); }
    80% { transform: translate(3px, 3px); }
    90% { transform: translate(-2px, 2px); }
}

.plane-container.screen-shake {
    animation: screenShake 0.3s ease-in-out;
}

/* === Título AERO STADIUM === */
.plane-title-wrapper {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 50%;
    max-width: 600px;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    filter: blur(20px) brightness(3);
}

.plane-title-wrapper.visible {
    animation: titleMaterialize 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes titleMaterialize {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
        filter: blur(20px) brightness(3);
    }
    60% {
        opacity: 1;
        filter: blur(5px) brightness(1.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(0px) brightness(1);
    }
}

.title-engine-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.title-engine {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.title-propeller {
    position: absolute;
    width: 4em;
    height: 4em;
    z-index: 2;
    animation: titlePropellerSpin 1.7s linear infinite;
    transform-origin: 50% 50%;  
}

@keyframes titlePropellerSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.plane-title {
    position: relative;
    width: 100%;
    display: block;
}

/* === Contenedor para avión + hélice === */
.plane-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/* === Imagen del avión === */
.plane-image {
    position: relative;
    width: 60%;
    max-width: 500px;
    z-index: 2;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease-out;
}

/* === Hélice (imagen PNG) === */
.propeller-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-3%);
    width: 130px;
    height: 130px;
    z-index: 3;
    pointer-events: none;
}

/* === GLOW del motor (se intensifica al acelerar) === */
.propeller-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 200, 100, 0.6) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.propeller-image.max-speed::before {
    opacity: 1;
    animation: engineGlow 0.3s ease-in-out infinite;
}

@keyframes engineGlow {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* === Clase para activar el giro === */
.propeller-image.spinning {
    animation: propellerSpinContinuous 0.1s linear infinite;
}

/* === Animación continua y rápida === */
@keyframes propellerSpinContinuous {
    from {
        transform: translate(-50%, -50%) translateY(-3%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) translateY(-3%) rotate(360deg);
    }
}

/* === Vibración SUAVE del avión al arrancar === */
.plane-image.vibrating-start {
    animation: planeVibrationStart 0.1s ease-in-out infinite;
}

@keyframes planeVibrationStart {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 0.5px); }
    50% { transform: translate(1px, -0.5px); }
    75% { transform: translate(-0.5px, 1px); }
    100% { transform: translate(0, 0); }
}

/* === Vibración INTENSA del avión a máxima velocidad === */
.plane-image.vibrating {
    animation: planeVibration 0.15s ease-in-out infinite;
}

@keyframes planeVibration {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-2px, 1px); }
    20% { transform: translate(2px, -1px); }
    30% { transform: translate(-1px, 2px); }
    40% { transform: translate(1px, -2px); }
    50% { transform: translate(-2px, -1px); }
    60% { transform: translate(2px, 1px); }
    70% { transform: translate(-1px, -2px); }
    80% { transform: translate(1px, 2px); }
    90% { transform: translate(-2px, 1px); }
    100% { transform: translate(0, 0); }
}

/* === ANTICIPACIÓN: wrapper se aleja suavemente antes del zoom === */
@keyframes wrapperAnticipation {
    0% { 
        transform: translate(0, 0) scale(1); 
    }
    100% { 
        transform: translate(0, -50px) scale(0.85); 
    }
}

@keyframes planeAnticipation {
    0% { 
        transform: translate(0, 0) scale(1); 
    }
    100% { 
        transform: translate(0, -50px) scale(0.85); 
    }
}

.plane-wrapper.anticipating {
    animation: wrapperAnticipation 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.plane-image.anticipating {
    animation: none !important;
}

/* === ANIMACIÓN DE ZOOM EXPLOSIVO CON ROTACIÓN === */
@keyframes wrapperZoomAttack {
    0% {
        transform: translate(0, -50px) scale(0.85);
    }
    100% {
        transform: translate(0, 0) scale(8);
    }
}

@keyframes planeZoomAttack {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5)) blur(0px);
    }
    30% {
        filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.7)) blur(1px);
    }
    100% {
        transform: translate(0, 0) scale(1) rotate(-8deg);
        filter: drop-shadow(0 50px 100px rgba(0, 0, 0, 0.9)) blur(4px);
    }
}

/* Clases para el zoom */
.plane-wrapper.zooming {
    animation: wrapperZoomAttack 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards !important;
}

.plane-image.zooming {
    animation: planeZoomAttack 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards !important;
}

/* === FLASH BLANCO === */
.white-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 1) 0%, rgba(255, 200, 100, 0.8) 40%, transparent 70%);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.white-flash.active {
    animation: flashEffect 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes flashEffect {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}

/* Ocultar después del zoom */
.plane-wrapper.zoom-complete,
.plane-image.zoom-complete,
.propeller-image.zoom-complete {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

/* === BOTÓN ENCENDER MOTORES === */
@import url('https://fonts.googleapis.com/css2?family=Playfair:ital,opsz,wght@0,5..1200,300..900;1,5..1200,300..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
.start-button-container {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.start-button-container.visible {
    opacity: 1;
    visibility: visible;
}

.start-button {    
    color: white;
    font-family: "Playfair", serif;
     font-family: "Ubuntu", sans-serif;
    font-size: 1.5em; 
    text-transform: uppercase;
    padding: 20px 40px;
    border: 4px solid #000;
    border-radius: 15px;
    cursor: pointer; 
    transition: all 0.3s ease;  
    border: solid 1px;
    background: none; 
    font-weight: 300;
    white-space: nowrap;
}

.start-button:active {
    transform: scale(0.95);
}

.start-button.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* === SISTEMA DE PARTÍCULAS MEJORADO === */
.wind-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Partículas de vapor/estela */
.wind-particle {
    position: absolute;
    background: radial-gradient(ellipse 60% 40%, rgba(255, 255, 255, 0.9) 0%, rgba(200, 220, 255, 0.6) 30%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(3px);
}

/* Partículas con trail (dejan rastro) */
.wind-particle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 60%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    opacity: 0.5;
}

/* Chispas ocasionales */
.spark-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 200, 100, 1) 0%, rgba(255, 150, 50, 0.8) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(1px);
    box-shadow: 0 0 10px rgba(255, 200, 100, 0.8);
}

/* Animación de partículas lentas (inicio) */
@keyframes particleMoveSlow {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0.2);
        opacity: 0;
    }
}

/* Animación de partículas rápidas (máxima velocidad) */
@keyframes particleMoveFast {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0.1) rotate(var(--rotation, 0deg));
        opacity: 0;
    }
}

/* Animación de chispas */
@keyframes sparkMove {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.wind-particle.slow {
    animation: particleMoveSlow 2s ease-out forwards;
}

.wind-particle.fast {
    animation: particleMoveFast 0.35s ease-out forwards;
    background: radial-gradient(ellipse 70% 50%, 
        rgba(255, 255, 255, 0.98) 0%,      /* núcleo casi blanco puro */
        rgba(230, 245, 255, 0.9) 35%, 
        rgba(200, 230, 255, 0.6) 60%, 
        transparent 85%);
}

.spark-particle {
    animation: sparkMove 0.6s ease-out forwards;
}

/* === Ajustes para móviles === */
@media (max-width: 768px) {
    .plane-title-wrapper {
        width: 80%;
        top: 42%;
        gap: 15px;
    }

    .title-engine-container {
        width: 45px;
        height: 45px;
    }

    .plane-image {
        width: 93%;
    }

    .propeller-image {
        width: 110px;
        height: 110px;
    }

    .start-button-container {
        bottom: 8%;
        transform: translateX(-50%) scale(0.85);
    }

    .start-button {
        font-size: 1.2em;
        padding: 15px 30px;
    }
}

/* === Ajustes para tablets === */
@media (min-width: 769px) and (max-width: 1024px) {
    .plane-title-wrapper {
        width: 60%;
        top: 32%;
    }

    .title-engine-container {
        width: 52px;
        height: 52px;
    }

    .plane-image {
        width: 65%;
    }

    .propeller-image {
        width: 110px;
        height: 110px;
    }

    .start-button-container {
        bottom: 10%;
    }

    .start-button {
        font-size: 1.4em;
    }
}

/* === Ajustes para desktop === */
@media (min-width: 1025px) {
    .plane-title-wrapper { 
        width: 45%;
        top: 32%;
    }

    .title-engine-container {
        width: 60px;
        height: 60px;
    }

    .plane-image {
        width: 55%;
    }

    .propeller-image {
        width: 130px;
        height: 130px;
    }

    .start-button {
        font-size: 1.5em;
    }
}

/* === Ocultar elementos al hacer scroll === */
.plane-container.hidden-on-scroll {
    opacity: 0;
    display: none;
    transition: opacity 0.5s ease-out;
}
