/* Animaciones para elementos al hacer scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animaciones escalonadas para elementos en lista */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }
.fade-in:nth-child(5) { transition-delay: 0.5s; }

/* Animación de pulso para elementos importantes */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Animación de entrada para el video */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sticky-video .fade-in.visible {
    animation: slideInFromRight 0.6s ease-out;
}

/* ================================
   ANIMACIONES DEL MODAL
   ================================ */

/* Animación de fade para el overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Animación de slide up para el contenido del modal */
@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(50px);
        opacity: 0;
    }
}

/* Aplicar animaciones al modal */
.modal-overlay.show {
    animation: fadeIn 0.3s ease forwards;
}

.modal-overlay:not(.show) {
    animation: fadeOut 0.3s ease forwards;
}

.modal-overlay.show .modal-content {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal-overlay.closing .modal-content {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animación para los operadores */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.operator-tag.fade-in.visible {
    animation: bounceIn 0.6s ease-out;
}

/* Animación para las tarjetas de planes */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.plan-card.fade-in.visible {
    animation: cardAppear 0.5s ease-out;
}

/* Efecto de sombra animada para las tarjetas */
@keyframes shadowFloat {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
}

.plan-card:hover {
    animation: shadowFloat 3s ease-in-out infinite;
}

/* Animación para el botón de contacto */
@keyframes buttonShine {
    0% {
        background-position: -100px;
    }
    40%, 100% {
        background-position: 140px;
    }
}

.contact-button {
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200px 100%;
    animation: buttonShine 3s infinite linear;
}