/**
 * Soft Snuggles Factory Theme - Animation Styles
 * 
 * @package Soft_Snuggles
 * @version 1.0.0
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Bottom */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer (loading effect) */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease forwards;
}

.animate-slideInBottom {
    animation: slideInBottom 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 2s ease infinite;
}

.animate-rotate {
    animation: rotate 20s linear infinite;
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ============================================
   SCROLL TRIGGERED ANIMATIONS
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.visible > *:nth-child(1) { animation: fadeInUp 0.5s ease 0.1s forwards; }
.stagger-children.visible > *:nth-child(2) { animation: fadeInUp 0.5s ease 0.2s forwards; }
.stagger-children.visible > *:nth-child(3) { animation: fadeInUp 0.5s ease 0.3s forwards; }
.stagger-children.visible > *:nth-child(4) { animation: fadeInUp 0.5s ease 0.4s forwards; }
.stagger-children.visible > *:nth-child(5) { animation: fadeInUp 0.5s ease 0.5s forwards; }
.stagger-children.visible > *:nth-child(6) { animation: fadeInUp 0.5s ease 0.6s forwards; }

/* ============================================
   HOVER EFFECTS
   ============================================ */

/* Lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(139, 90, 43, 0.15);
}

/* Glow effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(139, 90, 43, 0.3);
}

/* Scale effect */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Image zoom */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Underline animation */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll;
    }
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */

.reveal {
    position: relative;
    overflow: hidden;
}

.reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.reveal.visible::after {
    transform: translateX(100%);
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-shine:hover::before {
    left: 100%;
}

/* ============================================
   CARD FLIP EFFECT
   ============================================ */

.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ============================================
   WAVY ANIMATION
   ============================================ */

@keyframes wave {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.wave-animation > *:nth-child(1) { animation: wave 1s ease-in-out infinite; }
.wave-animation > *:nth-child(2) { animation: wave 1s ease-in-out 0.1s infinite; }
.wave-animation > *:nth-child(3) { animation: wave 1s ease-in-out 0.2s infinite; }
.wave-animation > *:nth-child(4) { animation: wave 1s ease-in-out 0.3s infinite; }
.wave-animation > *:nth-child(5) { animation: wave 1s ease-in-out 0.4s infinite; }