﻿/* ThreeGigs v25 Essential Animations Only */
/* Reduced from 50+ animations to 8 essential ones */

/* === ESSENTIAL KEYFRAMES (8 only) === */

/* 1. Fade animations - most commonly used */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* 2. Slide animations - for transitions */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. Scale animations - for interactions */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 4. Pulse - for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 5. Bounce - for notifications */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }

    40%, 43% {
        transform: translateY(-8px);
    }

    70% {
        transform: translateY(-4px);
    }

    90% {
        transform: translateY(-2px);
    }
}

/* 6. Spin - for loading spinners */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* === UTILITY CLASSES (Essential Only) === */

/* Fade utilities */
.animate-fade-in {
    animation: fadeIn var(--tg-duration-normal) var(--tg-ease-smooth);
}

.animate-fade-out {
    animation: fadeOut var(--tg-duration-normal) var(--tg-ease-smooth);
}

/* Slide utilities */
.animate-slide-up {
    animation: slideUp var(--tg-duration-normal) var(--tg-ease-smooth);
}

.animate-slide-down {
    animation: slideDown var(--tg-duration-normal) var(--tg-ease-smooth);
}

/* Scale utilities */
.animate-scale-in {
    animation: scaleIn var(--tg-duration-normal) var(--tg-ease-smooth);
}

/* State utilities */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* === PERFORMANCE OPTIMIZATIONS === */

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hardware acceleration for smooth animations */
.animate-fade-in,
.animate-fade-out,
.animate-slide-up,
.animate-slide-down,
.animate-scale-in {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Cleanup after animation */
.animate-fade-in,
.animate-slide-up,
.animate-slide-down,
.animate-scale-in {
    animation-fill-mode: both;
}

/* === ENTRANCE ANIMATIONS (Page Load) === */
.stagger-children > * {
    opacity: 0;
    animation: slideUp 0.6s var(--tg-ease-smooth) forwards;
}

    .stagger-children > *:nth-child(1) {
        animation-delay: 0.1s;
    }

    .stagger-children > *:nth-child(2) {
        animation-delay: 0.2s;
    }

    .stagger-children > *:nth-child(3) {
        animation-delay: 0.3s;
    }

    .stagger-children > *:nth-child(4) {
        animation-delay: 0.4s;
    }

    .stagger-children > *:nth-child(5) {
        animation-delay: 0.5s;
    }

/* === INTERACTION ANIMATIONS === */
.hover-lift {
    transition: transform var(--tg-duration-fast) var(--tg-ease-smooth);
}

    .hover-lift:hover {
        transform: translateY(-2px);
    }

.hover-scale {
    transition: transform var(--tg-duration-fast) var(--tg-ease-smooth);
}

    .hover-scale:hover {
        transform: scale(1.05);
    }

/* === LOADING STATES === */
.loading-skeleton {
    background: linear-gradient(90deg, var(--tg-surface) 25%, var(--tg-surface-subtle) 50%, var(--tg-surface) 75% );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}
