/*
 * ALTARS STUDIO - ANIMATIONS
 * Advanced Animations & Micro-interactions
 */

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    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 shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(238, 232, 167, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(238, 232, 167, 0.4);
    }
}

/* Tactical scan line effect */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* Data stream effect */
@keyframes dataStream {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* ==========================================
   SCROLL REVEAL SYSTEM
   ========================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for sequential reveals */
.scroll-reveal:nth-child(1) { transition-delay: 0ms; }
.scroll-reveal:nth-child(2) { transition-delay: 100ms; }
.scroll-reveal:nth-child(3) { transition-delay: 200ms; }
.scroll-reveal:nth-child(4) { transition-delay: 300ms; }
.scroll-reveal:nth-child(5) { transition-delay: 400ms; }

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

/* Lift on hover */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Glow on hover */
.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(238, 232, 167, 0.4);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--transition-base);
}

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

/* Rotate on hover */
.hover-rotate {
    transition: transform var(--transition-base);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ==========================================
   LOADING STATES
   ========================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-gold);
    border-top-color: transparent;
    border-radius: 50%;
    animation: rotate 0.6s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 25%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 75%
    );
    background-size: 200% 100%;
    animation: shimmerSkeleton 1.5s ease-in-out infinite;
}

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

/* ==========================================
   TACTICAL EFFECTS
   ========================================== */

/* Scan line overlay */
.scanline-effect {
    position: relative;
    overflow: hidden;
}

.scanline-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-gold),
        transparent
    );
    opacity: 0.3;
    animation: scanline 3s linear infinite;
    pointer-events: none;
}

/* Grid overlay */
.grid-overlay {
    position: relative;
}

.grid-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Data stream effect */
.data-stream {
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(
        180deg,
        transparent,
        var(--accent-gold),
        transparent
    );
    animation: dataStream 3s ease-in-out infinite;
    opacity: 0.3;
}

/* ==========================================
   CURSOR EFFECTS
   ========================================== */

.cursor-glow {
    cursor: pointer;
    position: relative;
}

.cursor-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(
        circle,
        rgba(238, 232, 167, 0.2),
        transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.cursor-glow:hover::before {
    width: 200px;
    height: 200px;
    opacity: 1;
}

/* ==========================================
   TRANSITIONS
   ========================================== */

/* Smooth page transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.animate-fadeIn { animation: fadeIn 0.6s ease; }
.animate-fadeInUp { animation: fadeInUp 0.8s ease; }
.animate-slideInLeft { animation: slideInLeft 0.6s ease; }
.animate-slideInRight { animation: slideInRight 0.6s ease; }
.animate-scaleIn { animation: scaleIn 0.5s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

/* Delay utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Duration utilities */
.duration-fast { animation-duration: 0.3s; }
.duration-base { animation-duration: 0.5s; }
.duration-slow { animation-duration: 0.8s; }

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* Enable GPU acceleration for animations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    .lazy-bg {
        transition: none !important;
    }
}

/* ==========================================
   LAZY LOADING EFFECTS
   ========================================== */

/* Lazy background images - smooth fade-in */
.lazy-bg {
    background-color: rgba(0, 0, 0, 0.3);
    transition: opacity 0.6s ease-in-out;
}

.lazy-bg:not(.bg-loaded) {
    opacity: 0.7;
}

.lazy-bg.bg-loaded {
    opacity: 1;
}
