/* ============================================
   Y2K ANIMATIONS & EFFECTS
   ============================================ */

/* Y2K Elements - Floating icons */
.y2k-elements {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 0, 0.1);
    animation: float 15s infinite linear;
    opacity: 0;
}

.floating-icon:nth-child(1) { animation-delay: 0s; left: 10%; }
.floating-icon:nth-child(2) { animation-delay: 1s; left: 20%; }
.floating-icon:nth-child(3) { animation-delay: 2s; left: 30%; }
.floating-icon:nth-child(4) { animation-delay: 3s; left: 40%; }
.floating-icon:nth-child(5) { animation-delay: 4s; left: 50%; }
.floating-icon:nth-child(6) { animation-delay: 5s; left: 60%; }
.floating-icon:nth-child(7) { animation-delay: 6s; left: 70%; }
.floating-icon:nth-child(8) { animation-delay: 7s; left: 80%; }
.floating-icon:nth-child(9) { animation-delay: 8s; left: 90%; }
.floating-icon:nth-child(10) { animation-delay: 9s; left: 15%; }
.floating-icon:nth-child(11) { animation-delay: 10s; left: 25%; }
.floating-icon:nth-child(12) { animation-delay: 11s; left: 35%; }
.floating-icon:nth-child(13) { animation-delay: 12s; left: 45%; }
.floating-icon:nth-child(14) { animation-delay: 13s; left: 55%; }
.floating-icon:nth-child(15) { animation-delay: 14s; left: 65%; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Scan lines effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.5) 50%
    );
    background-size: 100% 4px;
    opacity: 0.1;
    animation: scanlines 10s linear infinite;
}

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

/* CRT monitor effect */
.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0.3;
    z-index: 9998;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

/* Pixel grid animation for home page */
.pixel-grid div {
    background: #333;
    transition: background 0.3s;
}

.pixel-grid div:nth-child(odd):hover {
    background: #ff00ff;
}

.pixel-grid div:nth-child(even):hover {
    background: #00ffff;
}

/* Glitch hover effect */
.glitch-hover {
    position: relative;
    display: inline-block;
}

.glitch-hover::before,
.glitch-hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-hover::before {
    animation: glitch-hover 3s infinite;
    color: #ff00ff;
    z-index: -1;
}

.glitch-hover::after {
    animation: glitch-hover 2s infinite reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-hover {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Loading animation */
.loading-dots {
    display: inline-flex;
    gap: 5px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ffff;
    animation: loading 1.5s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
    background: #ff00ff;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
    background: #ffff00;
}

@keyframes loading {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

/* Matrix rain effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100px;
    width: 20px;
    height: 100px;
    color: #00ff00;
    font-family: monospace;
    font-size: 18px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    animation: matrix-rain 10s linear infinite;
}

@keyframes matrix-rain {
    0% { 
        top: -100px;
        opacity: 1;
    }
    100% { 
        top: 100vh;
        opacity: 0;
    }
}

/* Audio visualization bars */
.audio-bar {
    display: inline-block;
    width: 4px;
    background: linear-gradient(to top, #ff00ff, #00ffff);
    margin: 0 2px;
    animation: audioBar 1.5s infinite ease-in-out;
}

.audio-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-bar:nth-child(5) { animation-delay: 0.4s; }
.audio-bar:nth-child(6) { animation-delay: 0.5s; }
.audio-bar:nth-child(7) { animation-delay: 0.6s; }
.audio-bar:nth-child(8) { animation-delay: 0.7s; }
.audio-bar:nth-child(9) { animation-delay: 0.8s; }
.audio-bar:nth-child(10) { animation-delay: 0.9s; }

@keyframes audioBar {
    0%, 100% { height: 10px; }
    50% { height: 50px; }
}

/* Button pulse effect */
.pulse {
    position: relative;
}

.pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    border: 2px solid #00ffff;
    animation: pulseRing 2s infinite;
    opacity: 0;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 3px solid #00ffff;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 2px;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #00ffff }
}

/* Hover glow effect */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px #ff00ff, 0 0 40px #00ffff;
    transform: translateY(-5px);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 0, 0.3);
    border-radius: 50%;
    border-top-color: #00ffff;
    animation: spin 1s linear infinite;
}

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

/* Neon flicker */
.neon-flicker {
    animation: flicker 3s infinite alternate;
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 4px #fff,
            0 0 11px #fff,
            0 0 19px #fff,
            0 0 40px #ff00ff,
            0 0 80px #ff00ff,
            0 0 90px #ff00ff,
            0 0 100px #ff00ff,
            0 0 150px #ff00ff;
    }
    20%, 24%, 55% {       
        text-shadow: none;
    }
}