/* 
 * QR Menu System - Animations CSS
 * Contains all animation-related styles for the QR Menu System
 */

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Zoom animations */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Spin animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* Page transition animations */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Staggered animation for list items */
.stagger-item {
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--pure-white);
    animation: spin 1s ease-in-out infinite;
    margin: 40px auto;
}

.loading-spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

.loading-spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 5px;
}

/* Button spinner */
.button-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--pure-white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Image loading fade-in */
img {
    opacity: 1;
    transition: opacity 0.5s ease;
}

img.loaded {
    opacity: 1;
}

/* Image zoom effect */
.product-image img.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

.product-image img:not(.zoomed) {
    cursor: zoom-in;
}

/* Hover animations */
.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
}

.category-card img {
    transition: transform 0.5s ease;
}

.product-item {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.language-btn, .back-btn {
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Button active state */
.language-btn:active, .back-btn:active, .btn:active {
    transform: scale(0.95);
}

/* Pulse animation class */
.pulse {
    animation: pulse 2s infinite;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    
    .stagger-item {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .loading-spinner, .button-spinner {
        animation: none !important;
    }
    
    .pulse {
        animation: none !important;
    }
}
