/* ==============================================
   PIXEL ART EFFECTS & ANIMATIONS
   ============================================== */

/* Pixelated image filter */
.pixelated {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Pixel glitch effect */
@keyframes pixelGlitch {
    0% { transform: translate(0); }
    10% { transform: translate(-2px, 2px); }
    20% { transform: translate(-4px, 0px); }
    30% { transform: translate(4px, 2px); }
    40% { transform: translate(-2px, -2px); }
    50% { transform: translate(2px, 2px); }
    60% { transform: translate(-4px, 0px); }
    70% { transform: translate(4px, 2px); }
    80% { transform: translate(-2px, -2px); }
    90% { transform: translate(2px, 0px); }
    100% { transform: translate(0); }
}

.pixel-glitch {
    animation: pixelGlitch 0.3s ease-in-out;
}

/* Pixel shake effect */
@keyframes pixelShake {
    0% { transform: translate(0); }
    25% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, -1px); }
    75% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

.pixel-shake {
    animation: pixelShake 0.5s ease-in-out infinite;
}

/* Pixel floating animation */
@keyframes pixelFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.pixel-float {
    animation: pixelFloat 3s ease-in-out infinite;
}

/* Pixel pulse effect */
@keyframes pixelPulse {
    0% { 
        box-shadow: 4px 4px 0 #333;
        transform: scale(1);
    }
    50% { 
        box-shadow: 6px 6px 0 #333;
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 4px 4px 0 #333;
        transform: scale(1);
    }
}

.pixel-pulse {
    animation: pixelPulse 2s ease-in-out infinite;
}

/* Scanline effect */
@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 20px; }
}

.scanlines {
    position: relative;
}

.scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    animation: scanlines 1s linear infinite;
    pointer-events: none;
    opacity: 0.3;
}

/* CRT TV effect */
.crt-effect {
    position: relative;
    background: #000;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 
        inset 0 0 50px rgba(0, 255, 0, 0.1),
        0 0 50px rgba(0, 0, 0, 0.8);
}

.crt-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.3) 100%),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 255, 0, 0.05) 2px,
            rgba(0, 255, 0, 0.05) 4px
        );
    pointer-events: none;
    border-radius: 8px;
}

/* Pixel grid overlay */
.pixel-grid {
    position: relative;
}

.pixel-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 7px,
            rgba(212, 175, 55, 0.1) 7px,
            rgba(212, 175, 55, 0.1) 8px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 7px,
            rgba(212, 175, 55, 0.1) 7px,
            rgba(212, 175, 55, 0.1) 8px
        );
    pointer-events: none;
    opacity: 0.5;
}

/* 8-bit style transitions */
.pixel-transition {
    transition: all 0.1s steps(4, end);
}

/* Retro button press effect */
.retro-button-press {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #333 !important;
}

/* Pixel text shadow */
.pixel-text-shadow {
    text-shadow: 
        2px 2px 0 #333,
        4px 4px 0 #222;
}

/* Blocky hover effects */
.blocky-hover {
    transition: all 0.1s step-end;
}

.blocky-hover:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #333;
}

/* Pixel loading animation */
@keyframes pixelLoad {
    0% { width: 0%; }
    25% { width: 25%; }
    50% { width: 50%; }
    75% { width: 75%; }
    100% { width: 100%; }
}

.pixel-loading-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border: 2px solid #d4af37;
    position: relative;
    overflow: hidden;
}

.pixel-loading-fill {
    height: 100%;
    background: #d4af37;
    animation: pixelLoad 2s steps(8, end) infinite;
}

/* Retro blink effect */
@keyframes retroBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.retro-blink {
    animation: retroBlink 1s step-end infinite;
}
