/**
 * MU PROFECÍA — Music Player Ultimate Stylesheet
 * Estética MMORPG Azul Eléctrico / Dark Glow
 */

:root {
    --mp-bg: rgba(6, 12, 24, 0.94);
    --mp-card-border: rgba(0, 220, 255, 0.45);
    --mp-cyan: #00f0ff;
    --mp-cyan-glow: rgba(0, 240, 255, 0.55);
    --mp-blue: #0077ff;
    --mp-blue-glow: rgba(0, 119, 255, 0.5);
    --mp-text-main: #f0f6fc;
    --mp-text-sub: #8b949e;
    --mp-accent: #00d4ff;
}

/* ==========================================================================
   WIDGET PRINCIPAL (ESQUINA SUPERIOR IZQUIERDA)
   ========================================================================== */
#mu-music-player {
    position: fixed;
    top: 20px;
    left: 24px;
    width: 330px;
    background: var(--mp-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--mp-card-border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85),
                0 0 28px rgba(0, 119, 255, 0.35),
                inset 0 0 16px rgba(0, 240, 255, 0.08);
    color: var(--mp-text-main);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    z-index: 99999;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

#mu-music-player.mp-minimized {
    height: 44px !important;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 119, 255, 0.25);
}

#mu-music-player.mp-hidden {
    display: none !important;
}

/* CABECERA DEL REPRODUCTOR */
.mp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(0, 119, 255, 0.25) 0%, rgba(0, 240, 255, 0.1) 100%);
    border-bottom: 1px solid rgba(0, 240, 255, 0.25);
    cursor: default;
}

.mp-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--mp-cyan);
    text-shadow: 0 0 10px var(--mp-cyan-glow);
}

.mp-header-title i {
    font-size: 0.85rem;
    color: var(--mp-cyan);
}

.mp-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-hdr-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: #cbd5e1;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-hdr-btn:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--mp-cyan);
    color: #ffffff;
    box-shadow: 0 0 10px var(--mp-cyan-glow);
}

/* CUERPO DEL REPRODUCTOR */
.mp-body {
    padding: 14px 16px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* INFO Y PORTADA */
.mp-track-info-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mp-cover-box {
    position: relative;
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1.5px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 14px rgba(0, 119, 255, 0.4);
    overflow: hidden;
    background: #020617;
}

.mp-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

#mu-music-player.mp-playing .mp-cover-img {
    transform: scale(1.04);
}

.mp-meta-box {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.mp-server-tag {
    font-size: 0.75rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mp-status-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--mp-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    margin-bottom: 2px;
}

.mp-track-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.mp-track-artist {
    font-size: 0.72rem;
    color: var(--mp-text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ECUALIZADOR ANIMADO */
.mp-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    margin-top: 4px;
}

.mp-eq-bar {
    width: 3px;
    height: 3px;
    background: linear-gradient(180deg, var(--mp-cyan) 0%, var(--mp-blue) 100%);
    border-radius: 1px;
    transition: height 0.15s ease;
}

#mu-music-player.mp-playing .mp-eq-bar:nth-child(1) { animation: eqBounce 0.8s infinite 0.1s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(2) { animation: eqBounce 0.6s infinite 0.3s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(3) { animation: eqBounce 0.9s infinite 0.2s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(4) { animation: eqBounce 0.7s infinite 0.4s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(5) { animation: eqBounce 1.0s infinite 0.1s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(6) { animation: eqBounce 0.6s infinite 0.5s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(7) { animation: eqBounce 0.8s infinite 0.2s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(8) { animation: eqBounce 0.7s infinite 0.3s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(9) { animation: eqBounce 0.9s infinite 0.1s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(10){ animation: eqBounce 0.6s infinite 0.4s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(11){ animation: eqBounce 0.8s infinite 0.2s; }
#mu-music-player.mp-playing .mp-eq-bar:nth-child(12){ animation: eqBounce 0.5s infinite 0.3s; }

@keyframes eqBounce {
    0%, 100% { height: 3px; opacity: 0.5; }
    50% { height: 14px; opacity: 1; box-shadow: 0 0 6px var(--mp-cyan); }
}

/* BARRA DE PROGRESO Y TIEMPOS */
.mp-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-time-text {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

.mp-time-text.live-badge {
    color: #ff3366;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
}

.mp-time-text.live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff3366;
    box-shadow: 0 0 8px #ff3366;
    animation: livePulse 1.2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

.mp-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.mp-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--mp-blue), var(--mp-cyan));
    border-radius: 4px;
    box-shadow: 0 0 8px var(--mp-cyan-glow);
    position: relative;
}

.mp-progress-knob {
    position: absolute;
    right: -4px;
    top: -3px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 1.5px solid var(--mp-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--mp-cyan);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.mp-progress-bar:hover .mp-progress-knob {
    opacity: 1;
}

/* BOTONES DE CONTROL DE REPRODUCCIÓN */
.mp-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 2px 0;
}

.mp-ctrl-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mp-ctrl-btn:hover {
    color: var(--mp-cyan);
    text-shadow: 0 0 10px var(--mp-cyan-glow);
    transform: scale(1.15);
}

.mp-ctrl-btn.active {
    color: var(--mp-cyan);
    text-shadow: 0 0 12px var(--mp-cyan);
}

