/* =============================================
   PANEL DEL REPRODUCTOR (Siempre oscuro, flotante)
   ============================================= */
.player-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: calc(var(--player-width) - 40px);
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    z-index: 900;
    overflow-x: hidden;
    overflow-y: auto;
    color: #ffffff;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(108, 92, 231, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    transition: background 0.8s ease;
}

.player-header {
    text-align: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: var(--spacing-md);
}

.player-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: 1.3rem;
    font-weight: 700;
}

.player-logo i {
    color: var(--primary-color);
}

.player-logo .accent {
    color: var(--accent-color);
}

.player-subtitle {
    font-size: 0.8rem;
    color: #6c6c8a;
    margin-top: var(--spacing-xs);
}

.player-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: var(--radius-full);
    animation: blink 1.5s infinite;
}

.status-indicator.playing {
    background: #2ecc71;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: #b2b2b2;
}

.player-cover {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.cover-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #16213e;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #6c6c8a;
    background: linear-gradient(135deg, #16213e, #0f0f1a);
}

.cover-glow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 40px;
    background: var(--primary-color);
    filter: blur(30px);
    opacity: 0.3;
}

.cover-visualizer {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
}

.cover-visualizer span {
    width: 6px;
    background: linear-gradient(to top, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    animation: visualize 0.8s ease-in-out infinite;
}

.cover-visualizer span:nth-child(1) {
    height: 60%;
    animation-delay: 0s;
}

.cover-visualizer span:nth-child(2) {
    height: 100%;
    animation-delay: 0.1s;
}

.cover-visualizer span:nth-child(3) {
    height: 40%;
    animation-delay: 0.2s;
}

.cover-visualizer span:nth-child(4) {
    height: 80%;
    animation-delay: 0.3s;
}

.cover-visualizer span:nth-child(5) {
    height: 50%;
    animation-delay: 0.4s;
}

@keyframes visualize {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0.4);
    }
}

.player-info {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.player-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: 1.1rem;
    font-weight: 700;
}

.player-branding i {
    color: var(--primary-color);
}

.player-branding .accent {
    color: var(--accent-color);
}

.player-info .tagline {
    font-size: 0.75rem;
    color: #6c6c8a;
    margin-top: var(--spacing-xs);
}

.player-station-info {
    text-align: center;
    padding: var(--spacing-sm) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-md);
}

.player-station-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.player-station-info p {
    font-size: 0.8rem;
    color: #b2b2b2;
}

.player-progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.time-current,
.time-total {
    font-size: 0.7rem;
    color: #6c6c8a;
    min-width: 40px;
}

.time-total {
    text-align: right;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #16213e;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

/* =============================================
   RESPONSIVE PLAYER (MOBILE) 
   ============================================= */

/* El mini-bar y el collapse-btn están ocultos por defecto en PC */
.player-mini-bar,
.player-collapse-btn {
    display: none;
}

@media (max-width: 992px) {
    .player-panel {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        width: 100%;
        height: 80px;
        /* Altura minificada */
        border-radius: 24px 24px 0 0;
        margin: 0;
        z-index: 2000;
        transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden !important;
        padding: 0;
        display: block !important;
        /* Asegurar que sea visible */
    }

    /* Ocultar contenido normal cuando está minificado */
    .player-panel>*:not(.player-mini-bar):not(.player-collapse-btn) {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
    }

    /* Estado Expandido */
    .player-panel.expanded {
        height: 100%;
        border-radius: 0;
        overflow-y: auto !important;
        padding: var(--spacing-lg);
    }

    .player-panel.expanded>*:not(.player-mini-bar) {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Mini Bar Styles */
    .player-mini-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 80px;
        padding: 0 var(--spacing-md);
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10;
        cursor: pointer;
    }

    div#search-results {
        width: 298px;
    }

    .slider-indicators {
        display: none;
    }

    /* El gradiente del panel debe mantenerse */
    .player-panel.expanded {
        /* background: inherit; */
        /* Mantiene el color extraído por ColorThief */
    }

    .player-panel.expanded .player-mini-bar {
        display: none;
    }

    .mini-info {
        display: flex;
        align-items: center;
        gap: 12px;
        max-width: 70%;
    }

    .mini-logo {
        width: 45px;
        height: 45px;
        border-radius: 10px;
        object-fit: cover;
    }

    .mini-text {
        overflow: hidden;
    }

    #mini-station-name {
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        color: white;
    }

    .mini-controls {
        display: flex;
        align-items: center;
    }

    .mini-play-btn {
        width: 48px;
        height: 48px;
        background: var(--gradient-primary);
        border: none;
        border-radius: 50%;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
    }

    /* Collapse Button (solo en expandido) */
    .player-collapse-btn {
        display: none;
        position: absolute;
        top: 25px;
        left: 20px;
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: white;
        z-index: 20;
        justify-content: center;
        align-items: center;
    }

    .player-panel.expanded .player-collapse-btn {
        display: flex;
    }

    /* Ajustar logo en header mobile expandido para que no choque */
    .player-panel.expanded .player-header {
        margin-top: 30px;
    }
}

.player-install-app {
    margin-top: var(--spacing-lg);
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-install-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 80%;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-install-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
    filter: brightness(1.1);
}

.btn-install-app i {
    font-size: 1.1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.3s linear;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.control-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    padding: 0;
    background: #16213e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #b2b2b2;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.control-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.control-btn.main {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    max-width: 60px;
    max-height: 60px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.3rem;
    box-shadow: var(--shadow-glow);
}

.control-btn.main:hover {
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--primary-color);
    color: white;
}

.volume-slider {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: #16213e;
    border-radius: var(--radius-md);
}

.volume-slider input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #0f0f1a;
    border-radius: 3px;
    outline: none;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    cursor: pointer;
}