/* Qanto Website - Animation Styles */

/* ==========================================================================
   Core Animation Variables
   ========================================================================== */

:root {
    --animation-duration-fast: 0.15s;
    --animation-duration-normal: 0.3s;
    --animation-duration-slow: 0.6s;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --animation-easing-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   Fade Animations
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(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);
    }
}

@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 fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ==========================================================================
   Scale Animations
   ========================================================================== */

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

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

@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.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Slide Animations
   ========================================================================== */

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

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

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

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* ==========================================================================
   Rotation Animations
   ========================================================================== */

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes rotateOut {
    from {
        transform: rotate(0deg);
        opacity: 1;
    }
    to {
        transform: rotate(200deg);
        opacity: 0;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Bounce Animations
   ========================================================================== */

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes bounceInUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 3000px, 0);
    }
    60% {
        opacity: 1;
        transform: translate3d(0, -20px, 0);
    }
    75% {
        transform: translate3d(0, 10px, 0);
    }
    90% {
        transform: translate3d(0, -5px, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

/* ==========================================================================
   Shake and Wobble Animations
   ========================================================================== */

@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 jello {
    0%, 11.1%, 100% {
        transform: translate3d(0, 0, 0);
    }
    22.2% {
        transform: skewX(-12.5deg) skewY(-12.5deg);
    }
    33.3% {
        transform: skewX(6.25deg) skewY(6.25deg);
    }
    44.4% {
        transform: skewX(-3.125deg) skewY(-3.125deg);
    }
    55.5% {
        transform: skewX(1.5625deg) skewY(1.5625deg);
    }
    66.6% {
        transform: skewX(-0.78125deg) skewY(-0.78125deg);
    }
    77.7% {
        transform: skewX(0.390625deg) skewY(0.390625deg);
    }
    88.8% {
        transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    }
}

/* ==========================================================================
   Flip Animations
   ========================================================================== */

@keyframes flipInX {
    0% {
        transform: perspective(400px) rotateX(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(-20deg);
    }
    60% {
        transform: perspective(400px) rotateX(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateX(-5deg);
    }
    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

@keyframes flipInY {
    0% {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    100% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
        animation-timing-function: ease-out;
    }
    40% {
        transform: perspective(400px) translateZ(150px) rotateY(170deg);
        animation-timing-function: ease-out;
    }
    50% {
        transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
        animation-timing-function: ease-in;
    }
    80% {
        transform: perspective(400px) rotateY(360deg) scale(0.95);
        animation-timing-function: ease-in;
    }
    100% {
        transform: perspective(400px) scale(1);
        animation-timing-function: ease-in;
    }
}

/* ==========================================================================
   Glow and Shine Effects
   ========================================================================== */

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(102, 126, 234, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
}

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

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes neon {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(102, 126, 234, 0.5),
            0 0 10px rgba(102, 126, 234, 0.5),
            0 0 15px rgba(102, 126, 234, 0.5);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(102, 126, 234, 0.8),
            0 0 20px rgba(102, 126, 234, 0.8),
            0 0 30px rgba(102, 126, 234, 0.8),
            0 0 40px rgba(102, 126, 234, 0.8);
    }
}

/* ==========================================================================
   Typewriter Effect
   ========================================================================== */

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

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: var(--primary-color);
    }
}

/* ==========================================================================
   Particle Effects
   ========================================================================== */

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

@keyframes floatReverse {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(20px);
    }
}

@keyframes drift {
    0% {
        transform: translateX(0px) translateY(0px);
    }
    33% {
        transform: translateX(30px) translateY(-30px);
    }
    66% {
        transform: translateX(-20px) translateY(20px);
    }
    100% {
        transform: translateX(0px) translateY(0px);
    }
}

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

/* ==========================================================================
   Loading Animations
   ========================================================================== */

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

@keyframes loadingWave {
    0%, 60%, 100% {
        transform: initial;
    }
    30% {
        transform: translateY(-15px);
    }
}

@keyframes progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Utility Animation Classes
   ========================================================================== */

.animate-fade-in {
    animation: fadeIn var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-fade-in-up {
    animation: fadeInUp var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-scale-in {
    animation: scaleIn var(--animation-duration-normal) var(--animation-easing-bounce) forwards;
}

.animate-bounce-in {
    animation: bounceIn var(--animation-duration-slow) var(--animation-easing) forwards;
}

.animate-slide-in-up {
    animation: slideInUp var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-slide-in-down {
    animation: slideInDown var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-slide-in-left {
    animation: slideInLeft var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-slide-in-right {
    animation: slideInRight var(--animation-duration-normal) var(--animation-easing) forwards;
}

.animate-flip-in-x {
    animation: flipInX var(--animation-duration-slow) var(--animation-easing) forwards;
}

.animate-flip-in-y {
    animation: flipInY var(--animation-duration-slow) var(--animation-easing) forwards;
}

.animate-rotate-in {
    animation: rotateIn var(--animation-duration-normal) var(--animation-easing) forwards;
}

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

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

.animate-shake {
    animation: shake 0.5s;
}

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

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

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

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

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

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

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

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

/* ==========================================================================
   Hover Animations
   ========================================================================== */

.hover-lift {
    transition: transform var(--animation-duration-normal) var(--animation-easing);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform var(--animation-duration-normal) var(--animation-easing);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform var(--animation-duration-normal) var(--animation-easing);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow var(--animation-duration-normal) var(--animation-easing);
}

.hover-glow:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::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;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ==========================================================================
   Stagger Animations
   ========================================================================== */

.stagger-fade > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp var(--animation-duration-normal) var(--animation-easing) forwards;
}

.stagger-fade > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-fade > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-fade > *:nth-child(8) { animation-delay: 0.8s; }

.stagger-scale > * {
    opacity: 0;
    transform: scale(0.8);
    animation: scaleIn var(--animation-duration-normal) var(--animation-easing-bounce) forwards;
}

.stagger-scale > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-scale > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-scale > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-scale > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-scale > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-scale > *:nth-child(6) { animation-delay: 0.6s; }

/* ==========================================================================
   Scroll-triggered Animations
   ========================================================================== */

.scroll-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--animation-duration-slow) var(--animation-easing);
}

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

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all var(--animation-duration-slow) var(--animation-easing);
}

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

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all var(--animation-duration-slow) var(--animation-easing);
}

.scroll-slide-right.in-view {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--animation-duration-slow) var(--animation-easing-bounce);
}

