/* =========================================
   MEDIAWEB PLAYER V3 - FULL PAGE UI
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

#player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2147483647;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    transition: all 0.4s ease;
    overflow: hidden;
    box-sizing: border-box;
}

#player * {
    box-sizing: border-box;
}

/* =========================================
   VISTA MINIMIZADA (Bottom Bar)
   ========================================= */
#player.mediaweb-minimized {
    height: 90px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}
#player.mediaweb-expanded .mw-minimized-view {
    display: none;
}
.mw-minimized-view {
    display: flex;
    height: 100%;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
}
.mw-cover {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.mw-min-content {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
}
.mw-min-top {
    position: absolute;
    top: -30px; /* Hide logic or integrate */
    display: none;
}
.mw-min-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.mw-min-info h3 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mw-min-info p {
    margin: 0;
    font-size: 13px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mw-min-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}
.mw-btn-icon {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
}
.mw-btn-icon:hover {
    opacity: 1;
}
.mw-play-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--mw-primary, #00958b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.mw-play-circle:hover {
    transform: scale(1.05);
}

.mw-badge-alaire {
    background: var(--mw-primary, #00958b);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 1px;
}
.mw-bars { font-size: 8px; transform: scaleX(0.8); }

/* VISTA MINIMIZADA MOBILE (Apilada) */
@media (max-width: 767px) {
    #player.mediaweb-minimized {
        height: 120px;
        padding: 10px 15px;
    }
    .mw-minimized-view {
        padding: 0;
        align-items: flex-start;
    }
    .mw-cover {
        width: 100px;
        height: 100px;
    }
    .mw-min-content {
        flex-direction: column;
        align-items: stretch;
        height: 100px;
        justify-content: space-between;
    }
    .mw-min-top {
        display: flex;
        position: relative;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }
    .mw-min-info h3 { font-size: 14px; }
    .mw-min-info p { font-size: 12px; }
    .mw-min-controls { justify-content: space-between; margin-top: auto; }
}


/* =========================================
   VISTA EXPANDIDA (Full Screen Split)
   ========================================= */
#player.mediaweb-expanded {
    height: 100vh;
    top: 0;
}
#player.mediaweb-minimized .mw-expanded-view {
    display: none;
}
.mw-expanded-view {
    display: flex;
    width: 100%;
    height: 100%;
}

/* LEFT PANE (History) */
.mw-history-pane {
    width: 45%;
    max-width: 500px;
    height: 100%;
    background: var(--mw-primary, #00958b);
    display: flex;
    flex-direction: column;
}
.mw-history-header {
    padding: 25px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mw-red-dot {
    width: 6px;
    height: 6px;
    background: #ff3b30;
    border-radius: 50%;
}
.mw-mobile-history-close {
    display: none;
    margin-left: auto;
    cursor: pointer;
}
.mw-history-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}
.mw-history-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
}
.mw-history-item.active {
    background: rgba(0,0,0,0.1);
}
.mw-history-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 15px;
}
.mw-history-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 15px;
}
.mw-history-item-info h4 {
    margin: 0 0 3px 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mw-history-item-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mw-history-time {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}
.mw-history-item.active .mw-history-time {
    background: #ff3b30;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    opacity: 1;
}

/* RIGHT PANE (Main Player) */
.mw-player-pane {
    flex: 1;
    height: 100%;
    position: relative;
    background: #222;
    overflow: hidden;
}
.mw-bg-blur {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.4);
    transform: scale(1.2);
    z-index: 0;
}
.mw-player-pane-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.mw-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
}
.mw-radio-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}
#mw-btn-open-history {
    display: none; /* Only on mobile */
}
#mw-btn-collapse {
    cursor: pointer;
}

.mw-player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    text-align: center;
}
.mw-cover-large {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin-bottom: 40px;
}
.mw-player-center .mw-badge-alaire {
    margin-bottom: 15px;
}
.mw-song-large {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
}
.mw-artist-large {
    margin: 0;
    font-size: 16px;
    opacity: 0.8;
}

.mw-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px;
}
.mw-play-circle-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--mw-primary, #00958b);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

/* =========================================
   MOBILE EXPANDED RESPONSIVE
   ========================================= */
@media (max-width: 767px) {
    .mw-expanded-view {
        flex-direction: column;
    }
    .mw-history-pane {
        width: 100%;
        max-width: 100%;
        display: none; /* Oculto por defecto en móvil */
    }
    .mw-history-pane.show-mobile {
        display: flex;
    }
    .mw-mobile-history-close {
        display: block;
    }
    .mw-player-pane {
        width: 100%;
    }
    .mw-player-pane.hide-mobile {
        display: none;
    }
    #mw-btn-open-history {
        display: flex;
    }
    .mw-cover-large {
        width: 250px;
        height: 250px;
    }
    .mw-song-large {
        font-size: 20px;
    }
}
