/* Animations and Transitions */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: var(--button-primary);
    }
}

/* Apply animations to elements */
.hero-title {
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.phone-mockup {
    animation: scaleIn 1s ease-out 0.3s both;
}

.floating-basketball {
    animation: float 6s ease-in-out infinite;
}

.floating-basketball-1 {
    animation-delay: 0s;
}

.floating-basketball-2 {
    animation-delay: 3s;
}

/* Section animations */
.section-header {
    animation: fadeInUp 1s ease-out;
}

.how-step {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.how-step:nth-child(1) { animation-delay: 0.1s; }
.how-step:nth-child(2) { animation-delay: 0.2s; }
.how-step:nth-child(3) { animation-delay: 0.3s; }
.how-step:nth-child(4) { animation-delay: 0.4s; }

.feature-card {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.mockup {
    animation: scaleIn 0.8s ease-out;
    animation-fill-mode: both;
}

.mockup:nth-child(1) { animation-delay: 0.1s; }
.mockup:nth-child(2) { animation-delay: 0.2s; }
.mockup:nth-child(3) { animation-delay: 0.3s; }

.testimonial-card {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.testimonial-card:nth-child(3) { animation-delay: 0.3s; }

/* Hover animations */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.how-step:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.mockup:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Icon animations */
.step-icon svg,
.feature-icon svg {
    transition: transform 0.3s ease;
}

.how-step:hover .step-icon svg,
.feature-card:hover .feature-icon svg {
    transform: scale(1.1) rotate(5deg);
}

/* Button pulse animation */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Stats counter animation */
.stat-number {
    animation: fadeInUp 1s ease-out 0.8s both;
}

/* CTA section gradient animation */
.cta {
    background: linear-gradient(135deg, var(--button-primary) 0%, #1d4ed8 50%, #1e40af 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Scroll-triggered animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Loading animation */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading {
    animation: loading 1s linear infinite;
}

/* Success animation */
@keyframes success {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-animation {
    animation: success 0.5s ease-out;
}

/* Error animation */
@keyframes error {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.error-animation {
    animation: error 0.5s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Parallax effect for floating elements */
.floating-basketball {
    will-change: transform;
}

/* Performance optimizations */
.btn,
.how-step,
.feature-card,
.testimonial-card,
.mockup {
    will-change: transform;
}

/* 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;
        scroll-behavior: auto !important;
    }
}