.mp-play-btn {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, rgba(0, 119, 255, 0.9), rgba(0, 240, 255, 0.9));
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    color: #020617 !important;
    font-size: 0.95rem;
    border-radius: 50%;
    box-shadow: 0 0 18px var(--mp-cyan-glow), inset 0 0 8px rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-play-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 24px var(--mp-cyan), inset 0 0 12px #ffffff;
}

/* CONTROL DE VOLUMEN */
.mp-volume-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px;
}

.mp-vol-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.mp-vol-btn:hover {
    color: var(--mp-cyan);
}

.mp-vol-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.mp-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 1.5px solid var(--mp-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--mp-cyan);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.mp-vol-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.mp-vol-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    min-width: 28px;
    text-align: right;
}

/* BOTONES DE FUENTES */
.mp-sources-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 4px;
}

.mp-src-tab {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 6px;
    padding: 6px 2px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-src-tab i {
    font-size: 0.78rem;
}

.mp-src-tab:hover {
    background: rgba(0, 119, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.4);
    color: #ffffff;
}

.mp-src-tab.active {
    background: linear-gradient(180deg, rgba(0, 119, 255, 0.3) 0%, rgba(0, 240, 255, 0.15) 100%);
    border: 1px solid var(--mp-cyan);
    color: var(--mp-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.35), inset 0 0 8px rgba(0, 240, 255, 0.15);
    text-shadow: 0 0 6px var(--mp-cyan-glow);
}

.mp-src-tab.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* FOOTER DE ESTADO */
.mp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(2, 6, 23, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.68rem;
    color: #64748b;
}

.mp-footer-src {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-footer-src-name {
    color: var(--mp-cyan);
    font-weight: 700;
}

.mp-footer-gear {
    color: #64748b;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.mp-footer-gear:hover {
    color: var(--mp-cyan);
    transform: rotate(45deg);
}

/* CONTENEDOR OCULTO DE MOTORES (IFRAMES / SPOTIFY) */
#mu-mp-hidden-engines {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    pointer-events: none;
    overflow: hidden;
    top: -9999px;
    left: -9999px;
}

/* ==========================================================================
   BOTÓN FLOTANTE LATERAL IZQUIERDO Y TOOLTIP AUTOPLAY
   ========================================================================== */
.float-music-btn {
    background: linear-gradient(135deg, rgba(0, 119, 255, 0.95) 0%, rgba(0, 240, 255, 0.7) 100%) !important;
    border: 1.5px solid rgba(0, 240, 255, 0.7) !important;
    box-shadow: 0 4px 18px rgba(0, 119, 255, 0.6), 0 0 15px rgba(0, 240, 255, 0.4) !important;
    position: relative;
    cursor: pointer;
}

.float-music-btn i {
    color: #ffffff !important;
    font-size: 1.1rem !important;
}

.float-music-btn:hover {
    filter: brightness(1.25) !important;
    box-shadow: 0 6px 25px rgba(0, 240, 255, 0.8) !important;
}

/* TOOLTIP SPEECH BUBBLE DE AUTOPLAY */
#mu-mp-autoplay-bubble {
    position: fixed;
    left: 80px;
    bottom: 230px; /* Alineado verticalmente con el stack flotante */
    background: rgba(6, 12, 24, 0.96);
    border: 1.5px solid var(--mp-cyan);
    border-radius: 12px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 20px var(--mp-cyan-glow);
    z-index: 999999;
    display: none;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    animation: mpBubblePulse 1.8s infinite ease-in-out;
    user-select: none;
}

#mu-mp-autoplay-bubble.active {
    display: flex;
}

#mu-mp-autoplay-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid var(--mp-cyan);
}

@keyframes mpBubblePulse {
    0%, 100% {
        transform: translateX(0);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.9), 0 0 15px var(--mp-cyan-glow);
    }
    50% {
        transform: translateX(4px);
        box-shadow: 0 8px 35px rgba(0, 0, 0, 0.9), 0 0 28px var(--mp-cyan);
    }
}

/* ==========================================================================
   MODAL DE SELECCIÓN PERSONALIZADA DE MÚSICA (USUARIO)
   ========================================================================== */
#mu-mp-user-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

#mu-mp-user-modal.active {
    display: flex;
}

.mp-modal-box {
    width: 90%;
    max-width: 440px;
    background: rgba(8, 14, 28, 0.98);
    border: 1.5px solid var(--mp-cyan);
    border-radius: 14px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 119, 255, 0.5);
    overflow: hidden;
    color: #ffffff;
}

.mp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(90deg, rgba(0, 119, 255, 0.3), rgba(0, 240, 255, 0.15));
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    font-weight: 800;
    color: var(--mp-cyan);
    font-size: 0.9rem;
}

.mp-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mp-modal-btn-reset {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.mp-modal-btn-reset:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ==========================================================================
   RESPONSIVE / MOBILE ADAPTATION
   ========================================================================== */
@media (max-width: 768px) {
    #mu-music-player {
        top: 10px;
        left: 10px;
        width: calc(100vw - 20px);
        max-width: 320px;
    }
    #mu-mp-autoplay-bubble {
        left: 65px;
        bottom: 180px;
    }
}
