/* ============================================
   ZAZ Foods - Animation Styles
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

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

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

/* Fade In Down */
@keyframes fadeInDown {
    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);
    }
}

/* Fade Out */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Fade Out Up */
@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Fade Out Down */
@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Slide In Up */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide In Down */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Zoom Out */
@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Bounce */
@keyframes bounce {
    0%,
    20%,
    53%,
    80%,
    100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }
    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-30px);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

/* Pulse */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Shake */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

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

/* Flip */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }
    to {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* Flip In X */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateX(0);
        opacity: 1;
    }
}

/* Flip In Y */
@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

/* Heartbeat */
@keyframes heartbeat {
    0%,
    100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.15);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.15);
    }
    70% {
        transform: scale(1);
    }
}

/* Wiggle */
@keyframes wiggle {
    0%,
    100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Glow */
@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 5px rgba(45, 106, 79, 0.2),
                    0 0 10px rgba(45, 106, 79, 0.2),
                    0 0 15px rgba(45, 106, 79, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(45, 106, 79, 0.4),
                    0 0 20px rgba(45, 106, 79, 0.4),
                    0 0 30px rgba(45, 106, 79, 0.4);
    }
}

/* Ripple */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Skeleton Loading */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* ============================================
   Animation Utility Classes
   ============================================ */

/* Animation Base */
.animate {
    animation-duration: var(--transition-slow);
    animation-fill-mode: both;
    animation-timing-function: ease;
}

/* Animation Delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

.delay-900 {
    animation-delay: 900ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* Animation Durations */
.duration-fast {
    animation-duration: var(--transition-fast);
}

.duration-base {
    animation-duration: var(--transition-base);
}

.duration-slow {
    animation-duration: var(--transition-slow);
}

/* Animation Directions */
.animate-fade-in {
    animation-name: fadeIn;
}

.animate-fade-in-up {
    animation-name: fadeInUp;
}

.animate-fade-in-down {
    animation-name: fadeInDown;
}

.animate-fade-in-left {
    animation-name: fadeInLeft;
}

.animate-fade-in-right {
    animation-name: fadeInRight;
}

.animate-fade-out {
    animation-name: fadeOut;
}

.animate-fade-out-up {
    animation-name: fadeOutUp;
}

.animate-fade-out-down {
    animation-name: fadeOutDown;
}

.animate-slide-in-up {
    animation-name: slideInUp;
}

.animate-slide-in-down {
    animation-name: slideInDown;
}

.animate-slide-in-left {
    animation-name: slideInLeft;
}

.animate-slide-in-right {
    animation-name: slideInRight;
}

.animate-zoom-in {
    animation-name: zoomIn;
}

.animate-zoom-out {
    animation-name: zoomOut;
}

.animate-bounce {
    animation-name: bounce;
    animation-iteration-count: infinite;
}

.animate-pulse {
    animation-name: pulse;
    animation-iteration-count: infinite;
}

.animate-shake {
    animation-name: shake;
}

.animate-spin {
    animation-name: spin;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.animate-flip {
    animation-name: flip;
}

.animate-flip-in-x {
    animation-name: flipInX;
}

.animate-flip-in-y {
    animation-name: flipInY;
}

.animate-heartbeat {
    animation-name: heartbeat;
    animation-iteration-count: infinite;
}

.animate-wiggle {
    animation-name: wiggle;
    animation-iteration-count: infinite;
}

.animate-glow {
    animation-name: glow;
    animation-iteration-count: infinite;
}

/* ============================================
   Hover Animations
   ============================================ */

.hover-grow {
    transition: transform var(--transition-base);
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-shrink {
    transition: transform var(--transition-base);
}

.hover-shrink:hover {
    transform: scale(0.95);
}

.hover-rotate {
    transition: transform var(--transition-base);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-flip-x {
    transition: transform var(--transition-base);
}

.hover-flip-x:hover {
    transform: scaleX(-1);
}

.hover-flip-y {
    transition: transform var(--transition-base);
}

.hover-flip-y:hover {
    transform: scaleY(-1);
}

.hover-shadow {
    transition: box-shadow var(--transition-base);
}

.hover-shadow:hover {
    box-shadow: var(--shadow-xl);
}

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(45, 106, 79, 0.4);
}

/* ============================================
   Scroll Animations (Triggered by JS)
   ============================================ */

.scroll-animate {
    opacity: 0;
    transition: all 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
}

.scroll-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-fade-down {
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.6s ease;
}

.scroll-fade-down.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.scroll-fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
}

.scroll-fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-zoom-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease;
}

.scroll-zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

.scroll-rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
    transition: all 0.6s ease;
}

.scroll-rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ============================================
   Loading Animations
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0px,
        #e0e0e0 40px,
        #f0f0f0 80px
    );
    background-size: 600px;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-md);
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--spacing-md);
}

.skeleton-image {
    height: 200px;
    margin-bottom: var(--spacing-md);
}

/* Spinner Variants */
.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.spinner-xl {
    width: 80px;
    height: 80px;
    border-width: 5px;
}

/* ============================================
   Page Transitions
   ============================================ */

.page-transition {
    animation: fadeIn 0.3s ease;
}

.page-transition-out {
    animation: fadeOut 0.3s ease;
}

/* ============================================
   Stagger Animation Utilities
   ============================================ */

.stagger-1 {
    animation-delay: 100ms;
}

.stagger-2 {
    animation-delay: 200ms;
}

.stagger-3 {
    animation-delay: 300ms;
}

.stagger-4 {
    animation-delay: 400ms;
}

.stagger-5 {
    animation-delay: 500ms;
}

.stagger-6 {
    animation-delay: 600ms;
}

.stagger-7 {
    animation-delay: 700ms;
}

.stagger-8 {
    animation-delay: 800ms;
}

.stagger-9 {
    animation-delay: 900ms;
}

.stagger-10 {
    animation-delay: 1000ms;
}

/* ============================================
   Parallax Effect Base
   ============================================ */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ============================================
   Gradient Animation
   ============================================ */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* ============================================
   Typing Effect
   ============================================ */

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 3px solid var(--color-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* ============================================
   Float Animation
   ============================================ */

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* ============================================
   Slide Down Animation (for dropdowns)
   ============================================ */

.slide-down {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base) ease;
}

.slide-down.active {
    max-height: 500px;
}
