/* ====================================
   NxtHive - Animations
   ==================================== */

/* ============ KEYFRAMES ============ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

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

@keyframes float {

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

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

@keyframes pulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

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

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

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
    }
}

/* ============ ANIMATION CLASSES ============ */

/* Initial hidden state for animated elements */
.animate {
    opacity: 0;
}

.animate.in-view {
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Fade Up Animation */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
}

.animate-fade-up.in-view {
    animation: fadeUp 0.6s ease forwards;
}

/* Fade In Animation */
.animate-fade-in {
    opacity: 0;
}

.animate-fade-in.in-view {
    animation: fadeIn 0.6s ease forwards;
}

/* Fade In Left */
.animate-fade-left {
    opacity: 0;
    transform: translateX(-30px);
}

.animate-fade-left.in-view {
    animation: fadeInLeft 0.6s ease forwards;
}

/* Fade In Right */
.animate-fade-right {
    opacity: 0;
    transform: translateX(30px);
}

.animate-fade-right.in-view {
    animation: fadeInRight 0.6s ease forwards;
}

/* Scale In */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
}

.animate-scale-in.in-view {
    animation: scaleIn 0.6s ease forwards;
}

/* Staggered Animation Delays */
.animate-delay-1 {
    animation-delay: 0.1s;
}

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

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

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

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

.animate-delay-6 {
    animation-delay: 0.6s;
}

.animate-delay-7 {
    animation-delay: 0.7s;
}

.animate-delay-8 {
    animation-delay: 0.8s;
}

/* ============ SPECIAL EFFECTS ============ */

/* Floating Animation (for hero visual) */
.float {
    animation: float 6s ease-in-out infinite;
}

/* Pulsing Glow */
.pulse-glow {
    animation: glow 3s ease-in-out infinite;
}

/* Gradient Animation */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* ============ HERO VISUAL ============ */
.hero-visual {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: float 8s ease-in-out infinite;
}

.hero-blob-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #8B5CF6 0%, #C4B5FD 100%);
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.hero-blob-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #A78BFA 0%, #DDD6FE 100%);
    bottom: 20%;
    left: 10%;
    animation-delay: -2s;
}

.hero-blob-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
    top: 50%;
    left: 30%;
    animation-delay: -4s;
}

/* ============ COUNTER ANIMATION ============ */
.counter {
    display: inline-block;
}

/* ============ HOVER EFFECTS ============ */

/* Link Underline Effect */
.link-underline {
    position: relative;
}

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

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

/* Card Lift Effect */
.card-lift {
    transition: transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

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

/* ============ PAGE TRANSITIONS ============ */
.page-transition {
    animation: fadeUp 0.5s ease;
}

/* ============ LOADING ANIMATION ============ */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {

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

    .animate,
    .animate-fade-up,
    .animate-fade-in,
    .animate-fade-left,
    .animate-fade-right,
    .animate-scale-in {
        opacity: 1;
        transform: none;
    }
}

/* ============ MODAL ANIMATIONS ============ */
@keyframes modalBackdropFade {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

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

@keyframes modalSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
}

@keyframes successCheckmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

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

@keyframes successRing {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

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

@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}