/* ==========================================
   ANIMATIONS & TRANSITIONS
   Smooth scroll animations, micro-interactions
   ========================================== */

/* === KEYFRAME ANIMATIONS === */

@keyframes fadeInUp {
    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);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes rotateGlow {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === SCROLL ANIMATIONS === */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-left.visible {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-right.visible {
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-scale.visible {
    animation: scaleIn 0.6s ease-out forwards;
}

/* === STAGGER ANIMATIONS === */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

/* === BUTTON ANIMATIONS === */
.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animated:hover::after {
    width: 300px;
    height: 300px;
}

/* === GLOW EFFECTS === */
.glow-on-hover {
    transition: box-shadow 0.3s ease-in-out;
}

.glow-on-hover:hover {
    animation: glowPulse 2s infinite;
}

.glow-blue {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.glow-green {
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.5);
}

/* === FLOATING ANIMATION === */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* === SHIMMER EFFECT === */
.shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* === CARD HOVER EFFECTS === */
.card-lift {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

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

/* === IMAGE ZOOM ON HOVER === */
.image-zoom-container {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.image-zoom {
    transition: transform 0.5s ease-out;
}

.image-zoom-container:hover .image-zoom {
    transform: scale(1.15);
}

/* === PULSE ANIMATION === */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

/* === UNDERLINE ANIMATION === */
.underline-animated {
    position: relative;
    display: inline-block;
}

.underline-animated::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width 0.3s ease-out;
}

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

/* === SLIDE IN ANIMATIONS === */
.slide-in-bottom {
    animation: slideInFromBottom 0.6s ease-out;
}

/* === GRADIENT SHIFT === */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

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

/* === ROTATE ON HOVER === */
.rotate-on-hover {
    transition: transform 0.3s ease-out;
}

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

/* === BOUNCE === */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.bounce-on-hover:hover {
    animation: bounce 1s;
}

/* === FADE IN === */
.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

/* === LOADING SPINNER === */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* === BACKGROUND PARTICLES ANIMATION === */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(52, 211, 153, 0.1) 0%, transparent 50%);
    animation: float 10s ease-in-out infinite;
    pointer-events: none;
}

/* === SMOOTH REVEAL === */
@keyframes reveal {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0 0 0 0);
    }
}

.reveal-animation {
    animation: reveal 1s ease-out;
}

/* === NEON BORDER ANIMATION === */
@keyframes neonBorder {

    0%,
    100% {
        border-color: var(--color-primary);
        box-shadow: 0 0 10px var(--color-primary);
    }

    33% {
        border-color: var(--color-secondary);
        box-shadow: 0 0 10px var(--color-secondary);
    }

    66% {
        border-color: var(--color-accent);
        box-shadow: 0 0 10px var(--color-accent);
    }
}

.neon-border-animated {
    animation: neonBorder 3s ease-in-out infinite;
}

/* === PERFORMANCE OPTIMIZATIONS === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}