/* Variables para Modo Oscuro (Por Defecto) */
.dark-theme {
    --bg-color: #0a0a12;
    --card-bg: rgba(18, 18, 36, 0.88);
    --radio-overlay-top: rgba(255,255,255,0.08);
    --radio-overlay-bottom: rgba(255,255,255,0.02);
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff0055;
    --text-main: #ffffff;
    --text-muted: #8a8a9e;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-glow: rgba(0, 243, 255, 0.1);
    --radio-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), 0 0 60px rgba(0, 243, 255, 0.16);
}

/* Variables para Modo Claro */
.light-theme {
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.92);
    --radio-overlay-top: rgba(255,255,255,0.22);
    --radio-overlay-bottom: rgba(255,255,255,0.08);
    --neon-cyan: #0081a7;
    --neon-magenta: #f07167;
    --text-main: #1a1a2e;
    --text-muted: #6c757d;
    --border-color: rgba(0, 0, 0, 0.12);
    --shadow-glow: rgba(0, 129, 167, 0.15);
    --radio-shadow: 0 30px 90px rgba(0, 0, 0, 0.16), 0 0 60px rgba(0, 129, 167, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease, border 0.4s ease;
}

body {
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--text-main);
}

/* Botón de cambio de tema superior */
.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Contenedor Principal */
.radio-container {
    background: linear-gradient(180deg, var(--radio-overlay-top), var(--radio-overlay-bottom)), url('assets/logounico.png');
    background-color: var(--card-bg);
    background-repeat: no-repeat;
    background-position: center 12%;
    background-size: 72%;
    background-blend-mode: overlay;
    width: 95%;
    max-width: 420px;
    padding: 34px;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(28px) saturate(120%);
    box-shadow: var(--radio-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

/* Logo centrado dentro del contenedor (tema) */
.radio-container .center-logo {
    display: none;
}

/* Asegurar que el resto del contenido esté por encima del logo */
.radio-container > *:not(.center-logo):not(.glow-bg) {
    position: relative;
    z-index: 2;
}

.glow-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--shadow-glow) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: -1;
}

.badge {
    background: var(--neon-magenta);
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 0 10px var(--neon-magenta);
}

header h1 {
    font-size: 2rem;
    margin-top: 15px;
    letter-spacing: 3px;
    text-shadow: 0 0 8px var(--shadow-glow);
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Visualizador */
.visualizer-container {
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 25px 0;
}

.pulse-ring {
    width: 120px;
    height: 120px;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 20px var(--neon-cyan);
}

.radio-container.playing .pulse-ring {
    animation: pulse 2s infinite linear;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 60px;
    z-index: 2;
}

.bar {
    width: 6px;
    height: 15px;
    background: var(--neon-cyan);
    border-radius: 3px;
}

.radio-container.playing .bar:nth-child(1) { animation: bounce 0.6s infinite alternate 0.1s; }
.radio-container.playing .bar:nth-child(2) { animation: bounce 0.4s infinite alternate 0.3s; }
.radio-container.playing .bar:nth-child(3) { animation: bounce 0.7s infinite alternate 0.0s; }
.radio-container.playing .bar:nth-child(4) { animation: bounce 0.5s infinite alternate 0.2s; }
.radio-container.playing .bar:nth-child(5) { animation: bounce 0.6s infinite alternate 0.4s; }

/* Caja de Metadatos de la Canción */
.metadata-box {
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

#song-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#song-artist {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 60%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--neon-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* Botones Inferiores */
.controls {
    margin-top: 20px;
}

.main-btn {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.main-btn:hover {
    background: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 25px var(--neon-cyan);
}

/* Botón de Instalación */
.install-pwa-btn {
    margin-top: 20px;
    background: var(--neon-cyan);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes bounce {
    0% { height: 10px; }
    100% { height: 55px; }
}
