﻿/**
 * Icon Animations for Homora
 * Animated gift icons throughout the website
 */

/* ==========================================
   GIFT ICON ANIMATIONS
   ========================================== */

/* Main gift icon bounce animation */
@keyframes giftBounce {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% { 
        transform: translateY(-8px) rotate(-5deg) scale(1.05);
    }
    50% { 
        transform: translateY(-12px) rotate(5deg) scale(1.1);
    }
    75% { 
        transform: translateY(-8px) rotate(-3deg) scale(1.05);
    }
}

/* Subtle continuous animation */
@keyframes giftFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-3px) rotate(2deg);
    }
    50% { 
        transform: translateY(-5px) rotate(-2deg);
    }
    75% { 
        transform: translateY(-3px) rotate(1deg);
    }
}

/* Pulse animation */
@keyframes giftPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Shake animation */
@keyframes giftShake {
    0%, 100% { 
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: rotate(-5deg);
    }
    20%, 40%, 60%, 80% { 
        transform: rotate(5deg);
    }
}

/* Glow animation */
@keyframes giftGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.3));
    }
    50% { 
        filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.8));
    }
}

/* Rotate and scale */
@keyframes giftRotateScale {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
    }
    25% { 
        transform: rotate(-10deg) scale(1.1);
    }
    50% { 
        transform: rotate(10deg) scale(1.15);
    }
    75% { 
        transform: rotate(-5deg) scale(1.1);
    }
}

/* ==========================================
   APPLY ANIMATIONS TO GIFT ICONS
   ========================================== */

/* All gift icons get subtle float animation */
.fa-gift {
    display: inline-block;
    animation: giftFloat 3s ease-in-out infinite;
    transform-origin: center;
}

/* Header logo gift icon - more prominent */
header .fa-gift,
.header .fa-gift {
    animation: giftBounce 2.5s ease-in-out infinite;
}

/* Footer gift icon - subtle glow */
footer .fa-gift,
.footer .fa-gift {
    animation: giftFloat 3s ease-in-out infinite, giftGlow 2s ease-in-out infinite;
}

/* Admin panel gift icon */
.admin-header .fa-gift,
.admin-sidebar .fa-gift {
    animation: giftRotateScale 3s ease-in-out infinite;
}

/* CTA section gift icon - attention grabbing */
.cta-section .fa-gift,
.hero-section .fa-gift {
    animation: giftBounce 2s ease-in-out infinite, giftGlow 2s ease-in-out infinite;
}

/* Feature cards gift icon */
.feature-card .fa-gift,
.service-card .fa-gift {
    animation: giftFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

/* Hover effects */
.fa-gift:hover {
    animation: giftShake 0.5s ease-in-out;
}

header .fa-gift:hover,
.header .fa-gift:hover {
    animation: giftRotateScale 0.6s ease-in-out;
}

/* Button gift icons */
button .fa-gift,
.btn .fa-gift,
a .fa-gift {
    animation: giftFloat 2.5s ease-in-out infinite;
}

button:hover .fa-gift,
.btn:hover .fa-gift,
a:hover .fa-gift {
    animation: giftBounce 0.6s ease-in-out;
}

/* Large gift icons (hero sections) */
.fa-gift.text-4xl,
.fa-gift.text-5xl,
.fa-gift.text-6xl {
    animation: giftBounce 2.5s ease-in-out infinite, giftGlow 3s ease-in-out infinite;
}

/* Small gift icons */
.fa-gift.text-xs,
.fa-gift.text-sm {
    animation: giftFloat 3s ease-in-out infinite;
}

/* ==========================================
   RESPONSIVE ANIMATIONS
   ========================================== */

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
    .fa-gift {
        animation: giftFloat 4s ease-in-out infinite;
    }
    
    /* Disable complex animations on mobile */
    header .fa-gift,
    .header .fa-gift {
        animation: giftFloat 3s ease-in-out infinite;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .fa-gift,
    .fa-gift:hover,
    header .fa-gift,
    footer .fa-gift,
    button .fa-gift {
        animation: none !important;
    }
}

/* ==========================================
   ADDITIONAL ICON ANIMATIONS
   ========================================== */

/* Bounce animation for all icons on hover */
@keyframes iconBounce {
    0%, 100% { 
        transform: translateY(0);
    }
    50% { 
        transform: translateY(-8px);
    }
}

/* Apply to other feature icons */
.fa-truck,
.fa-shield-halved,
.fa-headset,
.fa-heart,
.fa-cart-shopping {
    transition: all 0.3s ease;
}

.group:hover .fa-truck,
.group:hover .fa-shield-halved,
.group:hover .fa-gift,
.group:hover .fa-headset,
.group:hover .fa-heart,
.group:hover .fa-cart-shopping {
    animation: iconBounce 0.6s ease-in-out;
}

/* Spin animation for loading states */
@keyframes iconSpin {
    from { 
        transform: rotate(0deg);
    }
    to { 
        transform: rotate(360deg);
    }
}

.fa-spinner,
.fa-circle-notch {
    animation: iconSpin 1s linear infinite;
}

/* ==========================================
   SPECIAL EFFECTS
   ========================================== */

/* Sparkle effect for premium items */
@keyframes sparkle {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.fa-sparkles {
    animation: sparkle 1.5s ease-in-out infinite;
}

/* Fire animation for hot deals */
@keyframes fire {
    0%, 100% { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1) translateY(-2px);
        opacity: 0.8;
    }
}

.fa-fire {
    animation: fire 0.8s ease-in-out infinite;
    color: #FF3B30;
}

/* Heart beat animation */
@keyframes heartBeat {
    0%, 100% { 
        transform: scale(1);
    }
    10%, 30% { 
        transform: scale(1.1);
    }
    20%, 40% { 
        transform: scale(1.15);
    }
}

.fa-heart.text-red-500 {
    animation: heartBeat 1.5s ease-in-out infinite;
}

/* Bell ring animation */
@keyframes bellRing {
    0%, 100% { 
        transform: rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: rotate(-15deg);
    }
    20%, 40%, 60%, 80% { 
        transform: rotate(15deg);
    }
}

.fa-bell:hover {
    animation: bellRing 0.8s ease-in-out;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Disable animation */
.no-animate,
.no-animation {
    animation: none !important;
}

/* Slow animation */
.animate-slow {
    animation-duration: 4s !important;
}

/* Fast animation */
.animate-fast {
    animation-duration: 1s !important;
}

/* Pause animation on hover */
.pause-on-hover:hover {
    animation-play-state: paused !important;
}

/* Play animation on hover */
.play-on-hover {
    animation-play-state: paused;
}

.play-on-hover:hover {
    animation-play-state: running !important;
}

