/* static/css/playlist.css - Sidebar playlist personnelle */

/* ── Bouton dans l'en-tête ───────────────────────────────────────────────── */
#pl-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #1db954, #17a045);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    margin-left: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.35);
}
#pl-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.5);
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */
#pl-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1500;
}
#pl-overlay.pl-open { display: block; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#pl-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: #1a1a2e;
    color: #e0e0e0;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}
#pl-sidebar.pl-open { right: 0; }

/* ── En-tête sidebar ─────────────────────────────────────────────────────── */
.pl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}
.pl-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #1db954;
    display: flex;
    align-items: center;
    gap: 8px;
}
#pl-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}
#pl-close-btn:hover { color: white; }

/* ── Lecteur mini ────────────────────────────────────────────────────────── */
.pl-player {
    background: #16213e;
    padding: 12px 18px;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}
.pl-now-playing-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1db954;
    margin-bottom: 4px;
}
#pl-now-playing {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 10px;
}
.pl-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pl-controls button {
    background: #0f3460;
    border: none;
    color: #e0e0e0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pl-controls button:hover:not(:disabled) {
    background: #1db954;
    color: white;
    transform: scale(1.08);
}
.pl-controls button:disabled {
    opacity: 0.35;
    cursor: default;
}
#pl-btn-play {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    background: #1db954;
    color: white;
}
#pl-btn-play:hover:not(:disabled) { background: #17a045; }

#pl-btn-clear {
    margin-left: auto;
    background: transparent;
    border: 1px solid #e74c3c55;
    color: #e74c3c;
    font-size: 0.72rem;
    width: auto;
    height: auto;
    border-radius: 4px;
    padding: 4px 10px;
}
#pl-btn-clear:hover:not(:disabled) {
    background: #e74c3c;
    color: white;
    transform: none;
}

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.pl-tabs {
    display: flex;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}
.pl-tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.pl-tab-btn:hover { color: #ccc; }
.pl-tab-btn.pl-tab-active {
    color: #1db954;
    border-bottom-color: #1db954;
    font-weight: 600;
}

/* ── Panneaux (bibliothèque / queue) ─────────────────────────────────────── */
#pl-panel-browser,
#pl-panel-queue {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Barre de recherche dans la bibliothèque */
.pl-search-bar {
    padding: 10px 14px;
    border-bottom: 1px solid #0f3460;
    flex-shrink: 0;
}
#pl-search-input {
    width: 100%;
    padding: 8px 12px;
    background: #0f3460;
    border: 1px solid #1db95433;
    border-radius: 20px;
    color: #e0e0e0;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}
#pl-search-input::placeholder { color: #666; }
#pl-search-input:focus { border-color: #1db954; }

/* Listes scrollables */
#pl-browser-list,
#pl-queue-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    flex: 1;
}

/* Message liste vide */
.pl-empty {
    padding: 24px 18px;
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.6;
}

/* ── Item bibliothèque ───────────────────────────────────────────────────── */
.pl-browser-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid #ffffff08;
    gap: 10px;
    transition: background 0.15s;
}
.pl-browser-item:hover { background: #ffffff08; }
.pl-browser-title {
    flex: 1;
    font-size: 0.83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ccc;
}
.pl-add-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #0f3460;
    color: #1db954;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pl-add-btn:hover { background: #1db954; color: white; transform: scale(1.1); }
.pl-add-btn.pl-added { background: #1db95433; color: #1db954; }
.pl-add-btn.pl-added:hover { background: #e74c3c; color: white; }

/* ── Item queue ──────────────────────────────────────────────────────────── */
.pl-queue-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid #ffffff08;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.pl-queue-item:hover { background: #ffffff0d; }
.pl-queue-item.pl-active {
    background: #1db95420;
    border-left: 3px solid #1db954;
}
.pl-queue-num {
    font-size: 0.75rem;
    color: #555;
    min-width: 20px;
    text-align: right;
    flex-shrink: 0;
}
.pl-queue-item.pl-active .pl-queue-num { color: #1db954; }
.pl-queue-title {
    flex: 1;
    font-size: 0.83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ccc;
}
.pl-queue-item.pl-active .pl-queue-title { color: #fff; font-weight: 600; }

.pl-queue-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.pl-move-btn, .pl-remove-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px 5px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.pl-move-btn:hover:not(:disabled) { color: #1db954; background: #1db95422; }
.pl-remove-btn:hover { color: #e74c3c; background: #e74c3c22; }
.pl-move-btn:disabled { opacity: 0.2; cursor: default; }

/* ── Scrollbar stylée ────────────────────────────────────────────────────── */
#pl-browser-list::-webkit-scrollbar,
#pl-queue-list::-webkit-scrollbar { width: 5px; }
#pl-browser-list::-webkit-scrollbar-track,
#pl-queue-list::-webkit-scrollbar-track { background: transparent; }
#pl-browser-list::-webkit-scrollbar-thumb,
#pl-queue-list::-webkit-scrollbar-thumb { background: #0f3460; border-radius: 3px; }

/* ── Responsive mobile ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #pl-sidebar { width: 100vw; right: -100vw; }
    #pl-open-btn span { display: none; }
}
