/* TODAY - Advanced Animation System */

/* Keyframe Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(1deg); }
    75% { transform: translateY(5px) rotate(-1deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.3),
                    0 0 40px rgba(0, 217, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 217, 255, 0.5),
                    0 0 60px rgba(0, 217, 255, 0.2);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes reveal-line {
    from {
        transform: scaleX(0);
        transform-origin: left center;
    }
    to {
        transform: scaleX(1);
        transform-origin: left center;
    }
}

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

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

@keyframes data-stream {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes rotate-3d {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* Scroll-triggered Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger Animation Classes */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
}

.magnetic-btn:hover::before {
    width: 150%;
    height: 150%;
    opacity: 1;
}

/* Text Effects */
.gradient-text {
    background: linear-gradient(135deg, #667EEA 0%, #00D9FF 50%, #00A69C 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Disabled infinite animation to prevent flickering */
    /* animation: border-flow 3s ease infinite; */
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        var(--text-primary) 40%,
        var(--electric-teal) 50%,
        var(--text-primary) 60%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Disabled infinite animation to prevent flickering */
    /* animation: text-shimmer 3s linear infinite; */
}

/* Parallax Layers */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.parallax-layer[data-speed="0.5"] {
    transform: translateY(calc(var(--scroll-y) * 0.5px));
}

.parallax-layer[data-speed="0.3"] {
    transform: translateY(calc(var(--scroll-y) * 0.3px));
}

.parallax-layer[data-speed="-0.5"] {
    transform: translateY(calc(var(--scroll-y) * -0.5px));
}

/* Liquid Morphing Shapes */
.morph-shape {
    background: var(--gradient-teal);
    /* Disabled infinite animation to prevent flickering */
    /* animation: morph 8s ease-in-out infinite; */
    filter: blur(40px);
    opacity: 0.7;
    border-radius: 50%;
}

/* Data Visualization Effects */
.data-point {
    position: absolute;
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, transparent, var(--electric-teal), transparent);
    /* animation: data-stream 3s linear infinite; -- Disabled for performance */
}

.data-point:nth-child(odd) {
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.data-point:nth-child(even) {
    animation-duration: 3.5s;
    animation-delay: 1s;
}

/* Loading States */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.05) 25%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.05) 75%
    );
    background-size: 200% 100%;
    /* animation: skeleton-loading 1.5s ease-in-out infinite; -- Disabled for performance */
}

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

/* Particle Effects */
.particle {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    animation: particle-float 4s ease-out forwards;
}

@keyframes particle-float {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(1);
        opacity: 0;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch:hover::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation-delay: 0.1s;
}

.glitch:hover::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitch-1 {
    0%, 100% {
        opacity: 0;
        transform: translate(0, 0);
    }
    33% {
        opacity: 1;
        transform: translate(-2px, -2px);
        color: var(--electric-teal);
    }
    66% {
        opacity: 1;
        transform: translate(2px, 2px);
        color: var(--hot-coral);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        opacity: 0;
        transform: translate(0, 0);
    }
    33% {
        opacity: 1;
        transform: translate(2px, -2px);
        color: var(--hot-coral);
    }
    66% {
        opacity: 1;
        transform: translate(-2px, 2px);
        color: var(--electric-teal);
    }
}

/* 3D Card Flip */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

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

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Smooth Reveal with Clip Path */
.clip-reveal {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    transition: clip-path 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.clip-reveal.visible {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Infinite Scroll Marquee */
.marquee {
    display: flex;
    overflow: hidden;
}

.marquee-content {
    display: flex;
    /* animation: marquee 20s linear infinite; -- Disabled for performance */
}

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

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

.breathe {
    /* Disabled to prevent flickering */
    /* animation: breathe 3s ease-in-out infinite; */
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    /* animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite; -- Disabled for performance */
}

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--electric-teal); }
}