/* ============================================
   ANIMACIONES AVANZADAS - PORTAL MEJORADO
   ============================================ */

/* Partículas animadas en hero */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.particles span {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: float-particles calc(4s * var(--i)) linear infinite;
    top: calc(-30px - (25px * var(--i)));
    left: calc((100% / 10) * var(--i));
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

@keyframes float-particles {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(120vh) rotate(720deg);
        opacity: 0;
    }
}

/* Efecto wave mejorado */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    animation: wave-hero 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes wave-hero {
    0%, 100% { 
        transform: translateX(-50%) translateY(0) rotate(0deg);
        opacity: 0.5;
    }
    50% { 
        transform: translateX(50%) translateY(-30px) rotate(8deg);
        opacity: 0.8;
    }
}

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

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

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

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

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

@keyframes bounceIn {
    0% { 
        transform: scale(0); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.15); 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
    }
    50% {
        box-shadow: 0 8px 35px rgba(30, 64, 175, 0.6);
    }
}

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

@keyframes shine {
    0% { 
        transform: translateX(-100%) translateY(-100%) rotate(45deg); 
    }
    100% { 
        transform: translateX(100%) translateY(100%) rotate(45deg); 
    }
}

/* Aplicar animaciones a elementos */
.hero-title {
    animation: fadeInDown 1s ease-out !important;
}

.mision-box {
    animation: fadeInUp 1s ease-out 0.2s !important;
    animation-fill-mode: both !important;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.4s !important;
    animation-fill-mode: both !important;
}

.hero-image {
    animation: fadeInRight 1s ease-out 0.3s !important;
    animation-fill-mode: both !important;
}

.team-photo {
    animation: float 4s ease-in-out infinite !important;
}

.hero-stats {
    animation: fadeInUp 1s ease-out 0.6s !important;
    animation-fill-mode: both !important;
}

/* Stat cards con animación */
.stat-card {
    animation: bounceIn 0.8s ease-out !important;
    animation-fill-mode: both !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.stat-card:nth-child(1) { animation-delay: 0.7s !important; }
.stat-card:nth-child(2) { animation-delay: 0.85s !important; }
.stat-card:nth-child(3) { animation-delay: 1s !important; }

.stat-card:hover {
    transform: translateY(-15px) scale(1.05) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2) !important;
}

.stat-card i {
    animation: float 3s ease-in-out infinite !important;
}

/* Service cards con efectos avanzados */
.service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0) 0%, rgba(14, 165, 233, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: rotate(45deg);
    animation: shine 4s ease-in-out infinite;
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02) !important;
    box-shadow: 0 25px 50px rgba(30, 64, 175, 0.25) !important;
}

.service-card .card-icon {
    transition: all 0.4s !important;
}

.service-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg) !important;
}

.service-card:hover .card-icon i {
    animation: pulse-rotate 1s ease-in-out infinite !important;
}

@keyframes pulse-rotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

/* Botones mejorados */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary {
    animation: pulse-glow 2.5s ease-in-out infinite !important;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.5) !important;
}

/* Navegación mejorada */
.company-logo {
    transition: transform 0.4s !important;
    animation: float 4s ease-in-out infinite !important;
}

.company-logo:hover {
    transform: scale(1.1) rotate(5deg) !important;
}

.nav-link {
    position: relative;
    transition: all 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Footer mejorado */
.footer-logo {
    animation: float 3s ease-in-out infinite !important;
}

/* Efectos de hover en iconos */
.card-icon i,
.contact-info i,
.footer-section i {
    transition: all 0.3s;
}

.service-card:hover .card-icon i,
.contact-info:hover i {
    filter: drop-shadow(0 0 8px currentColor);
}

/* Scroll reveal para elementos */
.services-grid > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards !important;
}

.services-grid > *:nth-child(1) { animation-delay: 0.1s !important; }
.services-grid > *:nth-child(2) { animation-delay: 0.2s !important; }
.services-grid > *:nth-child(3) { animation-delay: 0.3s !important; }
.services-grid > *:nth-child(4) { animation-delay: 0.4s !important; }
.services-grid > *:nth-child(5) { animation-delay: 0.5s !important; }
.services-grid > *:nth-child(6) { animation-delay: 0.6s !important; }

/* Efecto ripple en botones */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    width: 100px;
    height: 100px;
    margin-top: -50px;
    margin-left: -50px;
    animation: ripple-effect 0.6s;
    opacity: 0;
    pointer-events: none;
}

@keyframes ripple-effect {
    from {
        opacity: 1;
        transform: scale(0);
    }
    to {
        opacity: 0;
        transform: scale(4);
    }
}
