/* ============================================
   Bugy Studios — Animations
   Dark Luxe Theme
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    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 fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    }
    50% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.25);
    }
}

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

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        max-height: 500px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(139, 92, 246, 0.1);
    }
    50% {
        border-color: rgba(139, 92, 246, 0.3);
    }
}

/* ============================================
   Scroll Animation Classes
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Directional variants */
.animate-on-scroll.fade-left {
    transform: translateX(-20px);
}

.animate-on-scroll.fade-left.visible {
    transform: translateX(0);
}

.animate-on-scroll.fade-right {
    transform: translateX(20px);
}

.animate-on-scroll.fade-right.visible {
    transform: translateX(0);
}

.animate-on-scroll.scale-in {
    transform: scale(0.95);
}

.animate-on-scroll.scale-in.visible {
    transform: scale(1);
}

.animate-on-scroll.fade-down {
    transform: translateY(-20px);
}

.animate-on-scroll.fade-down.visible {
    transform: translateY(0);
}

/* ============================================
   Stagger Delay Classes
   ============================================ */

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
.stagger-7 { transition-delay: 0.7s; }
.stagger-8 { transition-delay: 0.8s; }

/* ============================================
   Hover Animation Utilities
   ============================================ */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-border-glow {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hover-border-glow:hover {
    border-color: var(--color-card-border);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.08);
}

/* ============================================
   Page Transitions
   ============================================ */

.page-enter {
    animation: fadeInUp 0.5s ease;
}

.page-exit {
    animation: fadeIn 0.3s ease reverse;
}

/* ============================================
   Loading States
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-card) 25%,
        var(--color-card-hover) 50%,
        var(--color-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
    border-radius: 4px;
    width: 80%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
}

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

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* ============================================
   Particles Container
   ============================================ */

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.main-content {
    position: relative;
    z-index: 1;
    padding-top: 72px; /* Account for fixed navbar */
}

/* ============================================
   Float Animation Utility
   ============================================ */

.float {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-fast {
    animation: float 4s ease-in-out infinite;
}

/* ============================================
   Gradient Animation Utility
   ============================================ */

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

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .float,
    .float-slow,
    .float-fast {
        animation: none;
    }

    .particles-container {
        display: none;
    }
}
