/**
 * Wand & Shine Theme - Animations & Transitions
 * Smooth animations for scroll effects, hovers, and interactions
 */

/* ============================================
   Scroll-triggered Animations
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays for multiple items */
.services-card:nth-child(1) { transition-delay: 0.1s; }
.services-card:nth-child(2) { transition-delay: 0.2s; }
.services-card:nth-child(3) { transition-delay: 0.3s; }

.portfolio-card:nth-child(1) { transition-delay: 0.1s; }
.portfolio-card:nth-child(2) { transition-delay: 0.2s; }
.portfolio-card:nth-child(3) { transition-delay: 0.3s; }

.process-step:nth-child(1) { transition-delay: 0.1s; }
.process-step:nth-child(2) { transition-delay: 0.2s; }
.process-step:nth-child(3) { transition-delay: 0.3s; }
.process-step:nth-child(4) { transition-delay: 0.4s; }
.process-step:nth-child(5) { transition-delay: 0.5s; }

/* ============================================
   Header Scroll Effect
   ============================================ */

.header-section {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.header-section.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

/* ============================================
   Button Hover Effects
   ============================================ */

.hero-button,
.cta-button,
.wp-block-button__link {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hero-button::before,
.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.hero-button:hover::before,
.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.hero-button:hover,
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 79, 243, 0.4);
}

.hero-button:active,
.cta-button:active {
    transform: translateY(0);
}

/* ============================================
   Card Hover Effects
   ============================================ */

.services-card,
.portfolio-card,
.value-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.services-card:hover,
.portfolio-card:hover,
.value-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Service card gradient border animation */
.services-card::before {
    transition: opacity 0.3s ease;
}

.services-card:hover::before {
    opacity: 1;
}

/* ============================================
   FAQ Accordion Animation
   ============================================ */

.faq-item {
    transition: background-color 0.3s ease;
}

.faq-item:hover {
    background-color: rgba(180, 164, 255, 0.05);
}

.faq-question {
    cursor: pointer;
    transition: color 0.3s ease;
}

.faq-item.active .faq-question {
    color: #FF4FF3;
}

.faq-icon {
    transition: transform 0.4s ease, color 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: #FF4FF3;
}

.faq-answer-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}

.faq-item.active .faq-answer-wrapper {
    max-height: 1000px;
    opacity: 1;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* ============================================
   Portfolio Carousel Navigation
   ============================================ */

.carousel-nav {
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-nav:hover:not(:disabled) {
    background-color: #FF4FF3;
    transform: scale(1.1);
}

.carousel-nav:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.carousel-nav:active:not(:disabled) {
    transform: scale(0.95);
}

.portfolio-grid {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Work Process Timeline Animation
   ============================================ */

.process-step .step-marker {
    transition: all 0.3s ease;
}

.process-step:hover .step-marker {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(255, 79, 243, 0.4);
}

.process-step.active .step-marker {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 79, 243, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 79, 243, 0);
    }
}

/* ============================================
   Link Hover Effects
   ============================================ */

a:not(.hero-button):not(.cta-button):not(.wp-block-button__link):not(.faq-bottom-cta-button):not(.faq-cta-button):not(.vp-cta-button):not(.hero-btn-primary):not(.hero-btn-secondary):not(.btn-primary):not(.btn-secondary):not(.btn-outline) {
    transition: color 0.3s ease;
}

a:not(.hero-button):not(.cta-button):not(.wp-block-button__link):not(.faq-bottom-cta-button):not(.faq-cta-button):not(.vp-cta-button):not(.hero-btn-primary):not(.hero-btn-secondary):not(.btn-primary):not(.btn-secondary):not(.btn-outline):hover {
    color: #FF4FF3;
}

/* Exception for footer navigation links */
.wand-shine-footer .footer-nav a:hover {
    color: #e0e0e0;
}

/* Navigation links underline effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #FF4FF3;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile navigation links underline effect */
.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FF4FF3, #D8FF63);
    transition: width 0.3s ease;
}

.mobile-nav-link:hover::after,
.mobile-nav-link.active::after {
    width: 100%;
}

/* ============================================
   Image Hover Effects
   ============================================ */

.portfolio-image,
.about-image,
img {
    transition: transform 0.4s ease, filter 0.4s ease;
}

.portfolio-card:hover .portfolio-image,
.about-section:hover .about-image {
    transform: scale(1.05);
}

/* ============================================
   Loading States
   ============================================ */

.loading {
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ============================================
   Smooth Scroll Behavior
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* Disable smooth scroll for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Form Input Focus Effects
   ============================================ */

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #FF4FF3;
    outline-offset: 2px;
    transition: outline 0.2s ease;
}

/* ============================================
   Social Links Hover
   ============================================ */

.social-link {
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-4px) rotate(5deg);
    box-shadow: 0 6px 16px rgba(255, 79, 243, 0.3);
}

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

.gradient-text {
    background: linear-gradient(90deg, #fff, #FF4FF3, #fff, #D8FF63, #fff, #FF4FF3, #fff, #D8FF63, #fff);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 8s linear infinite;
}

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

/* ============================================
   Fade In Animation
   ============================================ */

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Slide In Animations
   ============================================ */

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
