/* ================================
   GSAP & SCROLL ANIMATIONS
   ================================ */

/* Elements that will be animated on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

/* Stagger animation for multiple elements */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-animation.animated > * {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   KEYFRAME ANIMATIONS
   ================================ */

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Rotate animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-animation {
    animation: rotate 20s linear infinite;
}

/* Bounce animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

.bounce-animation {
    animation: bounce 2s ease infinite;
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.shake-animation {
    animation: shake 0.5s ease;
}

/* Wiggle animation */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

.wiggle-animation {
    animation: wiggle 0.5s ease;
}

/* Glow animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-color),
                    0 0 10px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--primary-color),
                    0 0 30px var(--primary-color),
                    0 0 40px var(--primary-color);
    }
}

.glow-animation {
    animation: glow 2s ease-in-out infinite;
}

/* Gradient animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animation {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease;
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease;
}

/* Zoom in */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.5s ease;
}

/* Flip animation */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }
    to {
        transform: perspective(400px) rotateY(360deg);
    }
}

.flip-animation {
    animation: flip 1s ease;
}

/* Typewriter effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blink 0.5s step-end infinite alternate;
}

/* ================================
   BACKGROUND ANIMATIONS
   ================================ */

/* Animated gradient background */
.animated-gradient {
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color),
        var(--primary-color)
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Particles background effect */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(-10px, 10px);
    }
    75% {
        transform: translate(10px, 10px);
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.3;
    animation: particle-float 20s ease-in-out infinite;
}

/* ================================
   HOVER ANIMATIONS
   ================================ */

/* Lift on hover */
.lift-on-hover {
    transition: all var(--transition-base);
}

.lift-on-hover:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* Scale on hover */
.scale-on-hover {
    transition: all var(--transition-base);
}

.scale-on-hover:hover {
    transform: scale(1.05);
}

/* Rotate on hover */
.rotate-on-hover {
    transition: all var(--transition-base);
}

.rotate-on-hover:hover {
    transform: rotate(5deg);
}

/* Border glow on hover */
.border-glow-hover {
    transition: all var(--transition-base);
}

.border-glow-hover:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* ================================
   TEXT ANIMATIONS
   ================================ */

/* Gradient text animation */
.animated-text-gradient {
    background: linear-gradient(
        90deg,
        var(--primary-color),
        var(--secondary-color),
        var(--accent-color),
        var(--primary-color)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s linear infinite;
}

/* Glitch effect */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch-effect {
    animation: glitch 0.3s ease;
}

/* Neon text effect */
.neon-text {
    color: var(--primary-color);
    text-shadow: 
        0 0 5px var(--primary-color),
        0 0 10px var(--primary-color),
        0 0 20px var(--primary-color),
        0 0 40px var(--primary-color);
    animation: neon-flicker 1.5s infinite alternate;
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px var(--primary-color),
            0 0 10px var(--primary-color),
            0 0 20px var(--primary-color),
            0 0 40px var(--primary-color);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ================================
   LOADING ANIMATIONS
   ================================ */

/* Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Dots loading */
@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: dot-bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Progress bar animation */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar-animated {
    animation: progress 2s ease;
}

/* ================================
   SCROLL REVEAL ANIMATIONS
   ================================ */

/* Fade in up */
.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.fade-in-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in down */
.fade-in-down {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 0.6s ease;
}

.fade-in-down.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in left */
.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.fade-in-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in right */
.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.fade-in-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease;
}

.scale-in.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ================================
   STAGGER DELAYS
   ================================ */

.stagger-1 { animation-delay: 0.1s; transition-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; transition-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; transition-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; transition-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; transition-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; transition-delay: 0.6s; }

/* ================================
   CURSOR EFFECTS
   ================================ */

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.15s ease;
}

/* ================================
   PARALLAX EFFECTS
   ================================ */

.parallax {
    transition: transform 0.5s ease-out;
}

/* ================================
   RIPPLE EFFECT
   ================================ */

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
    width: 300px;
    height: 300px;
    animation: ripple 0.6s ease-out;
}

/* ================================
   SPECIAL EFFECTS
   ================================ */

/* Shine effect */
@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

/* Tilt effect on hover */
.tilt-effect {
    transition: transform 0.3s ease;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ================================
   SKELETON LOADING
   ================================ */

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0px,
        var(--bg-hover) 40px,
        var(--bg-tertiary) 80px
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ================================
   PAGE TRANSITION
   ================================ */

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: page-enter 0.5s ease;
}

/* ================================
   CONFETTI ANIMATION (Easter Egg)
   ================================ */

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    animation: confetti-fall 3s linear;
    pointer-events: none;
    z-index: 9999;
}

/* ================================
   COUNTER ANIMATION
   ================================ */

.counter {
    opacity: 0;
    transform: translateY(20px);
}

.counter.counting {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}