:root {
    --neon-blue: #00f3ff;
    --neon-pink: #bc13fe;
    --bg-dark: #050505;
    --glass: rgba(20, 20, 20, 0.8);
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    color: #fff;
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px; /* Efecto cuadrícula */
}

/* Layout Principal */
.main-interface {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* Header */
.cyber-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--neon-blue);
    background: var(--glass);
    backdrop-filter: blur(10px);
    margin-bottom: 10px;
}

.brand h1 {
    margin: 0;
    font-family: var(--font-head);
    font-size: 1.8rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
}

.flicker { color: #fff; animation: flicker 2s infinite; }

.status-line {
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 2px;
}

/* Botones Cyber */
.cyber-btn {
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 10px 20px;
    font-family: var(--font-head);
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
    text-transform: uppercase;
    display: inline-block;
}

.cyber-btn:hover {
    background: var(--neon-pink);
    color: #000;
    box-shadow: 0 0 15px var(--neon-pink);
}

/* Grid de Contenido */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 15px;
    height: 100%;
    overflow: hidden;
}

/* Video */
.video-sector {
    display: flex;
    flex-direction: column;
}

.screen-frame {
    flex-grow: 1;
    border: 1px solid #333;
    position: relative;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

video {
    width: 100%;
    height: 100%;
}

.video-meta {
    margin-top: 15px;
    padding: 15px;
    background: var(--glass);
    border: 1px solid #333;
    border-left: 3px solid var(--neon-blue);
}

#current-channel {
    margin: 0;
    font-family: var(--font-head);
    letter-spacing: 1px;
}

/* Inputs manuales */
.manual-input-box {
    display: flex;
    margin-top: 10px;
    gap: 10px;
}
.manual-input-box input {
    flex: 1;
    background: rgba(0,0,0,0.5);
    border: 1px solid #444;
    color: var(--neon-blue);
    padding: 5px 10px;
    font-family: monospace;
}
.cyber-btn-small {
    background: var(--neon-blue);
    border: none;
    font-weight: bold;
    cursor: pointer;
    padding: 0 15px;
}

/* Playlist / Sidebar */
.playlist-sector {
    background: var(--glass);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.search-bar {
    padding: 15px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    margin-left: 10px;
    outline: none;
    font-family: var(--font-head);
    text-transform: uppercase;
}

.list-container {
    flex-grow: 1;
    overflow-y: auto;
}

.list-container::-webkit-scrollbar { width: 5px; }
.list-container::-webkit-scrollbar-thumb { background: var(--neon-blue); }

#channel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.channel-item {
    padding: 12px 15px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-item:hover {
    background: rgba(0, 243, 255, 0.1);
    padding-left: 20px; /* Efecto de desplazamiento */
    color: var(--neon-blue);
}

.channel-item.active {
    background: rgba(0, 243, 255, 0.2);
    border-left: 4px solid var(--neon-blue);
    color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue);
}

.stats-footer {
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    color: #555;
    border-top: 1px solid #333;
}

/* ANIMACIONES */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
    52% { opacity: 0.2; }
    54% { opacity: 1; }
}

/* RESPONSIVE */
@media (max-width: 850px) {
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .video-sector { height: 40vh; }
}

/* Posicionamiento del Visualizador */
#audio-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%; /* Ocupa el 30% inferior del video */
    pointer-events: none; /* Permite hacer clic en el video a través del canvas */
    z-index: 10;
    opacity: 0.9;
    /* Efecto de fusión para que brille sobre el video */
    mix-blend-mode: screen; 
}