/* 
 * Minimal Performance-Optimized Animations
 * Uses CSS transforms and opacity for GPU acceleration
 * No JavaScript required - pure CSS
 */

/* ============================================
   FADE IN ANIMATIONS (On Page Load)
   ============================================ */

/* Fade in from bottom - for cards and sections */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays for multiple items */
.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up:nth-child(5) { animation-delay: 0.5s; }
.fade-in-up:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   HOVER ANIMATIONS (Interactive)
   ============================================ */

/* Smooth lift effect for cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Subtle scale for buttons */
.hover-scale {
    transition: transform 0.2s ease;
    will-change: transform;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Smooth color transition */
.hover-color {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* ============================================
   PRODUCT CARD ANIMATIONS
   ============================================ */

.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.product-card img {
    transition: transform 0.4s ease;
    will-change: transform;
}

.product-card:hover img {
    transform: scale(1.08);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

/* Skeleton loading for images */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spinner for loading states */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   BADGE ANIMATIONS
   ============================================ */

.badge-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* ============================================
   NOTIFICATION SLIDE IN
   ============================================ */

.notification-slide {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   HERO SLIDER FADE
   ============================================ */

.hero-slide {
    animation: heroFade 0.8s ease-in-out;
}

@keyframes heroFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU acceleration hints */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Quick fade in */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Smooth transitions */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .fade-in-up {
        animation-duration: 0.4s;
    }
    
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    .product-card:hover {
        transform: translateY(-4px);
    }
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */

*:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    transition: outline-offset 0.2s ease;
}

/* ============================================
   IMAGE LAZY LOAD FADE
   ============================================ */

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
