/**
 * ChadOps Animation System
 * Shared animations aligned with main website patterns
 * Scroll-triggered reveals, staggered delays, premium micro-interactions
 */

/* ==================== KEYFRAMES ==================== */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    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 fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.6;
    }
}

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-5deg) scale(0.95);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(255, 215, 0, 0.15);
    }
    50% {
        border-color: rgba(255, 215, 0, 0.4);
    }
}

/* ==================== SCROLL-TRIGGERED REVEALS ==================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

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

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

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

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

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

.anim-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.anim-fade-in-down {
    animation: fadeInDown 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.anim-fade-in-left {
    animation: fadeInLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.anim-fade-in-right {
    animation: fadeInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.anim-fade-in-scale {
    animation: fadeInScale 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

.anim-shimmer {
    background: linear-gradient(
        90deg,
        transparent 25%,
        rgba(255, 215, 0, 0.08) 50%,
        transparent 75%
    );
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

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

.anim-pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

.anim-scroll-bounce {
    animation: scrollBounce 2s ease-in-out infinite;
}

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

.anim-border-glow {
    animation: borderGlow 3s ease-in-out infinite;
}

/* ==================== STAGGER DELAYS ==================== */

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

/* For elements that start hidden before animation */
.stagger-hidden {
    opacity: 0;
}

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

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

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

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Gold shimmer overlay on hover */
.hover-shimmer {
    position: relative;
    overflow: hidden;
}

.hover-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.05),
        transparent
    );
    transition: left 0.6s ease;
    pointer-events: none;
}

.hover-shimmer:hover::after {
    left: 100%;
}

/* ==================== LOADING SKELETON ==================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ==================== SCROLL INDICATOR ==================== */

.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .anim-fade-in-up,
    .anim-fade-in-down,
    .anim-fade-in-left,
    .anim-fade-in-right,
    .anim-fade-in-scale,
    .anim-shimmer,
    .anim-float,
    .anim-pulse-glow,
    .anim-scroll-bounce,
    .anim-gradient,
    .anim-border-glow {
        animation: none;
    }

    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }

    .stagger-hidden {
        opacity: 1;
    }
}
