/* public/css/playlist-panel.css */

/* --- Slide-in Playlist Panel --- */
.playlist-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.playlist-panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.playlist-panel {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    z-index: 9999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-panel.active {
    left: 0;
}

/* --- Panel Header --- */
.playlist-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-panel-title i {
    color: var(--color-accent-main, #8b5cf6);
}

.playlist-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.playlist-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Panel Content --- */
.playlist-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* --- Pagination Navigation --- */
.playlist-pagination-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.playlist-pagination-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.playlist-pagination-arrow:hover:not(:disabled) {
    background: var(--color-accent-main, #8b5cf6);
    border-color: var(--color-accent-main, #8b5cf6);
}

.playlist-pagination-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.playlist-pagination-arrow.left {
    margin-left: -18px;
}

.playlist-pagination-arrow.right {
    margin-right: -18px;
}

/* --- Page Indicator --- */
.playlist-page-indicator {
    text-align: center;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* --- Playlist Grid --- */
.playlist-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 30px;
    margin-top: 8px;
}

/* --- Playlist Card --- */
.playlist-card {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.playlist-card.no-image {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-card.no-image i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Card Overlay */
.playlist-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.playlist-card:hover .playlist-card-overlay {
    opacity: 1;
}

/* Card Title */
.playlist-card-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Card Actions */
.playlist-card-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.playlist-card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.playlist-card-btn:hover {
    background: linear-gradient(145deg, var(--color-accent-main, #8b5cf6), #7c3aed);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(139, 92, 246, 0.4),
        0 8px 16px rgba(139, 92, 246, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.playlist-card-btn:active {
    transform: scale(1.05) translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.playlist-card-btn.delete:hover {
    background: linear-gradient(145deg, #f87171, #ef4444);
    box-shadow: 
        0 4px 8px rgba(239, 68, 68, 0.4),
        0 8px 16px rgba(239, 68, 68, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Create New Button --- */
.playlist-create-btn {
    margin-top: 16px;
    padding: 12px 20px;
    background: var(--color-accent-main, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.playlist-create-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

/* --- Empty State --- */
.playlist-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.playlist-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.2);
}

.playlist-empty-state p {
    margin-bottom: 16px;
}

/* ================================================
   JUKEBOT INTERNAL PLAYLIST PANEL (NO POPUPS)
   ================================================ */

.jukebot-playlist-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    flex-direction: column;
    background: #0f172a;
    border-radius: 0;
    overflow: hidden;
    padding-left: 60px; /* Account for left menu bar */
    box-sizing: border-box;
}

.jukebot-playlist-panel.active {
    display: flex;
}

/* --- Jukebot Playlist Header --- */
.jukebot-playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.jukebot-playlist-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.jukebot-playlist-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.jukebot-playlist-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jukebot-playlist-title i {
    color: #8b5cf6;
}

/* --- Playlist Detail Header (Back + Title + Close) --- */
.playlist-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-view-back {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.playlist-view-back:hover {
    background: rgba(139, 92, 246, 0.6);
}

.playlist-detail-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

/* --- Jukebot Playlist Content --- */
.jukebot-playlist-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
    overflow: hidden;
    min-height: 0;
}

/* --- Jukebot Pagination --- */
.jukebot-playlist-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
}

.jukebot-playlist-pagination-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.jukebot-playlist-pagination-arrow:hover:not(:disabled) {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.jukebot-playlist-pagination-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#jukebot-playlist-page-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* --- Jukebot Playlist Grid (Big Icon Style) --- */
.jukebot-playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* --- Jukebot Playlist Card (Big Icon Style - like selector) --- */
.jukebot-playlist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.jukebot-playlist-card:hover {
    transform: scale(1.05);
}

.jukebot-playlist-card-art {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.jukebot-playlist-card:hover .jukebot-playlist-card-art {
    border-color: rgba(139, 92, 246, 0.6);
}

.jukebot-playlist-card-art i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
}

.jukebot-playlist-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 92, 246, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.jukebot-playlist-card:hover .jukebot-playlist-card-overlay {
    opacity: 1;
}

.jukebot-playlist-card-overlay i {
    color: white;
    font-size: 1.8rem;
}

.jukebot-playlist-card-name {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card Header - Title at top */
.jukebot-playlist-card-header {
    flex-shrink: 0;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.jukebot-playlist-card-title-editable {
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    text-align: left;
    line-height: 24px;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    height: 100%;
}

.jukebot-playlist-card-title-editable:hover {
    background: rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
}

/* Card Art - Middle section */
.jukebot-playlist-card-art {
    flex: 1;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.jukebot-playlist-card-art i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Card Footer - Buttons at bottom */
.jukebot-playlist-card-footer {
    flex-shrink: 0;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 8px;
}

.jukebot-playlist-card-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.jukebot-playlist-card-btn:hover {
    background: linear-gradient(145deg, #9d7aff, #8b5cf6);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(139, 92, 246, 0.4),
        0 8px 16px rgba(139, 92, 246, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.jukebot-playlist-card-btn:active {
    transform: scale(1.05) translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.jukebot-playlist-card-btn.delete:hover {
    background: linear-gradient(145deg, #f87171, #ef4444);
    box-shadow: 
        0 4px 8px rgba(239, 68, 68, 0.4),
        0 8px 16px rgba(239, 68, 68, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

/* Rename input styling */
.jukebot-playlist-rename-input {
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.9);
    border: none;
    border-bottom: 2px solid #8b5cf6;
    padding: 0 8px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.jukebot-playlist-rename-input:focus {
    outline: none;
}

/* --- Jukebot Create New Button --- */
.jukebot-playlist-create-btn {
    flex-shrink: 0;
    margin-top: 10px;
    padding: 10px 16px;
    background: #8b5cf6;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.jukebot-playlist-create-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

/* --- Jukebot Empty State --- */
.jukebot-playlist-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 10px;
    color: rgba(255, 255, 255, 0.5);
}

.jukebot-playlist-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.2);
}

.jukebot-playlist-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* ================================================
   EXPANDED PLAYLIST VIEW (Artist Logo + Song Queue)
   ================================================ */

/* --- Playlist View Container (Full screen with header + content) --- */
.jukebot-playlist-view {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.jukebot-playlist-view.active {
    display: flex;
}

/* --- Playlist Main Area (Full width song list) --- */
.playlist-view-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

/* --- Playlist Logo Section (hidden in new design) --- */
.playlist-logo-section {
    display: none;
}

.playlist-logo-container {
    flex: 1;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.playlist-logo-container:hover {
    border-color: rgba(139, 92, 246, 0.6);
}

.playlist-logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.playlist-logo-placeholder i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
}

.playlist-logo-play-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, #9d7aff, #8b5cf6);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(139, 92, 246, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.playlist-logo-play-btn:hover {
    transform: scale(1.15) translateY(-2px);
    background: linear-gradient(145deg, #a78bfa, #7c3aed);
    box-shadow: 
        0 4px 8px rgba(139, 92, 246, 0.4),
        0 8px 16px rgba(139, 92, 246, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.playlist-logo-play-btn:active {
    transform: scale(1.05) translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(139, 92, 246, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.playlist-logo-song-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* Editable playlist name above logo */
.playlist-name-editor {
    width: 100%;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.playlist-name-editor:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(139, 92, 246, 0.3);
}

.playlist-name-editor:focus {
    outline: none;
    border-color: #8b5cf6;
    cursor: text;
}

/* AI Art Generation Button */
.playlist-ai-art-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.playlist-ai-art-btn:hover {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.2));
    border-color: rgba(139, 92, 246, 0.6);
    color: #c4b5fd;
    transform: translateY(-1px);
}

.playlist-ai-art-btn:active {
    transform: translateY(0);
}

.playlist-ai-art-btn i {
    font-size: 0.9rem;
}

/* --- Queue Section (70% width) --- */
.playlist-queue-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.playlist-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-bottom: 4px;
}

.playlist-queue-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.playlist-queue-hint {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

/* --- Queue Song List (7 slots: -3, -2, -1, 0, +1, +2, +3) --- */
.playlist-queue-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.playlist-queue-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.playlist-queue-slot:hover {
    background: rgba(0, 0, 0, 0.3);
}

.playlist-queue-slot.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.playlist-queue-slot.drag-over {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

/* Selected/Current Song (Slot 0) */
.playlist-queue-slot.current {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

.playlist-queue-slot.previous {
    opacity: 0.6;
}

.playlist-queue-slot.future {
    opacity: 1;
}

/* Slot Index Badge */
.playlist-slot-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.playlist-slot-badge.previous-badges {
    background: rgba(100, 116, 139, 0.5);
    color: rgba(255, 255, 255, 0.7);
}

.playlist-slot-badge.current-badge {
    background: #8b5cf6;
    color: white;
}

.playlist-slot-badge.future-badges {
    background: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

/* Song Info */
.playlist-slot-info {
    flex: 1;
    min-width: 0;
}

.playlist-slot-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-queue-slot.previous .playlist-slot-title {
    color: rgba(255, 255, 255, 0.7);
}

.playlist-queue-slot.current .playlist-slot-title {
    color: white;
    font-weight: 600;
}

/* Drag Handle */
.playlist-slot-drag {
    color: rgba(255, 255, 255, 0.3);
    cursor: grab;
    padding: 4px;
    transition: color 0.2s;
}

.playlist-slot-drag:hover {
    color: rgba(255, 255, 255, 0.6);
}

.playlist-slot-drag:active {
    cursor: grabbing;
}

/* Drag Handle Icon */
.playlist-slot-drag i {
    font-size: 0.7rem;
}

/* ================================================
   CLEAN SONG LIST VIEW (No slots, no numbers)
   ================================================ */

/* Playlist Song Row - Clean list item */
.playlist-song-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 4px;
}

.playlist-song-row:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.playlist-song-row.selected {
    background: rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
}

/* Song Row Content */
.playlist-song-row-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

/* Song Title */
.playlist-song-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Song Actions (Play, Edit, Delete buttons) */
.playlist-song-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.playlist-song-row:hover .playlist-song-actions {
    opacity: 1;
}

.playlist-song-play-btn,
.playlist-song-edit-btn,
.playlist-song-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.playlist-song-play-btn:hover {
    background: linear-gradient(145deg, #9d7aff, #8b5cf6);
}

.playlist-song-edit-btn:hover {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
}

.playlist-song-delete-btn:hover {
    background: linear-gradient(145deg, #f87171, #ef4444);
}

.playlist-song-play-btn i,
.playlist-song-edit-btn i,
.playlist-song-delete-btn i {
    font-size: 0.7rem;
}

/* Play Button (shown when selected) */
.playlist-song-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #9d7aff, #8b5cf6);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(139, 92, 246, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.playlist-song-play-btn:hover {
    background: linear-gradient(145deg, #a78bfa, #7c3aed);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(139, 92, 246, 0.4),
        0 8px 16px rgba(139, 92, 246, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.playlist-song-play-btn:active {
    transform: scale(1.05) translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(139, 92, 246, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.playlist-song-play-btn i {
    font-size: 0.7rem;
}

/* Empty State for Song List */
.playlist-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.playlist-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.2);
}

.playlist-empty-state p {
    margin: 0;
    font-size: 0.85rem;
}

/* Playlist View Header (Back button area) */
.playlist-view-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-view-back {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.playlist-view-back:hover {
    background: linear-gradient(145deg, #9d7aff, #8b5cf6);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 
        0 4px 8px rgba(139, 92, 246, 0.4),
        0 8px 16px rgba(139, 92, 246, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.playlist-view-back:active {
    transform: scale(1.05) translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.playlist-view-back i {
    font-size: 0.9rem;
}

/* ================================================
   JUKEBOT PLAYLIST SELECTOR UI (In Chat Feed)
   ================================================ */

.jukebot-playlist-selector {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.jukebot-playlist-selector-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.jukebot-playlist-selector-header i {
    color: #8b5cf6;
    font-size: 1.2rem;
}

.jukebot-playlist-selector-header span {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.jukebot-playlist-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.jukebot-playlist-selector-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.jukebot-playlist-selector-item:hover {
    transform: scale(1.05);
}

.jukebot-playlist-selector-art {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.jukebot-playlist-selector-item:hover .jukebot-playlist-selector-art {
    border-color: rgba(139, 92, 246, 0.6);
}

.jukebot-playlist-selector-art i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
}

.jukebot-playlist-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 92, 246, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.jukebot-playlist-selector-item:hover .jukebot-playlist-selector-overlay {
    opacity: 1;
}

.jukebot-playlist-selector-overlay i {
    color: white;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.jukebot-playlist-selector-name {
    margin-top: 6px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jukebot-playlist-selector-hint {
    margin-top: 12px;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.jukebot-playlist-confirm {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    color: #4ade80;
    font-weight: 500;
    margin-top: 10px;
}

.jukebot-playlist-confirm i {
    color: #4ade80;
}

/* ==================== MOBILE RESPONSIVE STYLES ==================== */
@media (max-width: 768px) {
    /* Slide-in panel - full screen on mobile */
    .playlist-panel {
        width: 100% !important;
        left: -100% !important;
    }
    
    .playlist-panel.active {
        left: 0 !important;
    }
    
    .playlist-panel-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 10px !important;
    }
    
    /* Jukebot internal playlist panel */
    .jukebot-playlist-panel {
        padding-left: 0 !important;
    }
    
    .jukebot-playlist-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Playlist view */
    .playlist-view-main {
        flex-direction: column !important;
    }
    
    .playlist-logo-section {
        width: 100% !important;
        min-width: 100% !important;
        flex-direction: row !important;
        padding-right: 0 !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    
    .playlist-logo-container {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
    }
    
    .playlist-queue-section {
        flex: unset !important;
    }
}
