/* ============================================================
   WP Audio Player Pro — Public Styles
   ============================================================ */

/* ---- CSS Custom Properties (overridden inline per player) ---- */
.wpap-player {
    --wpap-accent:  #6c63ff;
    --wpap-bg:      #1a1a2e;
    --wpap-text:    #ffffff;
    --wpap-muted:   rgba(255,255,255,0.45);
    --wpap-track:   rgba(255,255,255,0.12);
    --wpap-radius:  16px;
    --wpap-width:   100%;
    --wpap-shadow:  0 8px 32px rgba(0,0,0,0.35);
    --wpap-btn-size: 40px;

    width: var(--wpap-width);
    max-width: 720px;
    background: var(--wpap-bg);
    color: var(--wpap-text);
    border-radius: var(--wpap-radius);
    box-shadow: var(--wpap-shadow);
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    position: relative;
    box-sizing: border-box;
    margin: 1.5em auto;
}

/* ---- Light theme ---- */
.wpap-player.wpap-theme-light {
    --wpap-bg:    #f4f4f8;
    --wpap-text:  #1a1a2e;
    --wpap-muted: rgba(26,26,46,0.5);
    --wpap-track: rgba(26,26,46,0.12);
    --wpap-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* ---- Artwork ---- */
.wpap-artwork {
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}
.wpap-artwork img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.wpap-player:hover .wpap-artwork img { transform: scale(1.03); }

.wpap-artwork--circle {
    display: flex;
    justify-content: center;
    padding: 20px 20px 0;
}
.wpap-artwork--circle img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--wpap-accent);
    animation: wpap-spin 20s linear infinite paused;
}
.wpap-player.playing .wpap-artwork--circle img {
    animation-play-state: running;
}
@keyframes wpap-spin { to { transform: rotate(360deg); } }

.wpap-artwork--square img {
    height: 180px;
    border-radius: 0;
}

/* ---- Main area ---- */
.wpap-main { padding: 18px 20px 20px; }

/* ---- Info ---- */
.wpap-info { margin-bottom: 10px; }
.wpap-title  { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpap-artist { font-size: 0.82rem; color: var(--wpap-muted); margin-top: 2px; }

/* ---- Progress bar ---- */
.wpap-progress-bar {
    position: relative;
    height: 4px;
    background: var(--wpap-track);
    border-radius: 99px;
    cursor: pointer;
    margin: 12px 0 6px;
    overflow: visible;
}
.wpap-progress-fill {
    height: 100%;
    background: var(--wpap-accent);
    border-radius: 99px;
    width: 0%;
    transition: width .1s linear;
    pointer-events: none;
}
.wpap-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: var(--wpap-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .15s, left .1s linear;
    box-shadow: 0 0 0 3px rgba(108,99,255,.3);
}
.wpap-progress-bar:hover .wpap-progress-thumb { transform: translate(-50%, -50%) scale(1); }

/* ---- Waveform ---- */
.wpap-waveform {
    position: relative;
    height: 40px;
    cursor: pointer;
    margin: 10px 0;
    display: flex;
    align-items: center;
}
.wpap-waveform-bars {
    display: flex;
    align-items: center;
    gap: 1.5px;
    height: 100%;
    width: 100%;
}
.wpap-waveform-bar {
    flex: 1;
    background: var(--wpap-track);
    border-radius: 2px;
    min-height: 4px;
    transition: background .2s;
}
.wpap-waveform-bar.played { background: var(--wpap-accent); }
.wpap-waveform-played {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: transparent;
    pointer-events: none;
}

/* ---- Times ---- */
.wpap-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--wpap-muted);
    margin-bottom: 14px;
}

/* ---- Controls ---- */
.wpap-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wpap-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpap-text);
    border-radius: 50%;
    transition: background .15s, transform .1s, color .15s;
    flex-shrink: 0;
}
.wpap-btn:hover  { background: rgba(108,99,255,.15); }
.wpap-btn:active { transform: scale(.9); }
.wpap-btn svg    { width: 20px; height: 20px; fill: currentColor; }

/* Play button (larger) */
.wpap-btn-play {
    width: 48px;
    height: 48px;
    background: var(--wpap-accent) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(108,99,255,.45);
}
.wpap-btn-play:hover { background: #5a52e0 !important; transform: scale(1.08); }
.wpap-btn-play svg   { width: 22px; height: 22px; }

.wpap-btn-skip-back svg,
.wpap-btn-skip-fwd svg { width: 22px; height: 22px; }

/* Volume */
.wpap-volume { display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.wpap-volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 3px;
    background: var(--wpap-track);
    border-radius: 99px;
    cursor: pointer;
    accent-color: var(--wpap-accent);
    outline: none;
}
.wpap-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--wpap-accent);
    cursor: pointer;
}

