/* ===== ANIMATION UTILITIES ===== */

/* Hover Glow Effect */
.hover-glow {
    transition: var(--transition);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.5),
                0 0 40px rgba(247, 37, 133, 0.3);
}

/* Bounce on Hover */
.bounce-hover {
    transition: var(--transition);
}

.bounce-hover:hover {
    animation: bounceHover 0.6s ease;
}

@keyframes bounceHover {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(-5px); }
    75% { transform: translateY(-7px); }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Heartbeat */
.heartbeat {
    animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1.05); }
}

/* Wiggle */
.wiggle {
    animation: wiggle 1s ease infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Fade In Animations with Direction */
.fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom In */
.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flip In */
.flip-in {
    animation: flipIn 0.6s ease-out;
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: rotateY(0);
    }
}

/* Slide and Fade Combined */
.slide-fade {
    animation: slideFade 0.8s ease-out;
}

@keyframes slideFade {
    from {
        opacity: 0;
        transform: translateX(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Gradient Animation Background */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Rotating Border */
.rotating-border {
    position: relative;
    overflow: hidden;
}

.rotating-border::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent,
        var(--cyan),
        var(--pink),
        var(--violet),
        transparent
    );
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotating-border::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--white);
    border-radius: inherit;
    z-index: 1;
}

/* Text Reveal Animation */
.text-reveal {
    opacity: 0;
    animation: textReveal 1s ease forwards;
}

@keyframes textReveal {
    from {
        opacity: 0;
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    to {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--pink);
    white-space: nowrap;
    animation: typing 3s steps(40) 1s 1 normal both,
               blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Confetti Effect (decorative elements) */
.confetti {
    position: relative;
}

.confetti::before,
.confetti::after {
    content: '🎉';
    position: absolute;
    font-size: 2rem;
    opacity: 0;
    animation: confettiFall 3s ease-in-out infinite;
}

.confetti::before {
    left: 20%;
    animation-delay: 0.5s;
}

.confetti::after {
    right: 20%;
    animation-delay: 1s;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100px) rotate(360deg);
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 201, 240, 0.2);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress Bar Animation */
.progress-bar {
    height: 4px;
    background: var(--light-gray);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--pink));
    animation: progressLoad 2s ease forwards;
}

@keyframes progressLoad {
    from { width: 0%; }
    to { width: 100%; }
}

/* Reveal on Scroll - Add to elements */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
