/* CRT Base Styling */
body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #a1e8a1; /* Mint green */
    font-family: 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* CRT Effect Container */
.crt-effect {
    position: relative;
    width: 800px;
    height: 600px;
    background-color: #000;
    border: 2px solid #2a5c2a;
    box-shadow: 0 0 20px rgba(66, 255, 66, 0.3),
                inset 0 0 20px rgba(66, 255, 66, 0.2);
    overflow: hidden;
}

/* Scanlines Effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

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

/* Flicker Effect */
.flicker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 5;
    pointer-events: none;
    animation: flicker 0.01s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.95; }
    5% { opacity: 0.98; }
    10% { opacity: 0.99; }
    15% { opacity: 0.97; }
    20% { opacity: 0.93; }
    25% { opacity: 1; }
    30% { opacity: 0.99; }
    35% { opacity: 0.98; }
    40% { opacity: 0.97; }
    45% { opacity: 0.96; }
    50% { opacity: 0.94; }
    55% { opacity: 0.93; }
    60% { opacity: 0.94; }
    65% { opacity: 0.95; }
    70% { opacity: 0.96; }
    75% { opacity: 0.97; }
    80% { opacity: 0.98; }
    85% { opacity: 0.99; }
    90% { opacity: 0.96; }
    95% { opacity: 0.94; }
    100% { opacity: 0.95; }
}

/* Particle Background */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Terminal Window */
.terminal {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.terminal-header {
    border-bottom: 1px solid #2a5c2a;
    padding: 5px;
    background: linear-gradient(to bottom, #0a1a0a, #061006);
}

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 5px;
}

.title {
    font-weight: bold;
    text-shadow: 0 0 5px rgba(161, 232, 161, 0.7);
}

.controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border: 1px solid #2a5c2a;
    cursor: pointer;
}

.control-btn:hover {
    background-color: #2a5c2a;
    color: #000;
}

.menu-bar {
    display: flex;
    gap: 15px;
    padding: 5px;
    font-size: 0.9em;
}

.menu-item {
    cursor: pointer;
}

.menu-item:hover {
    text-decoration: underline;
}

.terminal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* Visualizer */
.visualizer-container {
    position: relative;
    height: 150px;
    margin-bottom: 15px;
    border: 1px solid #2a5c2a;
    background-color: rgba(10, 20, 10, 0.5);
    overflow: hidden;
}

#waveform {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 3;
}

#particle-wave {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Playlist */
.playlist-container {
    flex: 1;
    border: 1px solid #2a5c2a;
    margin-bottom: 10px;
    background-color: rgba(10, 20, 10, 0.3);
    display: flex;
    flex-direction: column;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 1px solid #2a5c2a;
    background: linear-gradient(to bottom, #0a1a0a, #061006);
}

.playlist-title {
    font-weight: bold;
}

.playlist-controls {
    display: flex;
    gap: 5px;
}

.pl-btn {
    background: none;
    border: 1px solid #2a5c2a;
    color: #a1e8a1;
    cursor: pointer;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 18px;
}

.pl-btn:hover {
    background-color: #2a5c2a;
    color: #000;
}

.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.playlist li {
    padding: 8px 10px;
    border-bottom: 1px dotted #1a3a1a;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist li:hover {
    background-color: rgba(42, 92, 42, 0.3);
}

.playlist li.playing {
    background-color: rgba(42, 92, 42, 0.5);
    color: #d1ffd1;
    font-weight: bold;
}

/* Player Controls */
.player-controls {
    border: 1px solid #2a5c2a;
    padding: 10px;
    background-color: rgba(10, 20, 10, 0.3);
}

.time-display {
    text-align: center;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.progress-container {
    height: 10px;
    background-color: #0a1a0a;
    border: 1px solid #2a5c2a;
    margin-bottom: 10px;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #1a3a1a, #2a5c2a);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #d1ffd1;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.ctrl-btn {
    background: none;
    border: 1px solid #2a5c2a;
    color: #a1e8a1;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background-color: #2a5c2a;
    color: #000;
    transform: scale(1.1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-icon {
    font-size: 14px;
}

#volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: #1a3a1a;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #a1e8a1;
    cursor: pointer;
    border-radius: 50%;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-top: 1px solid #2a5c2a;
    background: linear-gradient(to bottom, #0a1a0a, #061006);
    font-size: 0.8em;
}

.status-item {
    opacity: 0.8;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1a0a;
}

::-webkit-scrollbar-thumb {
    background: #2a5c2a;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a7a3a;
}

/* Glow Effect for Text */
.glow {
    text-shadow: 0 0 5px rgba(161, 232, 161, 0.7),
                 0 0 10px rgba(161, 232, 161, 0.5),
                 0 0 15px rgba(161, 232, 161, 0.3);
}

/* Terminal Cursor Blink */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.cursor {
    animation: blink 1s infinite;
}