/* ============================================
   PREMIUM ANIMATIONS AND EFFECTS
   ============================================ */

/* 
   Note: Product grid animations are defined in pages.css
   This file contains general-purpose animations
*/

/* Features Grid Stagger Animation */
.features-grid > * {
    animation: featureFadeIn 0.6s ease-out backwards;
}

.features-grid > *:nth-child(1) { animation-delay: 0.1s; }
.features-grid > *:nth-child(2) { animation-delay: 0.2s; }
.features-grid > *:nth-child(3) { animation-delay: 0.3s; }
.features-grid > *:nth-child(4) { animation-delay: 0.4s; }
.features-grid > *:nth-child(5) { animation-delay: 0.5s; }
.features-grid > *:nth-child(6) { animation-delay: 0.6s; }

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

/* Enhanced Toast Animations */
.toast {
    animation: slideInFromTop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.hiding {
    animation: slideOutToTop 0.3s ease-in forwards;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutToTop {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
}

/* Loading Overlay Animation */
.loading-overlay {
    animation: fadeIn 0.3s ease-out;
}

.loading-overlay .spinner {
    animation: spin 1s linear infinite, scaleIn 0.5s ease-out;
}

/* Scroll-triggered Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Glow Effect */
.glow-on-hover {
    position: relative;
}

.glow-on-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glow-on-hover:hover::after {
    opacity: 1;
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.bounce-animation {
    animation: bounce 1s ease infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

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

/* Success Animation */
@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
}

.success-pulse {
    animation: successPulse 1.5s ease-out;
}

/* Page Transition */
.page-transition-enter {
    animation: pageEnter 0.5s ease-out;
}

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

/* Image Load Animation */
img {
    animation: imageLoad 0.6s ease-out;
}

@keyframes imageLoad {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Progressive Blur */
.progressive-blur {
    filter: blur(20px);
    transition: filter 0.5s ease-out;
}

.progressive-blur.loaded {
    filter: blur(0);
}

/* Attention Seeker */
@keyframes attentionPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.attention-pulse {
    animation: attentionPulse 1s ease-in-out 3;
}

/* Smooth Scroll Indicator */
@keyframes scrollDown {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

.scroll-indicator {
    animation: scrollDown 2s ease-in-out infinite;
}

/* Shimmer Animation for Loading Effects */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Gradient Shimmer */
@keyframes gradientShimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.gradient-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    background-size: 200% 100%;
    animation: gradientShimmer 2s ease-in-out infinite;
}

/* Pulse Ring Animation */
@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Additional Animations for New Sections */

/* Gradient Background Shift */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

/* Slide In Up Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Down Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Count Up Animation for Stats */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-grid .stat-card {
    animation: countUp 0.6s ease-out backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.3s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Testimonials Animation */
.testimonials-grid .testimonial-card {
    animation: fadeInStagger 0.6s ease-out backwards;
}

.testimonials-grid .testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonials-grid .testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonials-grid .testimonial-card:nth-child(3) { animation-delay: 0.3s; }

/* Quick Categories Animation */
.quick-categories-grid .quick-category-card {
    animation: scaleIn 0.4s ease-out backwards;
}

.quick-categories-grid .quick-category-card:nth-child(1) { animation-delay: 0.05s; }
.quick-categories-grid .quick-category-card:nth-child(2) { animation-delay: 0.1s; }
.quick-categories-grid .quick-category-card:nth-child(3) { animation-delay: 0.15s; }
.quick-categories-grid .quick-category-card:nth-child(4) { animation-delay: 0.2s; }
.quick-categories-grid .quick-category-card:nth-child(5) { animation-delay: 0.25s; }
