/* Animations */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
    will-change: opacity;
}

.animate-slideUp {
    animation: slideUp 0.4s ease-out;
    will-change: transform, opacity;
}

.animate-slideDown {
    animation: slideDown 0.4s ease-out;
    will-change: transform, opacity;
}

.animate-scaleIn {
    animation: scaleIn 0.4s ease-out;
    will-change: transform, opacity;
}

.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
    will-change: transform;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
    will-change: transform;
}

.animate-shake {
    animation: shake 0.5s;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hover-scale {
    transition: transform 0.2s ease-out;
    will-change: transform;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-rotate {
    transition: transform var(--transition-smooth);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--color-primary-200);
    border-top-color: var(--color-primary-600);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: var(--z-maximum);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* WhatsApp Button Animation */
.whatsapp-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-smooth);
    z-index: var(--z-sticky);
    opacity: 0;
    transform: translateY(20px);
}

.whatsapp-button.visible {
    opacity: 1;
    transform: translateY(0);
}

.whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.whatsapp-button i {
    animation: pulse 2s infinite;
    will-change: transform;
}

/* Page Transitions */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: var(--z-maximum);
    pointer-events: none;
    transform-origin: bottom;
    animation: pageTransition 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform;
}

@keyframes pageTransition {
    from {
        transform: scaleY(1);
    }
    to {
        transform: scaleY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .whatsapp-button {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 16px;
        right: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
} 