/* ===== GOOGLE FONT ===== */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
/* GOOGLE FONT */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* === CRT DASHBOARD SCOPED TO #crt-screen === */
#crt-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    background-color: #010101;
    color: #0f0;
    font-family: 'VT323', monospace;
    overflow: hidden;
}

/* HEADER */
#crt-screen header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#crt-screen header h1 {
    font-size: 28px;
    text-shadow: 0 0 4px #0f0, 0 0 10px #0f0;
    animation: flicker 1.5s infinite;
}

#crt-screen #logout-btn {
    font-family: 'VT323', monospace;
    background-color: #010101;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 6px 12px;
    cursor: pointer;
    animation: flicker 3s infinite;
}

#crt-screen #logout-btn:hover {
    background-color: #0f0;
    color: #000;
    box-shadow: 0 0 10px #0f0, 0 0 20px #0f0 inset;
}

/* QUEUE SECTION */
#crt-screen #queue-section {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #0f0;
    background-color: rgba(0,0,0,0.8);
    padding: 10px;
    margin-bottom: 10px;
}

#crt-screen .queue-item {
    border-bottom: 1px solid #0f0;
    padding: 4px 0;
}

#crt-screen .currently-playing {
    color: #0ff;
    border-left: 4px solid #0ff;
    padding-left: 6px;
    box-shadow: 0 0 10px #0ff inset;
}

/* VISUALIZER SECTION */
#crt-screen #visualizer-section {
    flex: 1;
    position: relative;
    border: 1px solid #0f0;
    background-color: #010101;
    overflow: hidden;
}

#crt-screen #visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* CRT SCANLINES & OVERLAY */
#crt-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        rgba(0,255,0,0.05) 0 2px,
        rgba(0,0,0,0) 2px 4px
    );
    z-index: 5;
    animation: wave 3s infinite linear;
}

/* ANIMATIONS */
@keyframes flicker {
    0%,19%,21%,23%,25%,54%,56%,100% {opacity:1;}
    20%,22%,24%,55% {opacity:0.85;}
}

@keyframes wave {
    0% {transform: translateY(0);}
    50% {transform: translateY(1px);}
    100% {transform: translateY(0);}
}

/* ===== GLOBAL CRT STYLE ===== */
body {
    margin: 0;
    padding: 20px;
    font-family: 'VT323', monospace;
    background-color: #010101;
    color: #0f0;
    text-shadow: 0 0 2px #0f0, 0 0 5px #0f0, 0 0 10px #0f0, 0 0 20px #0f0;
    position: relative;
    image-rendering: pixelated;
}

/* CRT scanlines */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        rgba(0, 255, 0, 0.05) 0 2px,
        rgba(0, 0, 0, 0) 2px 4px
    );
    z-index: 9999;
    animation: wave 3s infinite linear;
}

/* Flicker & wave animation */
@keyframes flicker {
    0%,19%,21%,23%,25%,54%,56%,100% {opacity:1;}
    20%,22%,24%,55% {opacity:0.85;}
}
@keyframes wave {
    0% {transform: translateY(0);}
    50% {transform: translateY(1px);}
    100% {transform: translateY(0);}
}

/* Headings */
h1, h2 {
    font-family: 'VT323', monospace;
    color: #0f0;
    text-shadow: 0 0 4px #0f0, 0 0 10px #0f0;
    animation: flicker 1.5s infinite;
    margin: 16px 0;
}

/* ===== SEARCH SECTION ===== */
#search-section {
    max-width: 700px;
    margin: 0 auto 20px;
    display: flex;
    gap: 8px;
    align-items: center;
}

#search-input {
    flex: 1;
    padding: 6px 10px;
    font-family: 'VT323', monospace;
    background-color: #010101;
    color: #0f0;
    border: 1px solid #0f0;
    box-shadow: 0 0 5px #0f0;
    animation: flicker 3s infinite;
}

#search-type, #search-btn, #unlock-explicit-btn {
    font-family: 'VT323', monospace;
    padding: 6px 12px;
    background-color: #010101;
    color: #0f0;
    border: 1px solid #0f0;
    cursor: pointer;
    animation: flicker 3s infinite;
}

#search-btn:hover, #unlock-explicit-btn:hover {
    background-color: #0f0;
    color: #000;
    box-shadow: 0 0 10px #0f0, 0 0 20px #0f0 inset;
}

/* ===== RESULTS SECTION ===== */
#results-section {
    max-width: 800px;
    margin: 0 auto 20px;
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0,0,0,0.7);
    border: 1px solid #0f0;
    padding: 6px;
    animation: flicker 1.8s infinite;
}

.result-img, .album-cover {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #0f0;
}

/* Explicit tag */
.explicit-tag {
    color: #f00;
    font-weight: bold;
    text-shadow: 0 0 2px #f00, 0 0 5px #f00;
}

/* Buttons inside results */
.result-buttons button {
    font-family: 'VT323', monospace;
    border: 1px solid #0f0;
    background-color: #010101;
    color: #0f0;
    padding: 4px 8px;
    cursor: pointer;
    animation: flicker 2s infinite;
}

.result-buttons button:hover {
    background-color: #0f0;
    color: #000;
    box-shadow: 0 0 5px #0f0;
}

/* ===== STUDENT QUEUE ===== */
#student-queue {
    max-width: 700px;
    margin: 0 auto 20px;
    border: 1px solid #0f0;
    background-color: rgba(0,0,0,0.85);
    padding: 10px;
    box-shadow: 0 0 10px #0f0 inset;
    border-radius: 6px;
}

.student-queue-item {
    display: flex;
    justify-content: space-between;
    padding: 6px;
    border: 1px solid #0f0;
    margin-bottom: 4px;
    background-color: rgba(0,0,0,0.65);
    animation: flicker 1.8s infinite;
}

/* Highlight currently playing track */
.student-queue-item.currently-playing {
    font-weight: bold;
    color: #0ff;
    box-shadow: 0 0 10px #0ff inset;
    border-left: 4px solid #0ff;
    padding-left: 8px;
}

/* Highlight student’s own track with rainbow border */
.student-queue-item.own-track {
    border: 2px solid transparent;
    padding-left: 6px;
    animation: rainbowBorder 2s linear infinite;
}

@keyframes rainbowBorder {
    0% { border-color: #ff0000; }
    16% { border-color: #ff9900; }
    32% { border-color: #ffff00; }
    48% { border-color: #00ff00; }
    64% { border-color: #00ffff; }
    80% { border-color: #0000ff; }
    100% { border-color: #ff00ff; }
}

/* New track highlight */
.new-track {
    animation: newTrackGlow 1.2s ease-in-out 2;
}

@keyframes newTrackGlow {
    0% { background-color: rgba(0,255,255,0.1); box-shadow: 0 0 5px #0ff inset; }
    50% { background-color: rgba(0,255,255,0.3); box-shadow: 0 0 15px #0ff inset, 0 0 30px #0ff;}
    100% { background-color: rgba(0,255,255,0.1); box-shadow: 0 0 5px #0ff inset;}
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .result-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .result-img {
        margin-bottom: 4px;
    }
}

/* General queue styling */
.currently-playing {
    background-color: rgba(0, 255, 0, 0.1);
    border-left: 4px solid #0f0;
    padding: 8px;
    margin-bottom: 8px;
}

.queue-item {
    border-bottom: 1px solid #0f0;
    padding: 4px 0;
}
