/**
 * HireJasmine Animations
 * Modern Pop Design Animations & Effects
 *
 * Contents:
 * 1. Entrance Animations
 * 2. Scroll Animations
 * 3. Hover Effects
 * 4. Loading Animations
 * 5. Special Effects
 */

/* ========================================
   1. ENTRANCE ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Utility Classes for Entrance Animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ========================================
   2. SCROLL ANIMATIONS
   ======================================== */

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

@keyframes scrollDot {
    0% {
        opacity: 1;
        top: 8px;
    }
    100% {
        opacity: 0;
        top: 28px;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(5deg);
    }
    66% {
        transform: translateY(10px) rotate(-5deg);
    }
}

/* Scroll-triggered Animation Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

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

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

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

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

/* ========================================
   3. HOVER EFFECTS
   ======================================== */

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

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

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(207, 225, 50, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(207, 225, 50, 0.8);
    }
}

/* Shimmer Effect on Hover */
.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.shimmer-effect:hover::after {
    animation: shimmer 0.8s ease;
}

/* Glow on Hover */
.hover-glow {
    transition: all var(--transition-base);
}

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

/* ========================================
   4. LOADING ANIMATIONS
   ======================================== */

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

@keyframes dots {
    0%, 20% {
        color: rgba(0, 0, 0, 0);
        text-shadow:
            0.25em 0 0 rgba(0, 0, 0, 0),
            0.5em 0 0 rgba(0, 0, 0, 0);
    }
    40% {
        color: currentColor;
        text-shadow:
            0.25em 0 0 rgba(0, 0, 0, 0),
            0.5em 0 0 rgba(0, 0, 0, 0);
    }
    60% {
        text-shadow:
            0.25em 0 0 currentColor,
            0.5em 0 0 rgba(0, 0, 0, 0);
    }
    80%, 100% {
        text-shadow:
            0.25em 0 0 currentColor,
            0.5em 0 0 currentColor;
    }
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-primary-alpha-20);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-dots::after {
    content: ' .';
    animation: dots 1.5s steps(5, end) infinite;
}

/* ========================================
   5. SPECIAL EFFECTS
   ======================================== */

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

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

/* Text Glow Animation */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(207, 225, 50, 0.4);
    }
    50% {
        text-shadow: 0 0 40px rgba(207, 225, 50, 0.8),
                     0 0 60px rgba(133, 13, 140, 0.5);
    }
}

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

/* Floating Animation */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

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

/* Rotate 3D Effect */
@keyframes rotate3D {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

.rotate-3d {
    animation: rotate3D 4s ease-in-out infinite;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCursor {
    from, to {
        border-right-color: transparent;
    }
    50% {
        border-right-color: var(--color-accent);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-accent);
    white-space: nowrap;
    animation:
        typewriter 3.5s steps(40, end),
        blinkCursor 0.75s step-end infinite;
}

/* Particle Effect Background */
@keyframes particle1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(100px, -100px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translate(50px, -50px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translate(-50px, 100px) scale(1.1);
        opacity: 0.5;
    }
}

@keyframes particle2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.2;
    }
    33% {
        transform: translate(-80px, 80px) rotate(120deg);
        opacity: 0.5;
    }
    66% {
        transform: translate(60px, -60px) rotate(240deg);
        opacity: 0.3;
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.particle-1 {
    animation: particle1 10s ease-in-out infinite;
}

.particle-2 {
    animation: particle2 12s ease-in-out infinite;
    animation-delay: 2s;
}

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background: rgba(207, 225, 50, 0.3);
}

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

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

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Stagger Animation for Multiple Elements */
.stagger-animation > * {
    animation: fadeInUp 0.8s ease-out both;
}

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

/* ========================================
   6. PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Will-change hints for smoother animations */
.will-animate {
    will-change: transform, opacity;
}

/* GPU acceleration */
.gpu-accelerate {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ========================================
   6. ROTATING WORDS ANIMATION
   ======================================== */

.rotating-words {
    display: inline-block;
    position: relative;
    vertical-align: bottom;
    min-width: 300px;
    height: 1.2em;
}

.rotating-words .word {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    white-space: nowrap;
}

.rotating-words .word.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   7. ANIMATION DELAY UTILITIES
   ======================================== */

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }
