body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Roboto Mono', monospace;
    color: #00ff00;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#visualizer-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url('https://static1.colliderimages.com/wordpress/wp-content/uploads/2023/04/the-matrix-reloaded-keanu-reeves.jpg') center center no-repeat;
    background-size: 60%;
    z-index: 1; /* Ensure it's behind controls but visible */
}

#visualizer-video, #visualizer-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

#color-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0);
    z-index: 2; /* Ensure it's above the video */
}

#controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
}

#quickSelect {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    position: relative;
    top: 10px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.5);
}

button, select, input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #00ff00;
    border-radius: 0;
    background-color: #0a0a0a;
    color: #00ff00;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover, select:hover {
    background-color: #00ff00;
    color: #0a0a0a;
}

input[type="text"], input[type="range"] {
    background-color: #0a0a0a;
    color: #00ff00;
}

.quick-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #007700;
    background-color: #001100;
    color: #00ff00;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-select:hover {
    background-color: #003300;
    color: #00ff00;
}

#fullscreenBtn, #exitFullscreenBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: block;
    padding: 8px 12px;
    font-size: 24px;
    border: 1px solid #007700;
    background-color: #001100;
    color: #00ff00;
    cursor: pointer;
    transition: all 0.3s;
}

#exitFullscreenBtn {
    display: none;
    font-size: 18px;
}

#loadingNotice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 20; /* Ensure it's above all */
}

#loadingWheel {
    border: 8px solid #001100;
    border-top: 8px solid #00ff00;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
    align-content: center;
    align-self: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 100%;
    background: url('https://static1.colliderimages.com/wordpress/wp-content/uploads/2023/04/the-matrix-reloaded-keanu-reeves.jpg') center center no-repeat;
    background-color: black;
}

.glitch {
    position: relative;
    font-size: 44px;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0.05em 0 0 #00ffff, -0.03em -0.04em 0 #ff00ff,
                0.025em 0.04em 0 #ffff00;
    animation: glitch 725ms infinite;
    z-index: 2;
}

.glitch span {
    position: absolute;
    top: 0;
    left: 0;
}

.glitch span:first-child {
    animation: glitch 500ms infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translate(-0.04em, -0.03em);
    opacity: 0.75;
}

.glitch span:last-child {
    animation: glitch 375ms infinite;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    transform: translate(0.04em, 0.03em);
    opacity: 0.75;
}

#threejs-canvas {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30%;
    z-index: 3;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 #00ffff, -0.03em -0.04em 0 #ff00ff,
                    0.025em 0.04em 0 #ffff00;
    }
    15% {
        text-shadow: 0.05em 0 0 #00ffff, -0.03em -0.04em 0 #ff00ff,
                    0.025em 0.04em 0 #ffff00;
    }
    16% {
        text-shadow: -0.05em -0.025em 0 #00ffff, 0.025em 0.035em 0 #ff00ff,
                    -0.05em -0.05em 0 #ffff00;
    }
    49% {
        text-shadow: -0.05em -0.025em 0 #00ffff, 0.025em 0.035em 0 #ff00ff,
                    -0.05em -0.05em 0 #ffff00;
    }
    50% {
        text-shadow: 0.05em 0.035em 0 #00ffff, 0.03em 0 0 #ff00ff,
                    0 -0.04em 0 #ffff00;
    }
    99% {
        text-shadow: 0.05em 0.035em 0 #00ffff, 0.03em 0 0 #ff00ff,
                    0 -0.04em 0 #ffff00;
    }
    100% {
        text-shadow: -0.05em 0 0 #00ffff, -0.025em -0.04em 0 #ff00ff,
                    -0.04em -0.025em 0 #ffff00;
    }
}

img[src=""] {
    display: none;
}
