/* Sportzey Animations - Refined and Compact */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px); /* Reduced from 40px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px); /* Reduced from 30px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9); /* Reduced from 0.8 */
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05); /* Reduced from 1.1 */
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px); /* Reduced from -20px */
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05); /* Reduced from 1.1 */
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

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

@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animation Utility Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px); /* Reduced from 30px */
    transition: all 0.6s ease;
}

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

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.6s ease forwards;
}

.scale-in {
    animation: scaleIn 0.6s ease forwards;
}

.bounce-in {
    animation: bounceIn 0.8s ease forwards;
}

/* Delay Classes */
.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; }

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px); /* Reduced from -6px */
    box-shadow: 0 12px 25px var(--shadow-dark); /* Reduced shadow */
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02); /* Reduced from 1.05 */
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3); /* Reduced glow */
}

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

/* Card Animations */
.card-animated {
    transition: all 0.3s ease;
}

.card-animated:hover {
    transform: translateY(-6px); /* Reduced from -8px */
    box-shadow: 0 15px 35px var(--shadow-dark); /* Reduced shadow */
}

/* Image Zoom Effect */
.image-zoom {
    overflow: hidden;
    border-radius: inherit;
}

.image-zoom img {
    transition: transform 0.3s ease;
}

.image-zoom:hover img {
    transform: scale(1.05); /* Reduced from 1.1 */
}

/* Navigation Link Animation */
.nav-link-animated {
    position: relative;
    overflow: hidden;
}

.nav-link-animated::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
    transition: left 0.3s ease;
}

.nav-link-animated:hover::before {
    left: 0;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px; /* Reduced from 4px */
    background: linear-gradient(90deg, var(--accent-blue), var(--primary-blue));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px; /* Reduced from 25px */
    height: 20px; /* Reduced from 25px */
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-blue);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal span {
    display: inline-block;
    animation: textReveal 1s ease forwards;
    animation-delay: calc(var(--char-index) * 0.05s);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple-animation 0.6s ease-out;
}

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

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
    
    .stagger-children > * {
        opacity: 1;
        animation: none;
    }
}

/* Performance Optimizations */
.animate-on-scroll {
    will-change: transform, opacity;
}

.hover-lift,
.hover-scale,
.hover-glow {
    will-change: transform, box-shadow;
}

/* Smooth Transitions */
* {
    transition-property: transform, opacity, box-shadow, background-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