.scroll-scale.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;
        scroll-behavior: auto !important;
    }
    
    .animate-pulse,
    .animate-bounce,
    .animate-float,
    .animate-drift,
    .animate-spin,
    .animate-glow,
    .animate-neon {
        animation: none !important;
    }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

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

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

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

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

/* ==========================================================================
   Custom Timing Functions
   ========================================================================== */

.ease-in-quad { transition-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53); }
.ease-in-cubic { transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); }
.ease-in-quart { transition-timing-function: cubic-bezier(0.895, 0.03, 0.685, 0.22); }
.ease-in-quint { transition-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); }
.ease-in-expo { transition-timing-function: cubic-bezier(0.95, 0.05, 0.795, 0.035); }
.ease-in-circ { transition-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.335); }

.ease-out-quad { transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.ease-out-cubic { transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
.ease-out-quart { transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1); }
.ease-out-quint { transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
.ease-out-expo { transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); }
.ease-out-circ { transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1); }

.ease-in-out-quad { transition-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955); }
.ease-in-out-cubic { transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1); }
.ease-in-out-quart { transition-timing-function: cubic-bezier(0.77, 0, 0.175, 1); }
.ease-in-out-quint { transition-timing-function: cubic-bezier(0.86, 0, 0.07, 1); }
.ease-in-out-expo { transition-timing-function: cubic-bezier(1, 0, 0, 1); }
.ease-in-out-circ { transition-timing-function: cubic-bezier(0.785, 0.135, 0.15, 0.86); }