/* 🎭 Premium Animations & Micro-Interactions - Enterprise Grade */

/* ===== ADVANCED KEYFRAMES ===== */
@keyframes morphIn {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(-15deg);
        filter: blur(10px);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05) rotateY(5deg);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
        filter: blur(0px);
    }
}

@keyframes slideInGlass {
    0% {
        opacity: 0;
        transform: translateX(-100px) scale(0.9);
        backdrop-filter: blur(0px);
    }
    60% {
        opacity: 0.8;
        transform: translateX(10px) scale(1.02);
        backdrop-filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        backdrop-filter: blur(10px);
    }
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes elasticScale {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmerWave {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes liquidMove {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
}

@keyframes neonGlow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor;
    }
    50% {
        box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: currentColor; }
}

/* ===== PREMIUM ANIMATION CLASSES ===== */
.animate-morph-in {
    animation: morphIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-slide-glass {
    animation: slideInGlass 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-float-up {
    animation: floatUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-elastic-scale {
    animation: elasticScale 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-breathe {
    animation: breathe 3s ease-in-out infinite;
}

.animate-liquid {
    animation: liquidMove 8s ease-in-out infinite;
}

.animate-neon-glow {
    animation: neonGlow 2s ease-in-out infinite alternate;
}

/* ===== HOVER MICRO-INTERACTIONS ===== */
.micro-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.micro-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.micro-tilt {
    transition: transform 0.3s ease;
}

.micro-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.micro-glow-intense {
    position: relative;
    transition: all 0.3s ease;
}

.micro-glow-intense::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.micro-glow-intense:hover::before {
    opacity: 0.7;
}

.micro-magnetic {
    transition: all 0.2s ease;
}

.micro-magnetic:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.micro-ripple {
    position: relative;
    overflow: hidden;
}

.micro-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.micro-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ===== LOADING ANIMATIONS ===== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmerWave 1.5s infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-pulse-ring {
    position: relative;
    width: 40px;
    height: 40px;
}

.loading-pulse-ring::before,
.loading-pulse-ring::after {
    content: '';
    position: absolute;
    border: 2px solid currentColor;
    border-radius: 50%;
    opacity: 1;
    animation: pulseRing 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.loading-pulse-ring::after {
    animation-delay: -1s;
}

@keyframes pulseRing {
    0% {
        top: 18px;
        left: 18px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: 0;
        left: 0;
        width: 36px;
        height: 36px;
        opacity: 0;
    }
}

/* ===== PARTICLE EFFECTS ===== */
.particle-container {
    position: relative;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: particleFloat 3s linear infinite;
}

.particle:nth-child(2n) {
    background: rgba(118, 75, 162, 0.6);
    animation-duration: 4s;
}

.particle:nth-child(3n) {
    background: rgba(240, 147, 251, 0.6);
    animation-duration: 2.5s;
}

/* ===== TEXT ANIMATIONS ===== */
.text-typewriter {
    overflow: hidden;
    border-right: 2px solid currentColor;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

.text-gradient-animate {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-bounce-in {
    animation: bounceInText 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceInText {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-slide-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale-up {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-scale-up.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ===== INTERACTIVE ELEMENTS ===== */
.interactive-card {
    position: relative;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.interactive-card:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

.interactive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.interactive-card:hover::before {
    opacity: 1;
}

.button-morphing {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.button-morphing::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 ease;
}

.button-morphing:hover::before {
    left: 100%;
}

.button-morphing:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ===== NOTIFICATION ANIMATIONS ===== */
.notification-slide-in {
    animation: notificationSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes notificationSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.notification-bounce {
    animation: notificationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes notificationBounce {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2) rotate(-90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ===== MODAL ANIMATIONS ===== */
.modal-fade-scale {
    animation: modalFadeScale 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalFadeScale {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-slide-up {
    animation: modalSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSlideUp {
    0% {
        opacity: 0;
        transform: translateY(100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORM ANIMATIONS ===== */
.input-focus-glow {
    position: relative;
    transition: all 0.3s ease;
}

.input-focus-glow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--premium-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.input-focus-glow:focus::after {
    width: 100%;
}

.form-slide-in {
    animation: formSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes formSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== CHART ANIMATIONS ===== */
.chart-draw-in {
    animation: chartDrawIn 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes chartDrawIn {
    0% {
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dasharray: 1000;
        stroke-dashoffset: 0;
    }
}

.chart-fade-up {
    animation: chartFadeUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes chartFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== 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;
    }
    
    .animate-breathe,
    .animate-liquid,
    .animate-neon-glow,
    .loading-dots span,
    .particle {
        animation: none !important;
    }
}

/* ===== UTILITY 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; }

.duration-fast { animation-duration: 0.2s; }
.duration-normal { animation-duration: 0.3s; }
.duration-slow { animation-duration: 0.5s; }
.duration-slower { animation-duration: 0.8s; }

.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }
.ease-bounce { animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.ease-smooth { animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); }
