/* ============================================================================
   ANIMATIONS MODULE - Keyframes and Animation Effects
   ============================================================================
   Contains: All keyframe animations, seasonal decorations, UI animations, and effects
   ============================================================================ */

/* ===== CORE UI ANIMATIONS ===== */

/* Bounce Animation for Scroll Arrow */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.scroll-arrow {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

/* Sparkle Animation */
@keyframes sparkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.sparkle-icon {
    animation: sparkle 2s ease-in-out infinite;
}

/* Shine Animation */
@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.shine-effect::after {
    animation: shine 3s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse-element {
    animation: pulse 2s infinite;
}

/* Alternative Pulse for Different Elements */
@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ===== FLOATING ACTION BUTTON ANIMATIONS ===== */

/* FAB Pulse Animation */
@keyframes fabPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(45, 80, 22, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(45, 80, 22, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(45, 80, 22, 0.3);
    }
}

/* ===== SLIDE AND FADE ANIMATIONS ===== */

/* Slide In Animations */
@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInNav {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== SPECIAL EFFECT ANIMATIONS ===== */

/* Gentle Float */
@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* Twinkle Animation */
@keyframes twinkle {
    0% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    100% {
        transform: scale(1.1) rotate(12deg);
        filter: brightness(1.3);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Price Glow Animation */
@keyframes priceGlow {
    0%, 100% { box-shadow: var(--shadow-soft); }
    50% { box-shadow: 0 0 20px rgba(74, 124, 35, 0.4); }
}

/* ===== LOADING AND PROGRESS ANIMATIONS ===== */

/* Spin Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress Fill Animation */
@keyframes progressFill {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Video Spinner */
@keyframes videoSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== MODAL AND UI ELEMENT ANIMATIONS ===== */

/* Header Shine Animation */
@keyframes headerShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Touch Activation Animation */
@keyframes activateTouch {
    0% { transform: translateY(1px); }
    100% { transform: translateY(0); }
}

/* Close Button Pulse */
@keyframes closeBtnPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

/* Map Pin Pulse */
@keyframes mapPinPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}


/* Welcome Modal Animations */
@keyframes welcomeShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes welcomePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== SEASONAL FALL/HALLOWEEN ANIMATIONS ===== */

/* Falling Leaves Animation */
@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        transform: translateY(0px) rotate(45deg);
    }
    40% {
        transform: translateY(40px) rotate(90deg);
    }
    60% {
        transform: translateY(120px) rotate(135deg);
    }
    80% {
        transform: translateY(200px) rotate(180deg);
    }
    100% {
        transform: translateY(300px) rotate(225deg);
        opacity: 0;
    }
}

/* Autumn Glow Animation */
@keyframes autumn-glow {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: rotate(90deg) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 0.8;
    }
    75% {
        transform: rotate(270deg) scale(1.1);
        opacity: 0.6;
    }
}

/* Pumpkin Glow Animation */
@keyframes pumpkin-glow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.3));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(251, 146, 60, 0.6));
    }
}

/* Seasonal Pulse Animation */
@keyframes seasonal-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Badge Shimmer Animation */
@keyframes badge-shimmer {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(217, 119, 6, 0.1);
    }
    50% {
        box-shadow: 0 2px 12px rgba(217, 119, 6, 0.2);
    }
}

/* ===== ANIMATION CLASSES ===== */

/* Apply animations to elements */
.gallery-placeholder-content {
    animation: gentleFloat 4s ease-in-out infinite;
}

.gallery-placeholder .twinkle-star {
    animation: twinkle 2s ease-in-out infinite alternate;
}

.gallery-placeholder .loading-text {
    animation: fadeInOut 3s ease-in-out infinite;
}

.close-modal-btn::before {
    animation: closeBtnPulse 2s ease-in-out infinite;
}

.loading-icon {
    animation: pulse 2s infinite;
}

.loading-progress-bar {
    animation: progressFill 3s ease-in-out infinite;
}

.map-pin {
    animation: mapPinPulse 2s infinite;
}

.video-loading-spinner {
    animation: videoSpinner 1s linear infinite;
}


.fb-modal-header::after {
    animation: headerShine 4s infinite;
}

.welcome-modal-header::after {
    animation: welcomeShine 3s infinite;
}

