/* ==========================================================================
   EREBOR / NAUFRA - FLOATING SERVER RADIO WIDGET
   Ubicación: Bottom-Right (Esquina inferior derecha)
   Paleta: Nightmare Red Glassmorphism (#ff2a2a, #8f0000 & acentos #ffbe2c)
   ========================================================================== */

.mu-radio-dock {
    position: fixed;
    bottom: 22px;
    right: 24px;
    z-index: 100005;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
}

/* ==========================================================================
   PÍLDORA COMPACTA FLOTANTE
   ========================================================================== */
.mu-radio-pill {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 7px;
    border-radius: 50px;
    background: rgba(16, 4, 8, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 42, 42, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72), 0 0 20px var(--blue-glow, rgba(255, 42, 42, 0.3));
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
}

.mu-radio-pill:hover {
    border-color: var(--blue-hover, #ff6b5f);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.82), 0 0 25px rgba(255, 42, 42, 0.45);
}

/* Disco de Vinilo de la Píldora */
.mu-radio-disc-box {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle, #3c080d 20%, #120408 100%);
    border: 1.5px solid var(--blue-main, #ff2a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold, #ffbe2c);
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 42, 42, 0.45);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.mu-radio-disc-box:hover {
    transform: scale(1.08);
}

.mu-radio-disc-icon {
    display: inline-block;
    transition: color 0.3s;
}

/* Rotación suave cuando está en reproducción */
.is-playing .mu-radio-disc-icon,
.is-playing .mu-radio-vinyl-disc {
    animation: muVinylRotate 5s linear infinite;
}

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

.mu-radio-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 68, 68, 0.78);
    opacity: 0;
    pointer-events: none;
}

.is-playing .mu-radio-pulse {
    animation: muRadioPulse 2s infinite;
}

