/* ========================================
   ADVANCED ANIMATIONS & MICRO-INTERACTIONS
   ======================================== */

/* Page Transition Animations */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.page-transition-enter {
    animation: pageEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-exit {
    animation: pageExit 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger Animation for Lists */
@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item {
    animation: staggerFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.stagger-item:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-item:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-item:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-item:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-item:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger-item:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger-item:nth-child(8) {
    animation-delay: 0.4s;
}

/* Loading Skeleton Animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-card) 0%,
            rgba(0, 212, 255, 0.1) 50%,
            var(--bg-card) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--border-radius);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 2rem;
    width: 40%;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 200px;
    border-radius: var(--border-radius-lg);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s infinite;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Glow Pulse Animation */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.8);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Micro-interactions */

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide In Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-up {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-down {
    animation: slideInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Number Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Loading Dots */
@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-dots {
    display: inline-flex;
    gap: 0.5rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Hover Glow Effect */
.hover-glow {
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    box-shadow: var(--glow-primary);
}

/* Hover Scale Effect */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Focus Ring */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.3);
}

/* Tooltip Animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip {
    animation: tooltipFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   CYBERPUNK & PREMIUM REFINEMENTS
   ======================================== */

/* Text Shimmer Effect */
@keyframes textShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.text-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 1) 50%,
            rgba(255, 255, 255, 0.6) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 4s linear infinite;
}

@keyframes cyberReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.cyber-reveal {
    animation: cyberReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Border Flow Animation */
@keyframes borderFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.border-flow {
    position: relative;
    z-index: 1;
}

.border-flow::after {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: linear-gradient(90deg,
            var(--accent-primary),
            var(--accent-secondary),
            var(--accent-primary));
    background-size: 200% 200%;
    animation: borderFlow 3s ease infinite;
    border-radius: inherit;
    opacity: 0.3;
}

/* Smooth Navigation Active State */
.navbar-link {
    position: relative;
    transition: color 0.3s ease;
}

.navbar-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-primary);
}

.navbar-link:hover::before,
.navbar-link.active::before {
    width: 100%;
}

/* Glass Card Tilt (Simulated with simple hover) */
.glass-tilt {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    transform-style: preserve-3d;
}

.glass-tilt:hover {
    transform: translateY(-5px) rotateX(2deg) rotateY(1deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), var(--glow-primary);
}

/* Enhanced Ripple */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.3);
    pointer-events: none;
    transform: scale(0);
    animation: ripple-animation 0.5s ease-out forwards;
    z-index: 0;
}

@keyframes ripple-animation {
    from {
        transform: scale(0);
        opacity: 0.5;
    }

    to {
        transform: scale(4);
        opacity: 0;
    }
}