/* Unified Animation System for DriveGo */

/* Core Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.animate-on-scroll.animate-slide-up {
    transform: translateY(60px);
}

.animate-on-scroll.animate-slide-down {
    transform: translateY(-60px);
}

.animate-on-scroll.animate-slide-left {
    transform: translateX(-60px);
}

.animate-on-scroll.animate-slide-right {
    transform: translateX(60px);
}

.animate-on-scroll.animate-fade {
    transform: none;
}

.animate-on-scroll.animate-scale {
    transform: scale(0.8);
}

.animate-on-scroll.animate-rotate {
    transform: rotate(-10deg) scale(0.9);
}

/* Animated state */
.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0);
}

/* Stagger animation delays */
.animate-stagger-1 { transition-delay: 0.1s; }
.animate-stagger-2 { transition-delay: 0.2s; }
.animate-stagger-3 { transition-delay: 0.3s; }
.animate-stagger-4 { transition-delay: 0.4s; }
.animate-stagger-5 { transition-delay: 0.5s; }
.animate-stagger-6 { transition-delay: 0.6s; }

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateY(0);
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--accent-rgb), 0.3);
}

.btn-animated:hover::before {
    left: 100%;
}

.btn-animated:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

/* Card Animations */
.card-animated {
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateY(0);
}

.card-animated:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-animated:hover .card-animated-content {
    transform: translateY(-4px);
}

.card-animated-content {
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Icon Animations */
.icon-animated {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.icon-animated:hover {
    transform: scale(1.1) rotate(5deg);
    color: var(--accent-color);
}

.icon-bounce:hover {
    animation: iconBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.icon-pulse:hover {
    animation: iconPulse 0.6s ease-in-out;
}

.icon-spin:hover {
    animation: iconSpin 0.8s ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.2) rotate(5deg); }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes iconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text Animations */
.text-animated {
    position: relative;
    overflow: hidden;
}

.text-animated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.text-animated:hover::after {
    width: 100%;
}

/* Counter Animation */
.counter-animated {
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

/* Floating Animation */
.float-animated {
    animation: floatAnimation 6s ease-in-out infinite;
}

.float-animated-alt {
    animation: floatAnimationAlt 8s ease-in-out infinite;
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

@keyframes floatAnimationAlt {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

/* Loading Animation */
.loading-animated {
    position: relative;
    overflow: hidden;
}

.loading-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.3), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Parallax Elements */
.parallax-animated {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* Section Animations */
.section-animated {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.section-animated.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Grid Item Animations */
.grid-item-animated {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.grid-item-animated.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* List Item Animations */
.list-item-animated {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.list-item-animated.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Progress Animation */
.progress-animated {
    overflow: hidden;
    position: relative;
}

.progress-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--accent-color);
    transition: width 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.progress-animated.animated::after {
    width: var(--progress-width, 100%);
}

/* Navigation Animation */
.nav-animated {
    position: relative;
    overflow: hidden;
}

.nav-animated::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-animated:hover::before,
.nav-animated.active::before {
    width: 100%;
}

/* Image Animation */
.image-animated {
    overflow: hidden;
    position: relative;
}

.image-animated img {
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.image-animated:hover img {
    transform: scale(1.1);
}

.image-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.image-animated:hover::after {
    opacity: 1;
}

/* Performance Optimizations */
.animate-on-scroll,
.btn-animated,
.card-animated,
.icon-animated,
.section-animated,
.grid-item-animated,
.list-item-animated,
.parallax-animated {
    will-change: transform, opacity;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll,
    .section-animated,
    .grid-item-animated,
    .list-item-animated {
        opacity: 1;
        transform: none;
    }
    
    .float-animated,
    .float-animated-alt {
        animation: none;
    }
    
    .parallax-animated {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    .animate-on-scroll,
    .section-animated,
    .grid-item-animated,
    .list-item-animated {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .float-animated,
    .float-animated-alt {
        animation: none !important;
    }
}