/* ===== ANIMACIONES Y EFECTOS VISUALES MEJORADOS ===== */

/* 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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Clases para elementos observados */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animate {
    opacity: 1;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.slide-in-top {
    animation: slideInFromTop 0.8s ease-out forwards;
}

/* Efectos de parallax deshabilitado temporalmente para el slider */
.parallax-container {
    position: relative;
    overflow: hidden;
    height: 100vh;
    min-height: 600px;
}

.parallax-element {
    /* Parallax deshabilitado para solucionar conflicto con slider */
    /* transition: transform 0.1s ease-out;
    will-change: transform;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    height: 110%;
    width: 100%;
    position: absolute;
    top: -5%; */
}

/* Asegurar que las imágenes se vean bien en móviles */
@media (max-width: 768px) {
    .parallax-element {
        /* background-attachment: scroll;
        height: 105%;
        top: -2.5%; */
    }
}

/* Animaciones para el slider mejorado */
.slider {
    position: relative;
    overflow: hidden;
}

.slide {
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 0, 68, 0.1), rgba(0, 0, 0, 0.3));
    transition: all 0.6s ease;
    z-index: 1;
}

.slide:hover::before {
    background: linear-gradient(45deg, rgba(255, 0, 68, 0.15), rgba(0, 0, 0, 0.2));
}

.text-content {
    position: relative;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

/* Indicadores del slider */
.slider-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.indicator.active {
    background: var(--primary-color);
    border-color: white;
    transform: scale(1.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

/* Controles del slider */
.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
}

.slider-controls:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: 30px;
}

.next {
    right: 30px;
}

/* Progress bar para scroll */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #ff6b9d);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Mejorado botón back to top */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(255, 0, 68, 0.3);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

#back-to-top:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 68, 0.4);
}

/* Efecto de carga */
.loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: loadingDots 1.4s infinite;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animaciones para elementos al hacer hover */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Efecto de brillo sutil */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.shine-effect:hover::before {
    left: 100%;
}

/* Responsive animations */
@media (max-width: 768px) {
    .slider-controls {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .prev {
        left: 15px;
    }
    
    .next {
        right: 15px;
    }
    
    .slider-indicators {
        bottom: 20px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
}

/* Reduce motion para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
}

/* Estilos para validación de formularios */
.modal input.valid {
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.modal input.invalid {
    border-color: #f44336;
    box-shadow: 0 0 5px rgba(244, 67, 54, 0.3);
}

.validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
}

.form-error {
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.loading-spinner-inline {
    display: inline-flex;
    gap: 5px;
    margin-right: 10px;
}

.loading-spinner-inline .loading-dot {
    width: 6px;
    height: 6px;
}

/* Prevenir clics durante transiciones de modal */
.modal-overlay.closing {
    pointer-events: none;
}

.modal-overlay.opening {
    pointer-events: auto;
}

/* Mejorar la cruz de cierre */
.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    z-index: 1002;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    transform: scale(1.1);
}