/* ============================================================================
   ANIMATIONS MODULE - Keyframes and Animation Effects
   ============================================================================
   Contains: All keyframe animations, seasonal decorations, UI animations, and effects
   ============================================================================ */

/* ===== CORE UI ANIMATIONS ===== */

/* Subtle Fade Animation for Scroll Arrow */
@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.scroll-arrow {
    font-size: 1.5rem;
    animation: fadeInOut 3s infinite;
}

/* Subtle Glow Animation */
@keyframes subtleGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.sparkle-icon {
    animation: subtleGlow 3s 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;
}

/* Subtle Shift Animation */
@keyframes subtleShift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

.pulse-element {
    animation: subtleShift 4s ease-in-out infinite;
}

/* Premium Card Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Alternative Subtle Animation for Different Elements */
@keyframes subtleIconShift {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.02); opacity: 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 ===== */

/* Subtle Float */
@keyframes subtleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-1px); }
}

/* Subtle Brightness Animation */
@keyframes subtleBrighten {
    0% {
        opacity: 0.85;
    }
    100% {
        opacity: 1;
    }
}

/* 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 WINTER ANIMATIONS ===== */

/* Gentle Snowfall Animation - Much More Subtle */
@keyframes gentleSnow {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(60px) rotate(15deg);
        opacity: 0;
    }
}

/* Winter Frost Animation */
@keyframes winter-frost {
    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;
    }
}

/* Subtle Seasonal Animation */
@keyframes subtleSeasonal {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.9;
    }
}

/* 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(147, 197, 253, 0.1);
    }
    50% {
        box-shadow: 0 2px 12px rgba(147, 197, 253, 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 */
.winter-corner {
    animation: subtleSeasonal 6s ease-in-out infinite;
}

.falling-snow .snowflake {
    animation: gentleSnow 20s ease-in-out infinite;
}

.seasonal-icon {
    animation: seasonal-pulse 2s ease-in-out infinite;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.seasonal-icon .base-icon {
    display: block;
    font-size: inherit;
}

.seasonal-icon .seasonal-accent {
    position: absolute;
    font-size: 0.6em;
    bottom: -5px;
    right: -5px;
    display: none;
}

.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 */

    /* 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 */
    .winter-corner,
    .falling-snow .snowflake,
    .seasonal-icon,
    .seasonal-badge {
        animation: none !important;
    }
}