/* Animaciones y efectos visuales para SocioDigital */

/* Animaciones de entrada */
@keyframes fadeInUp {
    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 float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: #007bff;
    }
}

/* Partículas flotantes de fondo */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particles * {
    pointer-events: none;
}

.particle {
    position: absolute;
    background: linear-gradient(45deg, #007bff, #00d4ff);
    border-radius: 50%;
    opacity: 0.1;
    animation: floatParticle 6s infinite ease-in-out;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* Efectos en elementos específicos */
.hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(0, 123, 255, 0.05), transparent);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

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

.hero h1 {
    overflow: hidden;
    border-right: 3px solid #007bff;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3s steps(40, end), blink 1s infinite;
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

/* Animaciones para servicios */
.service-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.service-item.animate {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease forwards;
}

.service-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.2);
}

.service-item:hover .service-img {
    animation: pulse 1s infinite;
}

/* Efectos en botones */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

/* Navegación con efectos */
.navbar {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-links a {
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: #007bff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-links a:hover {
    color: #007bff;
    transform: translateY(-2px);
}

/* Logo con animación */
.logo img {
    transition: all 0.3s ease;
}

.logo:hover img {
    transform: scale(1.1) rotate(5deg);
}

/* Secciones con animación de scroll */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Efectos en el chatbot */
#chatbot-btn {
    animation: float 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

#chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

/* Responsive para animaciones */
@media (max-width: 768px) {
    .hero h1 {
        white-space: normal;
        border-right: none;
        animation: fadeInUp 1s ease;
    }
    
    .particle {
        display: none;
    }
}

/* Asegurar que el menú móvil funcione correctamente */
@media (max-width: 700px) {
    .hero::before {
        animation: none;
    }
    
    .nav-links.open {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Efecto ripple para botones */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.service-img {
    transition: all 0.3s ease;
}

/* Mejoras adicionales de hover */
.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 123, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

/* Preservar saltos de línea en mensajes del chatbot */
.bot-msg {
    white-space: pre-wrap;
    word-wrap: break-word;
} 