@keyframes muRadioPulse {
    0% { transform: scale(1); opacity: 0.85; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Textos informativos de la Píldora */
.mu-radio-pill-info {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    min-width: 110px;
    max-width: 160px;
}

.mu-radio-tag {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--accent-gold, #ffbe2c);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mu-radio-song-ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

.mu-radio-song-ticker {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    display: inline-block;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}

/* Ecualizador Animado de Barras */
.mu-radio-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 15px;
    padding: 0 3px;
}

.eq-bar {
    width: 3px;
    height: 4px;
    background: linear-gradient(to top, var(--blue-main, #ff2a2a), var(--accent-gold, #ffbe2c));
    border-radius: 2px;
    transition: height 0.2s ease;
}

.is-playing .eq-bar.bar-1 { animation: eqAnim 0.7s ease-in-out infinite alternate; }
.is-playing .eq-bar.bar-2 { animation: eqAnim 1.1s ease-in-out infinite alternate 0.2s; }
.is-playing .eq-bar.bar-3 { animation: eqAnim 0.6s ease-in-out infinite alternate 0.4s; }
.is-playing .eq-bar.bar-4 { animation: eqAnim 0.9s ease-in-out infinite alternate 0.1s; }

@keyframes eqAnim {
    0% { height: 3px; }
    50% { height: 14px; }
    100% { height: 6px; }
}

/* Botones Rápidos en Píldora */
.mu-radio-pill-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
}

.mu-radio-quick-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none !important;
}

.mu-radio-quick-btn:hover {
    background: var(--blue-main, #ff2a2a);
    color: #ffffff;
    border-color: var(--accent-gold, #ffbe2c);
    transform: scale(1.12);
    box-shadow: 0 0 12px var(--blue-glow, rgba(255, 42, 42, 0.55));
}

.mu-radio-quick-btn:active {
    transform: scale(0.95);
}

.mu-radio-expand-btn {
    background: rgba(255, 42, 42, 0.16);
    border-color: rgba(255, 42, 42, 0.45);
    color: var(--blue-hover, #ff6b5f);
}

/* ==========================================================================
   PANEL EXPANDIDO (GLASS PLAYER POPOVER)
   ========================================================================== */
.mu-radio-panel {
    pointer-events: auto;
    position: absolute;
    bottom: 58px;
    right: 0;
    width: 320px;
    z-index: 100010;
    border-radius: 18px;
    background: radial-gradient(circle at 50% 0%, rgba(56, 8, 12, 0.97) 0%, rgba(12, 4, 8, 0.98) 85%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 42, 42, 0.55);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.88), 0 0 35px rgba(255, 42, 42, 0.32);
    padding: 16px;
    animation: muRadioPanelIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    user-select: none;
}

@keyframes muRadioPanelIn {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.94);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Esquinas RPG en Panel */
.mu-radio-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--blue-main, #ff2a2a);
    border-style: solid;
    pointer-events: none;
    z-index: 10;
}
.corner-tl { top: 5px; left: 5px; border-width: 2px 0 0 2px; }
.corner-tr { top: 5px; right: 5px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 5px; left: 5px; border-width: 0 0 2px 2px; }
.corner-br { bottom: 5px; right: 5px; border-width: 0 2px 2px 0; }

/* Cabecera del Panel */
.mu-radio-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.mu-radio-panel-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-live-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88;
}

.radio-live-text {
    font-size: 0.72rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
}

.radio-shuffle-badge {
    background: linear-gradient(135deg, var(--blue-main, #ff2a2a), #ff7a1a);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(255, 42, 42, 0.4);
}

.mu-radio-close-panel-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mu-radio-close-panel-btn:hover {
    background: var(--blue-main, #ff2a2a);
    color: #ffffff;
    border-color: var(--blue-hover, #ff6b5f);
}

/* Disco de Vinilo Central del Panel */
.mu-radio-cover-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.mu-radio-vinyl-disc {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, #3c080d 25%, #160409 75%, #060103 100%);
    border: 2px solid var(--blue-main, #ff2a2a);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 0 0 22px rgba(255, 42, 42, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinyl-grooves {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.vinyl-center-label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-main, #ff2a2a), var(--blue-dark, #8f0000));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.85rem;
    border: 1px solid var(--accent-gold, #ffbe2c);
}

/* Información de la Pista en Panel */
.mu-radio-now-playing {
    text-align: center;
    margin-bottom: 12px;
}

.mu-radio-playing-label {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--blue-hover, #ff6b5f);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.mu-radio-track-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.mu-radio-track-count {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
}

/* Barra de Tiempo y Progreso */
.mu-radio-progress-wrap {
    margin-bottom: 14px;
}

.mu-radio-progress-bar-bg {
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.mu-radio-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue-main, #ff2a2a), var(--accent-gold, #ffbe2c));
    border-radius: 10px;
    transition: width 0.15s linear;
}

.mu-radio-time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
    font-weight: 600;
}

/* Controles Principales */
.mu-radio-main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 14px;
}

.mu-radio-ctrl-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none !important;
}

.mu-radio-ctrl-btn:hover {
    background: rgba(255, 42, 42, 0.22);
    border-color: var(--blue-main, #ff2a2a);
    color: var(--accent-gold, #ffbe2c);
    transform: scale(1.1);
}

.mu-radio-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-main, #ff2a2a), var(--blue-dark, #8f0000));
    border: 2px solid var(--accent-gold, #ffbe2c);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 42, 42, 0.5);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none !important;
}

.mu-radio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 26px rgba(255, 42, 42, 0.75);
}

.mu-radio-play-btn:active {
    transform: scale(0.95);
}

/* Slider de Volumen */
.mu-radio-volume-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px;
    margin-bottom: 12px;
}

.mu-radio-mute-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    outline: none !important;
}

.mu-radio-mute-btn:hover {
    color: var(--accent-gold, #ffbe2c);
}

.mu-radio-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.mu-radio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--blue-main, #ff2a2a);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(255, 42, 42, 0.85);
    transition: transform 0.15s ease;
}

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

.mu-radio-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--blue-main, #ff2a2a);
    cursor: pointer;
    border: 2px solid #ffffff;
}

/* Desplegable de Pistas */
.mu-radio-playlist-toggle-wrap {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.mu-radio-playlist-toggle-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none !important;
}

.mu-radio-playlist-toggle-btn:hover {
    background: rgba(255, 42, 42, 0.15);
    border-color: rgba(255, 42, 42, 0.45);
    color: var(--accent-gold, #ffbe2c);
}

.mu-radio-playlist-dropdown {
    margin-top: 8px;
    max-height: 140px;
    overflow-y: auto;
    background: rgba(12, 4, 8, 0.96);
    border: 1px solid rgba(255, 42, 42, 0.35);
    border-radius: 8px;
    padding: 4px;
}

.mu-radio-track-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mu-radio-track-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    transition: all 0.15s ease;
}

.mu-radio-track-item:hover {
    background: rgba(255, 42, 42, 0.16);
    color: var(--accent-gold, #ffbe2c);
    transform: translateX(3px);
}

.mu-radio-track-item.is-active {
    background: linear-gradient(90deg, rgba(255, 42, 42, 0.28), rgba(143, 0, 0, 0.3));
    border-left: 3px solid var(--blue-main, #ff2a2a);
    color: #ffffff;
    font-weight: 700;
}

.mu-radio-track-item-num {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.45);
    min-width: 14px;
}

.mu-radio-track-item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilos de Barra de Scroll en Desplegable */
.mu-radio-playlist-dropdown::-webkit-scrollbar {
    width: 4px;
}
.mu-radio-playlist-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
.mu-radio-playlist-dropdown::-webkit-scrollbar-thumb {
    background: var(--blue-main, #ff2a2a);
    border-radius: 4px;
}

/* ==========================================================================
   RESPONSIVIDAD PARA DISPOSITIVOS MÓVILES
   ========================================================================== */
@media (max-width: 768px) {
    .mu-radio-dock {
        bottom: 16px;
        right: 14px;
    }
    .mu-radio-pill {
        padding: 5px 10px 5px 6px;
        gap: 8px;
    }
    .mu-radio-pill-info {
        max-width: 110px;
    }
    .mu-radio-panel {
        width: 290px;
        right: 0;
        bottom: 52px;
        padding: 14px;
    }
    .mu-radio-vinyl-disc {
        width: 75px;
        height: 75px;
    }
}
