/* Variables de Diseño Core */
:root {
    --bg-dark: #0a0b10;
    --bg-card: rgba(20, 22, 37, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 255, 255, 0.15);
    
    /* Colores Temáticos Neón */
    --neon-blue: #00f2fe;
    --neon-purple: #9d4edd;
    --neon-pink: #ff007f;
    --neon-green: #39ff14;
    
    /* Colores del Sistema */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --accent-gradient: linear-gradient(135deg, #ff007f 0%, #7928ca 100%);
    --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.4);
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset y Estilos Globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Decoraciones del Fondo (Círculos Flotantes Desenfocados) */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.15;
    pointer-events: none;
}

.circle-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--neon-blue);
    animation: floating 12s ease-in-out infinite alternate;
}

.circle-2 {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background: var(--neon-pink);
    animation: floating 16s ease-in-out infinite alternate-reverse;
}

.circle-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: var(--neon-purple);
    opacity: 0.1;
    animation: floating 20s ease-in-out infinite alternate;
}

@keyframes floating {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 8%) scale(1.1); }
}

/* Contenedor de la App */
.app-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    min-height: 100vh;
}

/* Header */
.app-header {
    text-align: center;
    margin-top: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.brand h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 40%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h1 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-logo-svg {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Contenido Principal */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* 1. Tarjeta del Reproductor Principal (Glassmorphism) */
.player-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.8rem;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.player-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.player-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--primary-gradient);
    opacity: 0.8;
}

/* Contenedor del Logo con Animaciones */
.logo-display-container {
    position: relative;
    width: 170px;
    height: 170px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.logo-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: var(--transition-smooth);
}

/* El SVG cargado dinámicamente */
.logo-wrapper svg {
    width: 80%;
    height: 80%;
    transition: var(--transition-smooth);
}

.default-logo-placeholder {
    font-size: 4rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulsePlaceholder 3s infinite ease-in-out;
}

@keyframes pulsePlaceholder {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Clases de animación controladas por JS */
.playing .logo-wrapper {
    border-color: var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.25), inset 0 2px 10px rgba(255, 255, 255, 0.1);
    animation: rotateLogo 20s linear infinite;
}

/* Animación diferente por canal para demostrar dinamismo */
.playing.jazz-style .logo-wrapper {
    border-color: #ffd700;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.25);
    animation: pulseLogo 2.5s ease-in-out infinite alternate;
}

.playing.electro-style .logo-wrapper {
    border-color: var(--neon-pink);
    box-shadow: 0 0 35px rgba(255, 0, 127, 0.3);
    animation: rotateLogo 8s linear infinite;
}

.playing.chill-style .logo-wrapper {
    border-color: #ff9f43;
    box-shadow: 0 0 35px rgba(255, 159, 67, 0.25);
    animation: pulseLogo 4s ease-in-out infinite alternate;
}

@keyframes rotateLogo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseLogo {
    0% { transform: scale(1); }
    100% { transform: scale(1.04); }
}

/* Pequeñas ondas indicadoras de reproducción */
.playback-waves {
    position: absolute;
    bottom: -10px;
    display: flex;
    gap: 4px;
    height: 25px;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

.playing .playback-waves {
    opacity: 1;
    transform: translateY(0);
}

.playback-waves span {
    width: 4px;
    height: 5px;
    background-color: var(--neon-blue);
    border-radius: 2px;
    animation: soundWaves 1s ease-in-out infinite alternate;
}

.playback-waves span:nth-child(2) { height: 10px; animation-delay: 0.15s; background-color: var(--neon-purple); }
.playback-waves span:nth-child(3) { height: 20px; animation-delay: 0.3s; background-color: var(--neon-pink); }
.playback-waves span:nth-child(4) { height: 14px; animation-delay: 0.45s; background-color: var(--neon-purple); }
.playback-waves span:nth-child(5) { height: 8px; animation-delay: 0.6s; background-color: var(--neon-blue); }

@keyframes soundWaves {
    0% { height: 5px; }
    100% { height: 24px; }
}

/* Info de la Estación */
.station-meta {
    max-width: 500px;
    z-index: 2;
}

.active-station-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.active-station-genre {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-blue);
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.active-station-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Visualizador de Espectro Canvas */
.visualizer-container {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

#audioVisualizer {
    width: 100%;
    height: 100%;
    display: block;
}

/* Controles de Reproducción */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 400px;
    margin-top: 0.5rem;
    z-index: 2;
}

.control-btn {
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.play-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.35);
}

.play-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.5);
}

.play-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.play-btn:disabled {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Control de Volumen */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.volume-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.volume-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.slider-container {
    position: relative;
    flex-grow: 1;
    height: 6px;
    display: flex;
    align-items: center;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    z-index: 2;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--neon-blue);
    border: none;
    box-shadow: 0 0 10px var(--neon-blue);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.volume-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px 0 0 3px;
    pointer-events: none;
    width: 80%; /* se actualizará por JS */
}

/* 2. Sección de Señales Predetermadas */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    color: var(--text-main);
    border-left: 3px solid var(--neon-blue);
    padding-left: 0.75rem;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* Tarjetas de Estaciones Individuales */
.station-card {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.station-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-gradient);
    z-index: -1;
}

.station-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.08);
}

.station-card.active {
    border-color: var(--neon-blue);
    background: rgba(0, 242, 254, 0.06);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.12);
}

/* Contenedor del mini-logo en la tarjeta */
.station-logo-mini {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.station-logo-mini svg {
    width: 70%;
    height: 70%;
}

.station-card:hover .station-logo-mini {
    background: rgba(255, 255, 255, 0.08);
}

.station-card.active .station-logo-mini {
    background: rgba(0, 242, 254, 0.1);
    border-color: rgba(0, 242, 254, 0.3);
}

/* Info del canal en la tarjeta */
.station-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: visible;
}

.station-name {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
}

.station-genre-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.station-card.active .station-genre-tag {
    color: var(--neon-blue);
}

/* Footer */
.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Animación sutil de pulso para la marca */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.animate-pulse {
    animation: pulse 2s infinite;
}
