/* ========================================
   ANIMACIONES Y EFECTOS ADICIONALES
   ======================================== */

/* Animación de carga elegante */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(210, 10, 17, 0.1);
    border-top-color: #D20A11;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Botón con efecto ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s, opacity 0.5s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* Efecto ripple para botones */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Efecto de hover en tarjetas mejorado */
.card-hover-effect {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.card-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(210, 10, 17, 0.1), transparent);
    transition: left 0.5s;
}

.card-hover-effect:hover::before {
    left: 100%;
}

/* Efecto de glow para elementos importantes */
.glow-effect {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(210, 10, 17, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(210, 10, 17, 0.6);
    }
}

/* Animación de entrada desde abajo */
.slide-in-bottom {
    animation: slideInBottom 0.6s ease-out;
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de entrada desde la izquierda */
.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animación de entrada desde la derecha */
.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animación de zoom in */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Efecto de shake para validaciones */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Gradiente animado de fondo */
.animated-gradient {
    background: linear-gradient(
        -45deg,
        #D20A11,
        #c21e2d,
        #1D1D1B,
        #3a3a3a
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Texto con efecto typewriter */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #D20A11;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #D20A11; }
}

/* Efecto de parallax simple */
.parallax-effect {
    transform: translateY(0);
    transition: transform 0.5s ease-out;
}

.parallax-effect.scrolled {
    transform: translateY(-20px);
}

/* Badge animado */
.badge-pulse {
    position: relative;
}

.badge-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(210, 10, 17, 0.4);
    border-radius: inherit;
    transform: translate(-50%, -50%);
    animation: pulseBadge 2s ease-out infinite;
}

@keyframes pulseBadge {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Línea divisoria animada */
.animated-divider {
    position: relative;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        #D20A11,
        transparent
    );
    background-size: 200% 100%;
    animation: moveDivider 3s ease-in-out infinite;
}

@keyframes moveDivider {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Efecto de hover en enlaces */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #D20A11;
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Contador animado */
.counter {
    font-size: 3rem;
    font-weight: bold;
    color: #D20A11;
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto de neon para títulos importantes */
.neon-text {
    color: #D20A11;
    text-shadow:
        0 0 5px #D20A11,
        0 0 10px #D20A11,
        0 0 20px #D20A11,
        0 0 40px #c21e2d,
        0 0 80px #c21e2d;
    animation: neonFlicker 3s ease-in-out infinite;
}

@keyframes neonFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 5px #D20A11,
            0 0 10px #D20A11,
            0 0 20px #D20A11,
            0 0 40px #c21e2d,
            0 0 80px #c21e2d;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Efecto de flotación suave */
.float-soft {
    animation: floatSoft 3s ease-in-out infinite;
}

@keyframes floatSoft {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Botón con efecto de presión */
.btn-press {
    transition: all 0.1s;
}

.btn-press:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Tarjeta con efecto flip */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Skeleton loader para carga de contenido */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Efecto de onda al hacer clic */
.wave-effect {
    position: relative;
    overflow: hidden;
}

.wave-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wave-effect:active::after {
    width: 500px;
    height: 500px;
}

/* Barra de progreso animada */
.progress-bar-animated {
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 30%;
    background: rgba(255, 255, 255, 0.3);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Efecto de máquina de escribir para inputs */
.input-typewriter {
    animation: inputBlink 1s step-end infinite;
}

@keyframes inputBlink {
    0%, 100% { border-color: #D20A11; }
    50% { border-color: transparent; }
}

/* Resplandor corporativo */
.corporate-glow {
    box-shadow: 
        0 0 10px rgba(210, 10, 17, 0.3),
        0 0 20px rgba(210, 10, 17, 0.2),
        0 0 30px rgba(210, 10, 17, 0.1);
    animation: corporateGlowPulse 3s ease-in-out infinite;
}

@keyframes corporateGlowPulse {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(210, 10, 17, 0.3),
            0 0 20px rgba(210, 10, 17, 0.2),
            0 0 30px rgba(210, 10, 17, 0.1);
    }
    50% {
        box-shadow: 
            0 0 15px rgba(210, 10, 17, 0.5),
            0 0 30px rgba(210, 10, 17, 0.3),
            0 0 45px rgba(210, 10, 17, 0.2);
    }
}

/* Utilidades de delay para animaciones */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Responsive - Deshabilitar algunas animaciones en móviles para mejor performance */
@media (max-width: 768px) {
    .animated-gradient {
        animation: none;
        background: linear-gradient(135deg, #D20A11 0%, #1D1D1B 100%);
    }
    
    .neon-text {
        animation: none;
        text-shadow: 0 0 10px rgba(210, 10, 17, 0.5);
    }
}
