/* ==========================================================================
   TransferMobil - Animaciones y Efectos
   ========================================================================== */

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animaciones de elementos flotantes */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* Animaciones de pulso */
@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@keyframes pulseGreen {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes pulseButton {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

/* Animaciones de rotación */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animaciones de gradiente */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes gradientPulse {
    0%, 100% {
        background-size: 100% 100%;
    }
    50% {
        background-size: 110% 110%;
    }
}

/* Animaciones de texto */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.6);
    }
}

/* Animaciones de hover */
@keyframes hoverLift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-5px);
    }
}

@keyframes hoverGlow {
    from {
        box-shadow: 0 0 0 rgba(0, 255, 136, 0);
    }
    to {
        box-shadow: 0 10px 25px rgba(0, 255, 136, 0.3);
    }
}

@keyframes hoverScale {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Animaciones de loading */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes loadingBars {
    0%, 40%, 100% {
        transform: scaleY(0.4);
        opacity: 0.5;
    }
    20% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Animaciones de reveal */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animaciones de expansión */
@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes expandHeight {
    from {
        height: 0;
    }
    to {
        height: auto;
    }
}

@keyframes expandScale {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Clases de utilidad para animaciones */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-floatSlow {
    animation: floatSlow 8s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 4s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 4s ease-in-out infinite;
}

.animate-pulseGreen {
    animation: pulseGreen 2s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 20s linear infinite;
}

.animate-rotateReverse {
    animation: rotateReverse 15s linear infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-gradientShift {
    background: linear-gradient(45deg, var(--primary-green), var(--primary-purple), var(--primary-green));
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.animate-textGlow {
    animation: textGlow 2s ease-in-out infinite;
}

/* Animaciones con delay */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-400 {
    animation-delay: 0.4s;
}

.animate-delay-500 {
    animation-delay: 0.5s;
}

/* Animaciones de hover para elementos interactivos */
.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.3);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Animaciones de loading específicas */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 136, 0.3);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.loading-dots div {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }

.loading-bars {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: flex-end;
    height: 20px;
}

.loading-bars div {
    width: 4px;
    background: var(--primary-green);
    animation: loadingBars 1.2s ease-in-out infinite;
}

.loading-bars div:nth-child(1) { animation-delay: -1.1s; }
.loading-bars div:nth-child(2) { animation-delay: -1.0s; }
.loading-bars div:nth-child(3) { animation-delay: -0.9s; }

/* Animaciones de progreso */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    animation: progressFill 2s ease-out;
}

/* Animaciones de notificación */
@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutNotification {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-enter {
    animation: slideInNotification 0.3s ease-out;
}

.notification-exit {
    animation: slideOutNotification 0.3s ease-in;
}

/* Animaciones de modal */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.modal-enter {
    animation: modalFadeIn 0.3s ease-out;
}

.modal-exit {
    animation: modalFadeOut 0.3s ease-in;
}

/* Animaciones de elementos específicos de contacto */
@keyframes contactCardReveal {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.contact-card-animated {
    animation: contactCardReveal 0.6s ease-out;
}

.contact-card-animated:nth-child(1) { animation-delay: 0.1s; }
.contact-card-animated:nth-child(2) { animation-delay: 0.2s; }
.contact-card-animated:nth-child(3) { animation-delay: 0.3s; }
.contact-card-animated:nth-child(4) { animation-delay: 0.4s; }
.contact-card-animated:nth-child(5) { animation-delay: 0.5s; }
.contact-card-animated:nth-child(6) { animation-delay: 0.6s; }

/* Animaciones de FAQ */
@keyframes faqExpand {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 200px;
        opacity: 1;
    }
}

@keyframes faqCollapse {
    from {
        max-height: 200px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

.faq-answer.expanding {
    animation: faqExpand 0.3s ease-out;
}

.faq-answer.collapsing {
    animation: faqCollapse 0.3s ease-in;
}

/* Animaciones de formulario */
@keyframes formFieldFocus {
    from {
        border-color: rgba(0, 0, 0, 0.2);
        box-shadow: none;
    }
    to {
        border-color: var(--primary-green);
        box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.1);
    }
}

.form-field-focus {
    animation: formFieldFocus 0.2s ease-out;
}

/* Animaciones de success/error */
@keyframes successPulse {
    0% {
        background: rgba(0, 255, 136, 0.1);
        border-color: rgba(0, 255, 136, 0.3);
    }
    50% {
        background: rgba(0, 255, 136, 0.2);
        border-color: rgba(0, 255, 136, 0.5);
    }
    100% {
        background: rgba(0, 255, 136, 0.1);
        border-color: rgba(0, 255, 136, 0.3);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

.error-animation {
    animation: errorShake 0.5s ease-in-out;
}

/* Animaciones de parallax suave */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

.parallax-element {
    animation: parallaxFloat 12s ease-in-out infinite;
}

/* Animaciones de typing effect */
@keyframes typingCursor {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.typing-cursor::after {
    content: '|';
    animation: typingCursor 1s infinite;
    color: var(--primary-green);
}

/* Animaciones de countdown */
@keyframes countdown {
    from {
        transform: scale(1.2);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.countdown-animation {
    animation: countdown 1s ease-out;
}

/* Optimizaciones de rendimiento */
.hardware-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Media queries para animaciones reducidas */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-float,
    .animate-floatSlow,
    .animate-bounce,
    .animate-pulse,
    .animate-pulseGreen,
    .animate-rotate,
    .animate-rotateReverse,
    .animate-spin,
    .animate-gradientShift,
    .animate-textGlow,
    .parallax-element {
        animation: none !important;
    }
}

/* Clases de utilidad para control de animaciones */
.animation-paused {
    animation-play-state: paused;
}

.animation-running {
    animation-play-state: running;
}

.no-animation {
    animation: none !important;
    transition: none !important;
}

/* Animaciones específicas para elementos hero */
.hero-element-1 {
    animation: fadeInLeft 1s ease-out 0.2s both;
}

.hero-element-2 {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-element-3 {
    animation: fadeInRight 1s ease-out 0.6s both;
}

.hero-element-4 {
    animation: scaleIn 1s ease-out 0.8s both;
}