/* ============================================
   CSS ANIMATIONS - Enterprise Smooth Transitions
   Bhogi Emerald Green Branding
   ============================================ */

/* ============================================
   FADE ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

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

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

/* ============================================
   ROTATE ANIMATIONS
   ============================================ */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

/* ============================================
   SHAKE ANIMATIONS
   ============================================ */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes headShake {
    0% {
        transform: translateX(0);
    }
    6.5% {
        transform: translateX(-6px) rotateY(-9deg);
    }
    18.5% {
        transform: translateX(5px) rotateY(7deg);
    }
    31.5% {
        transform: translateX(-3px) rotateY(-5deg);
    }
    43.5% {
        transform: translateX(2px) rotateY(3deg);
    }
    50% {
        transform: translateX(0);
    }
}

/* ============================================
   GLOW ANIMATIONS (Bhogi Green)
   ============================================ */


/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Fade */
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-in-down {
    animation: fadeInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-in-left {
    animation: fadeInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fade-in-right {
    animation: fadeInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scale */
.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-scale-out {
    animation: scaleOut 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Slide */
.animate-slide-in-up {
    animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-in-down {
    animation: slideInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Bounce */
.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Rotate */
.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-rotate-in {
    animation: rotateIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shake */
.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-head-shake {
    animation: headShake 0.8s ease-in-out;
}

/* Glow */
.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-glow-pulse {
    animation: glowPulse 2s ease-out infinite;
}

.animate-gold-glow {
    animation: goldGlow 2s ease-in-out infinite;
}

/* ============================================
   STAGGER ANIMATIONS (For Lists)
   ============================================ */
.stagger-fade-in > * {
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-fade-in > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-fade-in > *:nth-child(10) { animation-delay: 0.5s; }

/* ============================================
   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-bounce,
    .animate-pulse,
    .animate-rotate,
    .animate-glow,
    .animate-glow-pulse,
    .animate-gold-glow {
        animation: none !important;
    }
}

/* ============================================
   ENTERPRISE MICRO-INTERACTIONS
   Advanced Smooth Animations
   ============================================ */

/* Magnetic Hover Effect */
@keyframes magneticHover {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(var(--mouse-x, 0), var(--mouse-y, 0));
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Smooth Slide Up with Blur */
@keyframes slideUpBlur {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

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

/* Smooth Fade Slide */
@keyframes fadeSlideCombined {
    from {
        opacity: 0;
        transform: translate(-20px, -20px);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* Progress Bar Fill */
@keyframes progressFill {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink Cursor */
@keyframes blinkCursor {
    0%, 49% {
        border-color: var(--bhogi-primary);
    }
    50%, 100% {
        border-color: transparent;
    }
}

/* Floating Animation */
@keyframes floatSmooth {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-15px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-1deg);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Breathing Glow */
@keyframes breatheGlow {
    0%, 100% {
        box-shadow: 0 0 10px color-mix(in srgb, var(--bhogi-primary) 30%, transparent),
                    0 0 20px color-mix(in srgb, var(--bhogi-primary) 20%, transparent);
    }
    50% {
        box-shadow: 0 0 20px color-mix(in srgb, var(--bhogi-primary) 50%, transparent),
                    0 0 40px color-mix(in srgb, var(--bhogi-primary) 30%, transparent),
                    0 0 60px color-mix(in srgb, var(--bhogi-primary) 20%, transparent);
    }
}

/* Skeleton Loading - Advanced Shimmer */
@keyframes skeletonShimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(-10px) translateX(5px);
    }
}

/* Morph Shape */
@keyframes morphShape {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Tilt Hover */
@keyframes tiltHover {
    0% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
    100% {
        transform: perspective(1000px) rotateX(var(--tilt-x, 5deg)) rotateY(var(--tilt-y, 5deg));
    }
}

/* Spotlight Sweep */
@keyframes spotlightSweep {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Confetti Pop */
@keyframes confettiPop {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Notification Slide In */
@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Card Flip 3D */
@keyframes cardFlip3D {
    0% {
        transform: perspective(1000px) rotateY(0deg);
    }
    100% {
        transform: perspective(1000px) rotateY(180deg);
    }
}

/* ============================================
   UTILITY CLASSES - Enterprise Interactions
   ============================================ */

/* Smooth Transitions */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.transition-fast {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-slow {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ripple-effect::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: color-mix(in srgb, var(--bhogi-surface) 50%, transparent);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

/* Magnetic Hover */
.magnetic-hover {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnetic-hover:hover {
    animation: magneticHover 0.3s ease-out forwards;
}

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

/* Float Effect */
.animate-float {
    animation: floatSmooth 6s ease-in-out infinite;
}

/* Gradient Shift */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Breathing Glow */
.animate-breathe {
    animation: breatheGlow 3s ease-in-out infinite;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bhogi-border-light) 0%,
        var(--bhogi-border) 20%,
        var(--bhogi-border-light) 40%,
        var(--bhogi-border-light) 100%
    );
    background-size: 1000px 100%;
    animation: skeletonShimmer 1.5s linear infinite;
    border-radius: 4px;
}

/* Morph Shape */
.animate-morph {
    animation: morphShape 8s ease-in-out infinite;
}

/* Spotlight Effect */
.spotlight {
    background: linear-gradient(
        90deg,
        transparent 0%,
        color-mix(in srgb, var(--bhogi-surface) 10%, transparent) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: spotlightSweep 3s linear infinite;
}

/* Notification Animation */
.animate-notification {
    animation: notificationSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Staggered Grid Animation */
.grid-stagger > * {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.grid-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.grid-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.grid-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.grid-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.grid-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.grid-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.grid-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.grid-stagger > *:nth-child(8) { animation-delay: 0.4s; }
.grid-stagger > *:nth-child(9) { animation-delay: 0.45s; }
.grid-stagger > *:nth-child(10) { animation-delay: 0.5s; }
.grid-stagger > *:nth-child(11) { animation-delay: 0.55s; }
.grid-stagger > *:nth-child(12) { animation-delay: 0.6s; }

/* Slide Up with Blur */
.animate-slide-blur {
    animation: slideUpBlur 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Performance Optimization for Animations */
.animate-gpu {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