/* Speed */
.wpap-speed { position: relative; }
.wpap-btn-speed {
    background: var(--wpap-track) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    min-width: 32px;
    height: 28px;
}
.wpap-speed-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--wpap-bg);
    border: 1px solid var(--wpap-track);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    z-index: 999;
    min-width: 60px;
}
.wpap-speed-menu.open { display: block; }
.wpap-speed-option {
    display: block;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: var(--wpap-text);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: background .1s;
}
.wpap-speed-option:hover  { background: var(--wpap-track); }
.wpap-speed-option.active { color: var(--wpap-accent); font-weight: 700; }

/* Download / Share */
.wpap-btn-download,
.wpap-btn-share { color: var(--wpap-muted); margin-left: auto; }
.wpap-btn-download:hover,
.wpap-btn-share:hover { color: var(--wpap-accent); }
.wpap-btn-download { text-decoration: none; }

/* ---- Lyrics ---- */
.wpap-lyrics-toggle { margin-top: 12px; border-top: 1px solid var(--wpap-track); padding-top: 10px; }
.wpap-btn-lyrics {
    background: none;
    border: none;
    color: var(--wpap-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 0;
}
.wpap-btn-lyrics:hover { color: var(--wpap-accent); }
.wpap-lyrics-content {
    font-size: 13px;
    line-height: 1.8;
    color: var(--wpap-muted);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
    white-space: pre-line;
}

/* ---- Visualizer ---- */
.wpap-visualizer {
    width: 100%;
    height: 60px;
    margin-bottom: 8px;
}
.wpap-visualizer-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- Playlist container ---- */
.wpap-playlist-container {
    overflow-y: auto;
    border-top: 1px solid var(--wpap-track);
    scrollbar-width: thin;
    scrollbar-color: var(--wpap-accent) var(--wpap-track);
}
.wpap-playlist-container::-webkit-scrollbar { width: 4px; }
.wpap-playlist-container::-webkit-scrollbar-track { background: var(--wpap-track); }
.wpap-playlist-container::-webkit-scrollbar-thumb { background: var(--wpap-accent); border-radius: 99px; }

.wpap-track-list { list-style: none; margin: 0; padding: 0; }

.wpap-track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--wpap-track);
    transition: background .15s;
}
.wpap-track-item:hover  { background: rgba(108,99,255,.08); }
.wpap-track-item.active { background: rgba(108,99,255,.15); }
.wpap-track-item.active .wpap-track-title { color: var(--wpap-accent); font-weight: 700; }

.wpap-track-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.wpap-track-info { flex: 1; min-width: 0; }
.wpap-track-num  { font-size: 11px; color: var(--wpap-muted); margin-right: 6px; }
.wpap-track-title  { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpap-track-artist { font-size: 11px; color: var(--wpap-muted); }

.wpap-track-dur { font-size: 11px; color: var(--wpap-muted); flex-shrink: 0; }

.wpap-track-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--wpap-muted);
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color .15s;
}
.wpap-track-play-btn:hover { color: var(--wpap-accent); }
.wpap-track-play-btn svg   { width: 16px; height: 16px; fill: currentColor; }
.wpap-track-item.active .wpap-track-play-btn { color: var(--wpap-accent); }

/* ---- Sticky player ---- */
.wpap-sticky {
    position: fixed;
    left: 0; right: 0;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0,0,0,.35);
    border-radius: 0;
    max-width: 100%;
    margin: 0;
    transform: translateY(100%);
    transition: transform .3s ease;
}
.wpap-sticky.wpap-sticky--top    { top: 0; bottom: auto; box-shadow: 0 4px 20px rgba(0,0,0,.35); transform: translateY(-100%); }
.wpap-sticky.wpap-sticky--bottom { bottom: 0; top: auto; }
.wpap-sticky.wpap-sticky--visible { transform: translateY(0); }

/* ---- Error ---- */
.wpap-error { color: #cc1818; padding: 8px 12px; border-left: 3px solid #cc1818; background: #fff5f5; border-radius: 4px; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .wpap-volume-slider { width: 55px; }
    .wpap-main { padding: 14px 14px 16px; }
    .wpap-artwork--circle img { width: 90px; height: 90px; }
}
