/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

/* ==========================================================================
   1. KEYFRAME DECLARATIONS
   ========================================================================== */

/* Fade-In Upwards Entry */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Loader Ring Spin */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Subtle Shimmer/Reflection across active cards */
@keyframes shimmer {
    100% {
        left: 125%;
    }
}

/* Pulse Glow Effects */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(10, 132, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(10, 132, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(10, 132, 255, 0);
    }
}

/* Animated Gradient Hero BG */
@keyframes animateGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Float loop */
@keyframes floatY {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Ripple/Wave effects */
@keyframes rippleEffect {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* ==========================================================================
   2. REUSABLE ANIMATION WRAPPERS
   ========================================================================== */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.animate-active {
    opacity: 1;
    transform: none !important;
}

.fade-up {
    transform: translateY(40px);
}

.fade-down {
    transform: translateY(-40px);
}

.fade-left {
    transform: translateX(-40px);
}

.fade-right {
    transform: translateX(40px);
}

/* Stagger delay classes */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Dynamic Background Glow */
.hero-glow-bg {
    background: linear-gradient(-45deg, rgba(10, 132, 255, 0.04), rgba(0, 200, 150, 0.04), rgba(29, 29, 31, 0.02), rgba(10, 132, 255, 0.02));
    background-size: 400% 400%;
    animation: animateGradient 15s ease infinite;
}

/* Shimmer Overlay Class */
.shimmer-card {
    position: relative;
    overflow: hidden;
}

.shimmer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: 0.75s;
}

[data-theme="dark"] .shimmer-card::before {
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

.shimmer-card:hover::before {
    animation: shimmer 1s ease-in-out;
}

/* Floating Loop Widget */
.floating-element {
    animation: floatY 6s ease-in-out infinite;
}

/* Pulsing beacon */
.status-beacon {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-beacon::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    animation: rippleEffect 2s ease-out infinite;
}

/* ==========================================================================
   3. SCREEN LOADERS
   ========================================================================== */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-logo {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}