.welcome-icon {
    animation: welcomePulse 2s infinite;
}

.facebook-plugin-wrapper.touch-activated .fb-page {
    animation: activateTouch 0.1s ease-out;
}

/* Seasonal Animation Classes */
.autumn-corner::before {
    animation: autumn-glow 8s ease-in-out infinite;
}

.falling-leaves .leaf {
    animation: fall 12s linear infinite;
}

.pumpkin-corner {
    animation: pumpkin-glow 3s ease-in-out infinite;
}

.seasonal-icon {
    animation: seasonal-pulse 2s ease-in-out infinite;
}

.seasonal-badge {
    animation: badge-shimmer 4s ease-in-out infinite;
}

/* ===== DESKTOP-ONLY ANIMATIONS ===== */

/* Enhanced animations for desktop users */
@media (min-width: 1024px) {
    /* Staggered animation for dressing items - Desktop only */
    .dressings li {
        animation: slideInLeft 0.6s ease forwards;
        opacity: 0;
        transform: translateX(-30px);
    }

    .dressings li:nth-child(1) { animation-delay: 0.1s; }
    .dressings li:nth-child(2) { animation-delay: 0.2s; }
    .dressings li:nth-child(3) { animation-delay: 0.3s; }
    .dressings li:nth-child(4) { animation-delay: 0.4s; }
    .dressings li:nth-child(5) { animation-delay: 0.5s; }

    /* Staggered animation for addon items - Desktop only */
    .addon-item {
        animation: slideInRight 0.6s ease forwards;
        opacity: 0;
        transform: translateX(30px);
    }

    .addon-item:nth-child(1) { animation-delay: 0.1s; }
    .addon-item:nth-child(2) { animation-delay: 0.2s; }
    .addon-item:nth-child(3) { animation-delay: 0.3s; }
    .addon-item:nth-child(4) { animation-delay: 0.4s; }
    .addon-item:nth-child(5) { animation-delay: 0.5s; }
    .addon-item:nth-child(6) { animation-delay: 0.6s; }

    /* Enhanced price hover effect */
    .addon-item:hover .addon-price {
        animation: priceGlow 0.6s ease;
    }

    /* Add staggered animation on load */
    .story-card:nth-child(1) {
        animation: slideInUp 0.6s ease-out 0.1s both;
    }

    .story-card:nth-child(2) {
        animation: slideInUp 0.6s ease-out 0.3s both;
    }

    .story-card:nth-child(3) {
        animation: slideInUp 0.6s ease-out 0.5s both;
    }

    .community-love::before {
        animation: shine 6s infinite;
    }

    .add-ons:hover::after {
        animation: pulse 2s infinite;
    }
}

/* ===== FALLBACK ANIMATIONS ===== */

/* Fallback animations for browsers that don't support Intersection Observer */
@supports not (intersection-observer: auto) {
    .gallery-item {
        animation: fadeInUp 0.6s ease forwards;
    }

    .gallery-item:nth-child(1) { animation-delay: 0.1s; }
    .gallery-item:nth-child(2) { animation-delay: 0.15s; }
    .gallery-item:nth-child(3) { animation-delay: 0.2s; }
    .gallery-item:nth-child(4) { animation-delay: 0.25s; }
    .gallery-item:nth-child(5) { animation-delay: 0.3s; }
    .gallery-item:nth-child(6) { animation-delay: 0.35s; }
    .gallery-item:nth-child(7) { animation-delay: 0.4s; }
    .gallery-item:nth-child(8) { animation-delay: 0.45s; }
}

/* ===== SHIMMER EFFECT FOR LOADING IMAGES ===== */

.gallery-item img:not([src]) {
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    background-size: 400% 400%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.gallery-item img[src] {
    animation: none;
    background: none;
}

/* ===== ACCESSIBILITY: REDUCED MOTION ===== */

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep essential animations but reduce intensity */
    .scroll-arrow {
        animation: none;
    }

    .floating-action-btn {
        animation: none;
    }

    /* Disable complex seasonal animations */
    .autumn-corner::before,
    .falling-leaves .leaf,
    .pumpkin-corner,
    .seasonal-icon,
    .seasonal-badge {
        animation: none !important;
    }
}