/* Legacy Shift V3 - Premium Animation Framework */

/* Core Animation Variables */
:root {
    /* Timing Functions */
    --ease-in-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    
    /* Animation Durations */
    --duration-fast: 0.2s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    --duration-slower: 0.8s;
    --duration-slowest: 1.2s;
}

/* Entrance Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@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);
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@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);
    }
}

/* Rotation Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes flipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Attention Seeking Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

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

@keyframes wobble {
    0% {
        transform: translateX(0%);
    }
    15% {
        transform: translateX(-25%) rotate(-5deg);
    }
    30% {
        transform: translateX(20%) rotate(3deg);
    }
    45% {
        transform: translateX(-15%) rotate(-3deg);
    }
    60% {
        transform: translateX(10%) rotate(2deg);
    }
    75% {
        transform: translateX(-5%) rotate(-1deg);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translateY(0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-30px);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translateY(-15px);
    }
    90% {
        transform: translateY(-4px);
    }
}

/* Glow and Light Effects */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 188, 212, 0.6), 0 0 30px rgba(0, 188, 212, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 188, 212, 0.8), 0 0 30px rgba(0, 188, 212, 0.6);
    }
    100% {
        text-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
    }
}

@keyframes borderGlow {
    0% {
        border-color: rgba(0, 188, 212, 0.3);
        box-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
    }
    50% {
        border-color: rgba(0, 188, 212, 0.8);
        box-shadow: 0 0 20px rgba(0, 188, 212, 0.6);
    }
    100% {
        border-color: rgba(0, 188, 212, 0.3);
        box-shadow: 0 0 5px rgba(0, 188, 212, 0.3);
    }
}

/* Floating and Levitation Effects */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes levitate {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(1deg);
    }
    50% {
        transform: translateY(-6px) rotate(0deg);
    }
    75% {
        transform: translateY(-3px) rotate(-1deg);
    }
}

/* Background and Particle Effects */
@keyframes backgroundShift {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Loading Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes loadingBars {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* Utility Animation Classes */
.animate-fade-in {
    animation: fadeIn var(--duration-normal) var(--ease-out-quad);
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-normal) var(--ease-out-quad);
}

.animate-fade-in-down {
    animation: fadeInDown var(--duration-normal) var(--ease-out-quad);
}

.animate-fade-in-left {
    animation: fadeInLeft var(--duration-normal) var(--ease-out-quad);
}

.animate-fade-in-right {
    animation: fadeInRight var(--duration-normal) var(--ease-out-quad);
}

.animate-scale-in {
    animation: scaleIn var(--duration-normal) var(--ease-out-quad);
}

.animate-scale-in-bounce {
    animation: scaleInBounce var(--duration-slow) var(--ease-bounce);
}

.animate-slide-in-up {
    animation: slideInUp var(--duration-normal) var(--ease-out-quad);
}

.animate-slide-in-down {
    animation: slideInDown var(--duration-normal) var(--ease-out-quad);
}

.animate-slide-in-left {
    animation: slideInLeft var(--duration-normal) var(--ease-out-quad);
}

.animate-slide-in-right {
    animation: slideInRight var(--duration-normal) var(--ease-out-quad);
}

.animate-rotate-in {
    animation: rotateIn var(--duration-slow) var(--ease-out-quad);
}

.animate-flip-in-x {
    animation: flipInX var(--duration-slow) var(--ease-out-quad);
}

.animate-flip-in-y {
    animation: flipInY var(--duration-slow) var(--ease-out-quad);
}

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

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.animate-wobble {
    animation: wobble 1s;
}

.animate-bounce {
    animation: bounce 1s;
}

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

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

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

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

.animate-float-slow {
    animation: floatSlow 4s ease-in-out infinite;
}

.animate-levitate {
    animation: levitate 6s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Animation Delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Animation Durations */
.animate-duration-fast { animation-duration: var(--duration-fast); }
.animate-duration-normal { animation-duration: var(--duration-normal); }
.animate-duration-slow { animation-duration: var(--duration-slow); }
.animate-duration-slower { animation-duration: var(--duration-slower); }
.animate-duration-slowest { animation-duration: var(--duration-slowest); }

/* Hover Animations */
.hover-scale:hover {
    transform: scale(1.05);
    transition: transform var(--duration-normal) var(--ease-out-quad);
}

.hover-scale-small:hover {
    transform: scale(1.02);
    transition: transform var(--duration-normal) var(--ease-out-quad);
}

.hover-lift:hover {
    transform: translateY(-4px);
    transition: transform var(--duration-normal) var(--ease-out-quad);
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform var(--duration-normal) var(--ease-out-quad);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 188, 212, 0.6);
    transition: box-shadow var(--duration-normal) var(--ease-out-quad);
}

/* Intersection Observer Animation Classes */
.fade-in-observer {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-slow) var(--ease-out-quad),
                transform var(--duration-slow) var(--ease-out-quad);
}

.fade-in-observer.in-view {
    opacity: 1;
    transform: translateY(0);
}

.scale-in-observer {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--duration-slow) var(--ease-out-quad),
                transform var(--duration-slow) var(--ease-out-quad);
}

.scale-in-observer.in-view {
    opacity: 1;
    transform: scale(1);
}

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