/* ============================================================================
 * NeonWave desktop — exact Spotify chrome: rebuilt top bar, player bar,
 * playlist page and library rail. Loaded after neon-skin.css.
 * ========================================================================== */

/* Top bar: menu + arrows left, home + search centre, icons + avatar right,
   Windows buttons (Electron titleBarOverlay) on the far right. */
.sp-topbar {
    display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: center;
    height: 64px !important; padding: 0 8px 0 12px !important;
    -webkit-app-region: drag;
}
.sp-topbar button, .sp-topbar input, .sp-topbar .sp-avatar, .sp-topbar img { -webkit-app-region: no-drag; }
.sp-top-left { display: flex; align-items: center; gap: 4px; }
.sp-top-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-right: 140px; }
.sp-tb-icon {
    width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: #b3b3b3;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: color .15s, transform .15s;
}
.sp-tb-icon:hover { color: #fff; transform: scale(1.04); }
.sp-tb-icon:disabled { color: #535353; cursor: default; transform: none; }
.sp-tb-logo { width: 24px; height: 24px; border-radius: 6px; margin-left: 10px; cursor: pointer; opacity: .9; }
.sp-top-center { display: flex !important; align-items: center; gap: 8px !important; }
.sp-home-btn {
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .1); color: #b3b3b3; display: inline-flex; align-items: center; justify-content: center;
    transition: transform .15s, color .15s, background .15s;
}
.sp-home-btn:hover { color: #fff; transform: scale(1.04); background: rgba(255, 255, 255, .16); }
.sp-topbar .mobile-library-btn { display: none !important; }
.sp-search {
    position: relative; display: flex !important; align-items: center; gap: 0;
    width: 474px !important; max-width: 40vw !important; min-width: 0 !important; height: 48px; padding: 0 6px 0 12px !important;
    border-radius: 500px !important;
}
.sp-search .sp-search-icon { color: #b3b3b3; flex-shrink: 0; position: static !important; transform: none !important; }
.sp-search input {
    flex: 1; min-width: 0; height: 100% !important; border: 0 !important; background: transparent !important;
    padding: 0 12px !important; font-size: 16px !important; color: #fff !important; box-shadow: none !important; outline: none;
}
.sp-search-clear, .sp-search-browse {
    width: 40px; height: 40px; border: 0; background: transparent; color: #b3b3b3; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0;
}
.sp-search-clear:hover, .sp-search-browse:hover { color: #fff; }
.sp-search-clear { visibility: hidden; }
.sp-search.has-value .sp-search-clear { visibility: visible; }
.sp-search-divider { width: 1px; height: 24px; background: #7c7c7c; margin: 0 4px; flex-shrink: 0; }
.sp-avatar {
    width: 48px !important; height: 48px !important; border-radius: 50% !important; display: inline-flex !important;
    align-items: center; justify-content: center; cursor: pointer; font-size: 14px !important;
    background: rgba(255, 255, 255, .1) !important; box-shadow: none !important; font-weight: 700; color: #fff;
}

/* Library rail: library icon + "+" stacked, then covers */
.sidebar:not(.sk-expanded) .sidebar-header { flex-direction: column; gap: 8px; padding: 8px 0 !important; }
.sidebar:not(.sk-expanded) .sidebar-header > button {
    display: inline-flex !important; width: 32px; height: 32px; border-radius: 50% !important; align-items: center; justify-content: center;
    color: #b3b3b3 !important; background: transparent !important;
}
.sidebar:not(.sk-expanded) .sidebar-header > button:hover { color: #fff !important; background: rgba(255, 255, 255, .1) !important; }

/* Player bar */
.sp-footer { display: grid !important; grid-template-columns: minmax(180px, 30%) 40% minmax(180px, 30%); align-items: center; height: 72px !important; padding: 0 8px !important; }
.sp-footer .footer-left { display: flex; align-items: center; gap: 14px; min-width: 0; padding-left: 8px; }
.sp-footer .thumb { width: 56px !important; height: 56px !important; flex-shrink: 0; }
.sp-footer .thumb img { width: 56px !important; height: 56px !important; object-fit: cover; }
.sp-footer .thumb-eq { display: none !important; }
.sp-footer .info { min-width: 0; }
.sp-footer .title-row { display: flex; gap: 8px; }
.sp-footer .loop-status-badge, .sp-footer .time-remaining { display: none !important; }
.sp-footer .title { font-size: 14px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-footer .artist { font-size: 11px !important; }
.sp-like-btn { border: 0; background: none; cursor: pointer; color: #b3b3b3; display: inline-flex; padding: 8px; margin-left: 4px; }
.sp-like-btn:hover { color: #fff; transform: scale(1.04); }
.sp-like-btn .sp-like-on { display: none; color: var(--sk-cover); }
.sp-like-btn.is-liked .sp-like-on { display: block; }
.sp-like-btn.is-liked .sp-like-off { display: none; }
.sp-footer .footer-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sp-footer .player-controls { display: flex; align-items: center; gap: 16px; }
.sp-footer .player-controls .control-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.sp-footer .play-pause-btn {
    width: 32px !important; height: 32px !important; background: transparent !important; color: #fff !important;
    display: inline-flex !important; align-items: center; justify-content: center;
}
.sp-footer .play-pause-btn svg { fill: #fff !important; color: #fff !important; width: 22px !important; height: 22px !important; }
.sp-footer .play-pause-btn:hover svg { transform: scale(1.06); }
.sp-footer .progress-container { width: 100% !important; max-width: 722px; }
.sp-footer .progress-time { font-size: 12px !important; color: #b3b3b3 !important; }
.sp-footer .footer-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding-right: 8px; }
.sp-footer .footer-right .control-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: #b3b3b3 !important; }
.sp-footer .footer-right .control-btn:hover { color: #fff !important; }
.sp-footer #volumeSlider { width: 93px !important; max-width: 93px !important; flex: none; margin: 0 6px 0 0; }

/* Playlist page */
.sp-pl-hero {
    display: flex !important; align-items: flex-end; gap: 24px; margin: 16px 16px 0 !important; padding: 16px !important;
    border-radius: 8px !important; min-height: 0 !important;
    background: rgba(0, 0, 0, 0.32) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06) !important;
}
.sp-pl-hero .playlist-hero-art { width: 232px !important; height: 232px !important; flex-shrink: 0; border-radius: 4px !important; overflow: hidden; box-shadow: 0 4px 60px rgba(0, 0, 0, .5) !important; background: #282828 !important; }
.sp-pl-hero .playlist-hero-art img { width: 100% !important; height: 100% !important; object-fit: cover; }
.sp-pl-hero .playlist-hero-copy { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; min-width: 0; }
.sp-pl-hero .eyebrow { font-size: 14px !important; font-weight: 400 !important; color: #fff !important; text-transform: none !important; letter-spacing: 0 !important; }
.sp-pl-hero h2 { font-size: 14px !important; font-weight: 700 !important; margin: 0 !important; color: #fff !important; letter-spacing: 0 !important; }
.sp-pl-meta { display: flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 14px; color: #fff; }
.sp-pl-meta strong { font-weight: 700; }
.sp-pl-meta #playlistViewMeta { color: rgba(255, 255, 255, .7); }
.sp-pl-owner-add { width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: #b3b3b3; }
.sp-pl-owner-avatar { width: 24px; height: 24px; border-radius: 50%; background: #535353; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.sp-pl-actions { display: flex; align-items: center; gap: 24px; padding: 24px 32px 16px; }
.sp-pl-play {
    width: 56px; height: 56px; border-radius: 8px; border: 0; cursor: pointer;
    background: rgb(calc(var(--nw-cover-r, 80) * .45 + 140), calc(var(--nw-cover-g, 80) * .45 + 140), calc(var(--nw-cover-b, 80) * .45 + 140));
    color: #000; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s;
}
.sp-pl-play:hover { transform: scale(1.04); }
.sp-pl-mini-cover { width: 40px; height: 56px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.sp-pl-icon { border: 0; background: none; color: #b3b3b3; cursor: pointer; display: inline-flex; padding: 0; }
.sp-pl-icon:hover { color: #fff; transform: scale(1.04); }
.sp-pl-spacer { flex: 1; }
.sp-pl-sort { border: 0; background: none; color: #b3b3b3; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.sp-pl-sort:hover { color: #fff; }
.sp-pl-pills { display: flex; gap: 8px; padding: 0 32px 16px; }
.sp-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 500px;
    border: 0; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer;
}
.sp-pill:hover { background: rgba(255, 255, 255, .16); transform: scale(1.02); }
#playlistTracks { padding: 0 16px 24px; }
.sp-pl-table .track-list-header, .sp-pl-table .track-row {
    grid-template-columns: 24px minmax(0, 4fr) minmax(0, 2.4fr) minmax(0, 1.6fr) 96px !important;
}
.track-row-date { color: var(--sk-sub); font-size: 14px; white-space: nowrap; }
.sp-pl-table .track-row-duration { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.track-row-remove { border: 0; background: none; color: var(--sk-sub); cursor: pointer; opacity: 0; display: inline-flex; }
.track-row:hover .track-row-remove { opacity: 1; }
.track-row-remove:hover { color: #fff; }
.sp-explicit {
    display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 6px;
    border-radius: 2px; background: rgba(255, 255, 255, .6); color: #121212; font-size: 9px; font-weight: 700; vertical-align: 1px;
}

/* Lyrics panel: dark glass like the latest reference */
.now-playing-panel.visible:has(.sl-root) { background: rgba(0, 0, 0, 0.42) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06) !important; }
.now-playing-panel:has(.sl-root) .np-video-bg { display: none !important; }
.now-playing-panel:has(.sl-root) .sl-root { padding: 24px 28px 40vh 28px; }

/* Fixes from the playlist screenshot */
.sp-footer .footer-left, .sp-footer .footer-right { width: auto !important; min-width: 0 !important; }
.sp-footer .footer-center { max-width: none !important; padding: 0 !important; width: 100%; }
.sp-footer .footer-left .info { flex: 0 1 auto; }
.sp-footer .footer-right { gap: 8px !important; }
.sp-footer .footer-right > * { flex-shrink: 0; }
.sp-footer .player-controls { margin-bottom: 0 !important; }
.main-content:has(#homeView.hidden) .main-filters { display: none !important; }
.sp-topbar .sp-search input.neon-input,
.sp-topbar .sp-search input.neon-input:focus,
.sp-topbar .sp-search input.neon-input:hover {
    background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
}
.sp-topbar .sp-search input::placeholder { color: #b3b3b3 !important; }
