/* ==========================================
   ANIMATIONS.CSS - Animaciones y efectos
========================================== */

/* Keyframes principales */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    50% { transform: translateY(-15px) rotate(-1deg); }
    75% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(74, 144, 226, 0.6);
    }
}

/* Clases de animación */
.animate-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-right {
    animation: fadeInRight 0.8s ease-out;
}

.animate-scale {
    animation: scaleIn 0.6s ease-out;
}

/* Efectos hover mejorados */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(74, 144, 226, 0.2);
}

.service-card:hover .card-icon {
    animation: pulse 2s infinite;
}

/* Modal de servicios */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.service-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.service-modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-content h3 {
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content h4 {
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
}

.modal-content ul {
    list-style: none;
    margin-bottom: 2rem;
}

.modal-content ul li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.modal-content ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    flex: 1;
    text-align: center;
}

/* Efectos de carga */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Partículas personalizadas */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Efectos de texto typewriter */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-blue);
    white-space: nowrap;
    margin: 0 auto;
    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: var(--accent-blue); }
}

/* Mejoras responsive para animaciones */
@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
        margin: 20px;
        max-height: 90vh;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .card-float {
        display: none; /* Ocultar en móviles para mejor rendimiento */
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estados de carga y error */
.error-state {
    color: #ff6b6b;
    text-align: center;
    padding: 2rem;
}

.success-state {
    color: #4CAF50;
    text-align: center;
    padding: 1rem;
}

/* Efectos adicionales para elementos interactivos */
.interactive-element {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.interactive-element:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.interactive-element:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
}