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

/* Base animation classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Slide in from left */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Slide in from right */
.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in animation */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* Stagger animation delays */
.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }

/* Hero content specific animations */
.hero-title {
    opacity: 0;
    transform: translateY(50px);
    animation: heroTitleFadeIn 1.2s ease forwards;
    animation-delay: 0.3s;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: heroSubtitleFadeIn 1s ease forwards;
    animation-delay: 0.8s;
}

.hero-button {
    opacity: 0;
    transform: translateY(20px);
    animation: heroButtonFadeIn 0.8s ease forwards;
    animation-delay: 1.3s;
}

@keyframes heroTitleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSubtitleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroButtonFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Portfolio item hover enhancements */
.portfolio-item {
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Service card animations */
.service-card {
    transition: all 0.4s ease;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Loading spinner for portfolio */
.portfolio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.portfolio-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-secondary, #f97316);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .slide-in-left,
    .slide-in-right,
    .scale-in,
    .hero-title,
    .hero-subtitle,
    .hero-button {
        opacity: 1;
        transform: none;
        animation: none;
        transition: none;
    }
}