/* ==========================================================================
   Animations - Keyframes & Effects
   ========================================================================== */

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */

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

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

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

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(255, 107, 53, 0);
    }
}

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

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

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

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

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

/* Glitch Animation */
@keyframes glitch {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(0, 0);
    }
    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(-2px, 2px);
    }
    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(2px, -2px);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(-2px, 2px);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(2px, -2px);
    }
    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(0, 0);
    }
}

@keyframes glitchText {
    0% {
        text-shadow: 
            -2px 0 var(--color-primary),
            2px 0 #00ffff;
    }
    25% {
        text-shadow: 
            2px 0 var(--color-primary),
            -2px 0 #00ffff;
    }
    50% {
        text-shadow: 
            -2px 2px var(--color-primary),
            2px -2px #00ffff;
    }
    75% {
        text-shadow: 
            2px -2px var(--color-primary),
            -2px 2px #00ffff;
    }
    100% {
        text-shadow: 
            -2px 0 var(--color-primary),
            2px 0 #00ffff;
    }
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Marquee Animation */
@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@keyframes marqueeReverse {
    from {
        transform: translateX(-50%);
    }
    to {
        transform: translateX(0);
    }
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

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

/* Line Draw Animation */
@keyframes lineDraw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

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

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Film Reel Animation */
@keyframes filmReelSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mouse Scroll Animation */
@keyframes scrollMouse {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 100px), var(--ty, -100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

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

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

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

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

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

/* ==========================================================================
   Hover Transitions
   ========================================================================== */

.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

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

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

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

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* Text Hover Effects */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-normal);
}

.hover-underline:hover::after {
    width: 100%;
}

.hover-slide-bg {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hover-slide-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: -1;
}

.hover-slide-bg:hover::before {
    transform: translateX(0);
}

.hover-slide-bg:hover {
    color: var(--color-white);
}

/* Image Hover Effects */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform var(--transition-slow);
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

.img-hover-grayscale img {
    filter: grayscale(100%);
    transition: filter var(--transition-normal);
}

.img-hover-grayscale:hover img {
    filter: grayscale(0%);
}

.img-hover-blur img {
    filter: blur(0);
    transition: filter var(--transition-normal);
}

.img-hover-blur:hover img {
    filter: blur(2px);
}

/* ==========================================================================
   Text Animation Effects
   ========================================================================== */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: textReveal var(--animate-duration-slow) ease forwards;
}

.glitch-text {
    position: relative;
}

.glitch-text:hover {
    animation: glitchText 0.3s ease;
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradientShift 3s ease infinite;
}

.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--color-text-primary) 0%,
        var(--color-primary) 50%,
        var(--color-text-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: gradientShift 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Particle Effect Styles
   ========================================================================== */

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    animation: particleFloat 4s ease-in-out infinite;
    pointer-events: none;
}

.particle:nth-child(2n) {
    background: var(--color-accent);
    animation-delay: 0.5s;
}

.particle:nth-child(3n) {
    background: var(--color-white);
    animation-delay: 1s;
}

/* ==========================================================================
   Cursor Animations
   ========================================================================== */

.cursor-hover {
    animation: pulse 1s ease-in-out infinite;
}

/* ==========================================================================
   Scroll Triggered Animations (Add via JS)
   ========================================================================== */

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}