/* ============================================
   Modern WP Music Player - Frontend Styles
   ============================================ */

:root {
    --mwp-primary: #6c63ff;
    --mwp-primary-dark: #574fd6;
    --mwp-bg: #1a1a2e;
    --mwp-card: #16213e;
    --mwp-card-light: #0f3460;
    --mwp-text: #e0e0e0;
    --mwp-text-muted: #8892a4;
    --mwp-accent: #e94560;
    --mwp-border: rgba(255,255,255,0.08);
    --mwp-radius: 16px;
    --mwp-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* ---- Base Container ---- */
.mwp-player-wrap {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--mwp-bg);
    border-radius: var(--mwp-radius);
    box-shadow: var(--mwp-shadow);
    overflow: hidden;
    max-width: 700px;
    margin: 20px auto;
    color: var(--mwp-text);
    user-select: none;
}

/* ---- Now Playing Section ---- */
.mwp-now-playing {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, var(--mwp-card), var(--mwp-card-light));
    border-bottom: 1px solid var(--mwp-border);
}

.mwp-cover-art {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    background: var(--mwp-card-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mwp-cover-art img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.mwp-cover-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    background: var(--mwp-card-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mwp-cover-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
    fill: var(--mwp-text);
}

.mwp-track-info {
    flex: 1;
    min-width: 0;
}

.mwp-track-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mwp-track-artist {
    font-size: 0.85rem;
    color: var(--mwp-text-muted);
    margin: 0 0 2px;
}

.mwp-track-genre {
    font-size: 0.75rem;
    color: var(--mwp-primary);
    background: rgba(108,99,255,0.15);
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
}

/* ---- Progress Bar ---- */
.mwp-progress-section {
    padding: 16px 24px 0;
    background: var(--mwp-bg);
}

.mwp-progress-bar-wrap {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 6px;
}

.mwp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mwp-primary), var(--mwp-accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.mwp-progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(108,99,255,0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.mwp-progress-bar-wrap:hover .mwp-progress-bar-fill::after {
    opacity: 1;
}

.mwp-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--mwp-text-muted);
}

/* ---- Controls ---- */
.mwp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--mwp-bg);
}

.mwp-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mwp-text-muted);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s, transform 0.15s;
    outline: none;
}

.mwp-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.mwp-btn.active {
    color: var(--mwp-primary);
}

.mwp-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.mwp-btn-play {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--mwp-primary), var(--mwp-accent));
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(108,99,255,0.5);
    transition: transform 0.15s, box-shadow 0.2s;
}

.mwp-btn-play:hover {
    background: linear-gradient(135deg, var(--mwp-primary), var(--mwp-accent));
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(108,99,255,0.7);
}

.mwp-btn-play svg {
    width: 24px;
    height: 24px;
}

/* ---- Volume ---- */
.mwp-volume-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px 16px;
    background: var(--mwp-bg);
}

.mwp-volume-icon {
    color: var(--mwp-text-muted);
    flex-shrink: 0;
}

.mwp-volume-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.mwp-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.mwp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--mwp-primary);
    border-radius: 50%;
    cursor: pointer;
}

.mwp-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--mwp-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ---- Track List ---- */
.mwp-tracklist {
    background: var(--mwp-bg);
    border-top: 1px solid var(--mwp-border);
    max-height: 280px;
    overflow-y: auto;
}

.mwp-tracklist::-webkit-scrollbar {
    width: 4px;
}
.mwp-tracklist::-webkit-scrollbar-track {
    background: transparent;
}
.mwp-tracklist::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.mwp-tracklist-header {
    padding: 12px 24px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mwp-text-muted);
    border-bottom: 1px solid var(--mwp-border);
}

.mwp-track-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 24px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--mwp-border);
}

.mwp-track-item:last-child {
    border-bottom: none;
}

.mwp-track-item:hover {
    background: rgba(255,255,255,0.04);
}

.mwp-track-item.active {
    background: rgba(108,99,255,0.12);
}

.mwp-track-item.active .mwp-item-title {
    color: var(--mwp-primary);
}

.mwp-track-num {
    width: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--mwp-text-muted);
    flex-shrink: 0;
}

.mwp-track-item.active .mwp-track-num {
    color: var(--mwp-primary);
}

.mwp-item-cover {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--mwp-card-light);
    flex-shrink: 0;
}

.mwp-item-info {
    flex: 1;
    min-width: 0;
}

.mwp-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mwp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mwp-item-artist {
    font-size: 0.75rem;
    color: var(--mwp-text-muted);
}

.mwp-item-duration {
    font-size: 0.75rem;
    color: var(--mwp-text-muted);
    flex-shrink: 0;
}

/* ---- Equalizer animation ---- */
.mwp-eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    flex-shrink: 0;
}

.mwp-eq span {
    display: block;
    width: 3px;
    background: var(--mwp-primary);
    border-radius: 2px;
    animation: mwp-eq-bar 0.8s ease-in-out infinite alternate;
}

.mwp-eq span:nth-child(1) { height: 6px; animation-delay: 0s; }
.mwp-eq span:nth-child(2) { height: 12px; animation-delay: 0.2s; }
.mwp-eq span:nth-child(3) { height: 8px; animation-delay: 0.4s; }
.mwp-eq span:nth-child(4) { height: 14px; animation-delay: 0.1s; }

@keyframes mwp-eq-bar {
    from { transform: scaleY(0.3); }
    to   { transform: scaleY(1); }
}

/* ---- Compact Player (widget mode) ---- */
.mwp-player-wrap.mwp-compact .mwp-tracklist {
    max-height: 180px;
}

/* ---- Responsive ---- */
@media (max-width: 500px) {
    .mwp-now-playing {
        padding: 16px;
        gap: 14px;
    }
    .mwp-cover-art,
    .mwp-cover-placeholder {
        width: 64px;
        height: 64px;
    }
    .mwp-track-title {
        font-size: 0.95rem;
    }
    .mwp-controls {
        gap: 8px;
        padding: 10px 16px;
    }
    .mwp-btn-play {
        width: 44px;
        height: 44px;
    }
}
