/* ============================================
   TRADEVISION - PROFESSIONAL ANIMATIONS
   60 FPS Optimized - GPU Accelerated
   Only transform & opacity - No layout thrashing
   ============================================ */

/* ============================================
   1. FADE ANIMATIONS - 60 FPS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   2. SLIDE ANIMATIONS - 60 FPS
   ============================================ */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-8px);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-8px);
    }
    to {
        transform: translateY(0);
    }
}

/* ============================================
   3. SCALE ANIMATIONS - 60 FPS
   ============================================ */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.02);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.9;
    }
}

/* ============================================
   4. ROTATE ANIMATIONS - 60 FPS
   ============================================ */

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.95);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ============================================
   5. SUBTLE PROFESSIONAL EFFECTS
   ============================================ */

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes subtlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes shadowGrow {
    from {
        box-shadow: var(--shadow-md);
    }
    to {
        box-shadow: var(--shadow-2xl);
    }
}

@keyframes borderSlide {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* ============================================
   6. LOADING & SPINNER ANIMATIONS
   ============================================ */

@keyframes loading {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes skeletonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ============================================
   7. UTILITY ANIMATION CLASSES
   ============================================ */

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-out {
    animation: fadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-down {
    animation: fadeInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-out {
    animation: scaleOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.rotate-360 {
    animation: rotate360 20s linear infinite;
}

.subtle-float {
    animation: subtleFloat 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ============================================
   8. SCROLL REVEAL ANIMATIONS
   ============================================ */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   9. STAGGER ANIMATION DELAYS
   ============================================ */

.delay-0 { animation-delay: 0ms; }
.delay-100 { animation-delay: 100ms; opacity: 0; }
.delay-200 { animation-delay: 200ms; opacity: 0; }
.delay-300 { animation-delay: 300ms; opacity: 0; }
.delay-400 { animation-delay: 400ms; opacity: 0; }
.delay-500 { animation-delay: 500ms; opacity: 0; }
.delay-600 { animation-delay: 600ms; opacity: 0; }
.delay-700 { animation-delay: 700ms; opacity: 0; }
.delay-800 { animation-delay: 800ms; opacity: 0; }

.stagger-1 { animation-delay: 100ms; opacity: 0; }
.stagger-2 { animation-delay: 200ms; opacity: 0; }
.stagger-3 { animation-delay: 300ms; opacity: 0; }
.stagger-4 { animation-delay: 400ms; opacity: 0; }
.stagger-5 { animation-delay: 500ms; opacity: 0; }
.stagger-6 { animation-delay: 600ms; opacity: 0; }

/* ============================================
   10. PROFESSIONAL HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-6px);
}

.hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-shadow {
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: box-shadow;
}

.hover-shadow:hover {
    box-shadow: var(--shadow-xl);
}

.hover-brighten {
    transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: filter;
}

.hover-brighten:hover {
    filter: brightness(1.05);
}

/* ============================================
   11. BUTTON ANIMATIONS
   ============================================ */

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ripple:hover::before {
    width: 300px;
    height: 300px;
}

.btn-slide-border {
    position: relative;
}

.btn-slide-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-black-pure);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-slide-border:hover::after {
    width: 100%;
}

/* ============================================
   12. CARD ANIMATIONS
   ============================================ */

.card-lift-shadow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.card-lift-shadow:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.card-border-animate {
    position: relative;
}

.card-border-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-black-pure);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-border-animate:hover::before {
    transform: scaleX(1);
}

/* ============================================
   13. LOADING STATES
   ============================================ */

.loading-spinner {
    border: 3px solid var(--color-gray-lightest);
    border-top: 3px solid var(--color-black-pure);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: loading 1s linear infinite;
    will-change: transform;
}

.loading-spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loading-spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.skeleton-box {
    background: linear-gradient(
        90deg,
        var(--color-white-off) 0%,
        var(--color-white-light) 50%,
        var(--color-white-off) 100%
    );
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: var(--radius-md);
}

/* ============================================
   14. HERO SECTION ANIMATIONS
   ============================================ */

.hero-title {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
    opacity: 0;
}

.hero-cta {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
    opacity: 0;
}

.hero-image {
    animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
    opacity: 0;
}

/* ============================================
   15. STATS COUNTER ANIMATION
   ============================================ */

.stat-counter {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.stat-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.stat-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   16. FORM INPUT ANIMATIONS
   ============================================ */

.input-focus-border {
    position: relative;
}

.input-focus-border::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-black-pure);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-focus-border:focus::after {
    width: 100%;
}

/* ============================================
   17. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Add will-change for frequently animated elements */
.will-animate {
    will-change: transform, opacity;
}

/* Remove will-change after animation completes */
.animate-complete {
    will-change: auto;
}

/* Hardware acceleration hint */
.gpu-accelerate {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ============================================
   18. ACCESSIBILITY & REDUCED MOTION
   ============================================ */

@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;
    }

    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   19. RESPONSIVE ANIMATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .subtle-float {
        animation: none;
    }

    .rotate-360 {
        animation: none;
    }

    /* Faster animations on mobile */
    .fade-in-up,
    .fade-in-down,
    .slide-in-left,
    .slide-in-right {
        animation-duration: 0.4s;
    }
}

/* ============================================
   20. CUSTOM PROFESSIONAL EFFECTS
   ============================================ */

.underline-animate {
    position: relative;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-black-pure);
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.underline-animate:hover::after {
    width: 100%;
}

.border-expand {
    position: relative;
    border: 2px solid transparent;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.border-expand::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--color-black-pure);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.border-expand:hover::before {
    opacity: 1;
}
