/* ========================================
   Global Animations & Micro-Interactions
   ======================================== */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes float {

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

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

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.2);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(37, 99, 235, 0.15);
    }
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

/* Reveal on scroll (JS toggles .revealed) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-smooth);
}

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

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

/* Hover micro-interactions */
.hover-lift {
    transition: transform 0.3s var(--transition-smooth), box-shadow 0.3s var(--transition-smooth);
}

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

/* Magnetic button effect (subtle) */
.btn {
    transition: all 0.4s var(--transition-smooth);
}

.btn:active {
    transform: scale(0.97);
}

/* Link underline animation */
.link-animated {
    position: relative;
    display: inline-block;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width 0.3s var(--transition-smooth);
}

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

/* Icon spin on hover */
.icon-hover-spin:hover i,
.icon-hover-spin:hover .icon {
    animation: iconSpin 0.5s var(--transition-bounce);
}

@keyframes iconSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(10deg) scale(1.1);
    }

    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* Gradient border on hover */
.gradient-border-hover {
    position: relative;
}

.gradient-border-hover::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: var(--gradient-accent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gradient-border-hover:hover::after {
    opacity: 1;
}

/* Stagger animation helper classes */
.stagger>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger>*:nth-child(6) {
    animation-delay: 0.3s;
}

/* Page transition fade */
main {
    animation: fadeIn 0.4s ease-out;
}

/* Focus styles (accessibility) */
.btn:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}