/**
 * Animations
 * Section-specific animations with smooth performance
 *
 * @package Moes_Pizza
 * @since 1.0.0
 */

/* ============================================
   SMOOTH SCROLL
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

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

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Simple fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale up animation */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Zoom in animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   HERO SECTION - Fade In Up with Stagger
   ============================================ */

.wp-block-cover h1 {
    animation: fadeInUp 1s ease-out;
}

.wp-block-cover p {
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.wp-block-cover .wp-block-buttons {
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

/* ============================================
   FEATURED MENU ITEMS SECTION - Scale Up
   ============================================ */

/* Section container fade in */
.wp-block-group.featured-items-section {
    animation: fadeIn 0.8s ease-out;
}

/* Featured items heading */
.wp-block-group.featured-items-section h2 {
    animation: zoomIn 0.7s ease-out;
}

/* Featured item cards - staggered scale up */
.menu-item-card {
    opacity: 0;
    animation: scaleUp 0.6s ease-out forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-item-card:nth-child(1) { animation-delay: 0.1s; }
.menu-item-card:nth-child(2) { animation-delay: 0.2s; }
.menu-item-card:nth-child(3) { animation-delay: 0.3s; }
.menu-item-card:nth-child(4) { animation-delay: 0.4s; }
.menu-item-card:nth-child(5) { animation-delay: 0.5s; }
.menu-item-card:nth-child(6) { animation-delay: 0.6s; }

/* Card hover effect */
.menu-item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(244, 164, 96, 0.3);
}

/* Card image hover */
.menu-item-card img {
    transition: transform 0.4s ease;
}

.menu-item-card:hover img {
    transform: scale(1.08);
}

/* ============================================
   ABOUT SECTION - Fade In Left
   ============================================ */

.wp-block-group.about-section {
    animation: fadeInLeft 0.9s ease-out;
}

.wp-block-group.about-section h2 {
    animation: fadeInUp 0.8s ease-out 0.2s;
}

/* ============================================
   TESTIMONIALS SECTION - Slider
   ============================================ */

.wp-block-group.testimonials-section {
    animation: fadeIn 0.7s ease-out;
}

.wp-block-group.testimonials-section h2 {
    animation: fadeInUp 0.8s ease-out;
}

/* Testimonials slider fade in */
.testimonials-slider {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

/* Testimonial hover (for non-slider layout) */
.wp-block-column.has-deep-black-background-color:not(.testimonials-slider .wp-block-column) {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-block-column.has-deep-black-background-color:not(.testimonials-slider .wp-block-column):hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================
   CTA SECTION - Zoom In
   ============================================ */

.wp-block-cover.has-pizza-red-background-color {
    animation: zoomIn 0.9s ease-out;
}

.wp-block-cover.has-pizza-red-background-color h2 {
    animation: fadeInUp 0.8s ease-out 0.3s;
}

.wp-block-cover.has-pizza-red-background-color .wp-block-buttons {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

/* ============================================
   MENU PAGE - Category Tabs Slide In
   ============================================ */

/* Menu page heading */
.menu-page-header h1 {
    animation: fadeInUp 0.7s ease-out;
}

/* Category tabs container */
.menu-category-tabs {
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.2s forwards;
}

/* Individual tabs - no animation on page load, just transitions */
.category-tab {
    transition: all 0.3s ease;
    position: relative;
}

.category-tab:hover {
    transform: translateY(-2px);
}

.category-tab.active {
    transform: scale(1.05);
}

/* Tab underline animation */
.category-tab::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--wp--preset--color--cheese-gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-tab:hover::after,
.category-tab.active::after {
    transform: scaleX(1);
}

/* Menu category sections - smooth fade when switching */
.menu-category-section {
    animation: fadeIn 0.4s ease-out;
}

/* ============================================
   FOOTER - Fade In Up
   ============================================ */

footer {
    animation: fadeInUp 0.8s ease-out;
}

/* ============================================
   NAVIGATION - Underline Hover Effect
   ============================================ */

.wp-block-navigation-item a {
    position: relative;
    transition: color 0.3s ease;
}

.wp-block-navigation-item a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--wp--preset--color--cheese-gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.wp-block-navigation-item a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ============================================
   BUTTONS - Lift and Glow on Hover
   ============================================ */

.wp-block-button__link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wp-block-button__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.wp-block-button__link:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================
   CONTACT PAGE - Fade In
   ============================================ */

.contact-page-content {
    animation: fadeInUp 0.8s ease-out;
}

/* ============================================
   ACCESSIBILITY - REDUCE 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;
    }
}
