/* ==========================================================================
   SCARMONIT MUSIC PLAYER - Spotify-Inspired Dark Theme
   ========================================================================== */

:root {
    --mp-sidebar-width: 280px;
    --mp-now-playing-height: 90px;
    --mp-bg: #0a0a0f;
    --mp-sidebar-bg: rgba(10, 10, 18, 0.95);
    --mp-card-bg: rgba(20, 20, 35, 0.6);
    --mp-accent: var(--color-accent-gold, #d4af37);
    --mp-accent-glow: rgba(212, 175, 55, 0.4);
    --mp-accent-hover: var(--color-accent-fire, #ff6b35);
    --mp-purple: var(--color-accent-purple, #6e45e2);
    --mp-blue: var(--color-accent-blue, #24aadb);
    --mp-text: var(--color-text-primary, #e8e8e8);
    --mp-text-dim: var(--color-text-secondary, #a0a0a0);
    --mp-text-faint: var(--color-text-dim, #8a8a8a);
    --mp-border: rgba(255, 255, 255, 0.06);
    --mp-hover-row: rgba(255, 255, 255, 0.05);
    --mp-glass-bg: rgba(255, 255, 255, 0.03);
    --mp-glass-border: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   APP LAYOUT - CSS Grid
   ========================================================================== */

.music-app {
    display: grid;
    grid-template-columns: var(--mp-sidebar-width) 1fr;
    grid-template-rows: 1fr var(--mp-now-playing-height);
    height: 100dvh;
    padding-top: 70px;
    box-sizing: border-box;
    background: var(--mp-bg);
    position: relative;
    overflow: hidden;
}

/* Hide footer and prevent body scroll on music page */
html:has(.music-app) {
    overflow: hidden;
    height: 100dvh;
}

main:has(.music-app) ~ footer {
    display: none;
}

/* ==========================================================================
   SIDEBAR — Redesigned
   ========================================================================== */

.music-sidebar {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
    background: linear-gradient(180deg, rgba(12, 10, 22, 0.98) 0%, rgba(8, 8, 16, 0.99) 100%);
    border-right: 1px solid var(--mp-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    z-index: 50;
    position: relative;
}

/* Animated accent line on right edge */
.music-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--mp-accent) 30%, var(--mp-purple) 60%, transparent 100%);
    opacity: 0.4;
    animation: sidebar-accent-shift 8s ease-in-out infinite alternate;
}

@keyframes sidebar-accent-shift {
    0% { background-position: 0 0; opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { background-position: 0 100%; opacity: 0.3; }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 6px;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, var(--mp-accent), transparent);
    opacity: 0.2;
}

.sidebar-header h2 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mp-accent);
    text-transform: none;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 0 12px var(--mp-accent-glow);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: none;
}

.sidebar-toggle:hover {
    color: var(--mp-text);
    background: var(--mp-hover-row);
}

.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: 80px;
    left: 12px;
    z-index: 40;
    background: var(--mp-sidebar-bg);
    border: 1px solid var(--mp-border);
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-mobile-toggle:hover {
    color: var(--mp-accent);
    border-color: var(--mp-accent);
}

/* ---- Now Playing Mini Widget ---- */
.sidebar-now-playing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 6px 2px;
    padding: 6px 8px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(110, 69, 226, 0.08) 100%);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-now-playing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(110, 69, 226, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-now-playing:hover::before {
    opacity: 1;
}

.sidebar-now-playing:hover {
    border-color: rgba(212, 175, 55, 0.25);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.1);
}

.sidebar-now-playing.hidden {
    display: none;
}

.snp-art {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.snp-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.snp-info {
    min-width: 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

.snp-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--mp-accent);
    text-transform: uppercase;
    margin-bottom: 1px;
}

.snp-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.snp-artist {
    font-size: 0.7rem;
    color: var(--mp-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snp-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.snp-bars span {
    width: 3px;
    background: var(--mp-accent);
    border-radius: 1px;
    animation: snp-bar 0.8s ease-in-out infinite alternate;
}

.snp-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.snp-bars span:nth-child(2) { height: 70%; animation-delay: 0.2s; }
.snp-bars span:nth-child(3) { height: 55%; animation-delay: 0.4s; }

.snp-bars.paused span {
    animation-play-state: paused;
}

@keyframes snp-bar {
    0% { height: 20%; }
    100% { height: 100%; }
}

/* ---- Playlist List ---- */
.playlist-list {
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    padding: 2px 4px 0;
    overflow-y: auto;
    min-height: 0;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.playlist-list::-webkit-scrollbar {
    width: 4px;
}

.playlist-list::-webkit-scrollbar-track {
    background: transparent;
}

.playlist-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.playlist-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 3px 8px;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    color: var(--mp-text-dim);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
}

.playlist-item:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: var(--mp-text);
    border-left-color: rgba(212, 175, 55, 0.3);
}

.playlist-item.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.14) 0%, rgba(212, 175, 55, 0.04) 100%);
    color: var(--mp-accent);
    border-left-color: var(--mp-accent);
    box-shadow: 0 0 16px -6px rgba(212, 175, 55, 0.25);
}

.playlist-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background: var(--mp-accent);
    box-shadow: 0 0 8px var(--mp-accent-glow);
    border-radius: 1px;
}

.playlist-item:focus-visible {
    outline: 1px solid var(--mp-accent);
    outline-offset: -1px;
    background: rgba(255, 255, 255, 0.04);
}

.playlist-item svg {
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.playlist-item:hover svg {
    opacity: 0.8;
}

.playlist-item.active svg {
    opacity: 1;
    color: var(--mp-accent);
    filter: drop-shadow(0 0 4px var(--mp-accent-glow));
}

/* Album art thumbnails in sidebar items */
.playlist-item .pl-thumb {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.playlist-item:hover .pl-thumb {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.playlist-item.active .pl-thumb {
    box-shadow: 0 0 10px var(--mp-accent-glow);
}

.playlist-item .pl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-item span:not(.playlist-count) {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    line-height: 1.3;
    min-width: 0;
}

/* ---- Sidebar Footer ---- */
.sidebar-footer {
    padding: 10px 10px 12px;
    margin-top: auto;
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--mp-accent), var(--mp-purple), transparent) 1;
    animation: footer-slide-in 0.5s ease-out both;
    animation-delay: 0.3s;
}

@keyframes footer-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-stats {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 10px 6px 8px;
    border-radius: 10px;
    background: var(--mp-glass-bg);
    border: 1px solid var(--mp-glass-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: default;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.06), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.08), inset 0 0 20px rgba(212, 175, 55, 0.03);
    transform: translateY(-1px);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover .stat-icon {
    color: var(--mp-accent);
    filter: drop-shadow(0 0 4px var(--mp-accent-glow));
}

.stat-item:hover .stat-label {
    color: var(--mp-text-dim);
}

.stat-icon {
    color: var(--mp-text-faint);
    margin-bottom: 6px;
    transition: color 0.3s ease, filter 0.3s ease;
    line-height: 0;
}

.stat-value {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--mp-accent);
    line-height: 1;
    text-shadow: 0 0 10px var(--mp-accent-glow);
    transition: text-shadow 0.3s ease;
}

.stat-item:hover .stat-value {
    text-shadow: 0 0 14px var(--mp-accent-glow), 0 0 28px rgba(212, 175, 55, 0.15);
}

.stat-label {
    font-size: 0.58rem;
    color: var(--mp-text-faint);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.stat-item:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: -2px;
}

.create-playlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(110, 69, 226, 0.15), rgba(212, 175, 55, 0.1));
    border: 1px solid rgba(110, 69, 226, 0.25);
    border-radius: 10px;
    color: var(--mp-text-dim);
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.create-playlist-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.08), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.create-playlist-btn:hover {
    border-color: var(--mp-accent);
    color: var(--mp-accent);
    background: linear-gradient(135deg, rgba(110, 69, 226, 0.2), rgba(212, 175, 55, 0.15));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1), 0 0 40px rgba(110, 69, 226, 0.06), inset 0 0 20px rgba(212, 175, 55, 0.03);
    transform: translateY(-1px);
}

.create-playlist-btn:hover::before {
    left: 100%;
}

.create-playlist-btn:active {
    transform: translateY(0);
    transition: transform 0.05s ease;
}

.create-playlist-btn:hover svg {
    transform: rotate(90deg);
    filter: drop-shadow(0 0 4px var(--mp-accent-glow));
}

.create-playlist-btn svg {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.create-playlist-btn:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: 2px;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.music-main {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
    overflow-y: auto;
    padding-bottom: var(--mp-now-playing-height);
    background: linear-gradient(180deg, rgba(110, 69, 226, 0.15) 0%, var(--mp-bg) 400px);
    scrollbar-gutter: stable;
}

/* Playlist Header */
.playlist-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 40px 32px 24px;
    background: linear-gradient(135deg, rgba(110, 69, 226, 0.14) 0%, rgba(212, 175, 55, 0.08) 40%, rgba(255, 107, 53, 0.06) 70%, rgba(36, 170, 219, 0.05) 100%);
    background-size: 300% 300%;
    animation: header-gradient-shift 25s ease infinite;
    border-bottom: 1px solid var(--mp-border);
}

@keyframes header-gradient-shift {
    0% { background-position: 0% 50%; }
    33% { background-position: 100% 0%; }
    66% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

.playlist-art {
    width: 192px;
    height: 192px;
    min-width: 192px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 40px var(--mp-accent-glow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    will-change: transform;
}

.playlist-art:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 60px var(--mp-accent-glow);
}

.playlist-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.playlist-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--mp-text);
}

.playlist-title {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--mp-text);
    margin: 0;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-meta {
    font-size: 0.85rem;
    color: var(--mp-text-dim);
}

/* Controls Bar */
.playlist-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 32px;
    background: linear-gradient(180deg, rgba(110, 69, 226, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--mp-border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.play-all-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.08);
    color: var(--mp-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.06);
    position: relative;
    flex-shrink: 0;
}

.play-all-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(212, 175, 55, 0.4), rgba(110, 69, 226, 0.2), rgba(212, 175, 55, 0.4));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.play-all-btn:hover {
    transform: scale(1.08);
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.play-all-btn:hover::after {
    opacity: 0.4;
    animation: play-ring-spin 3s linear infinite;
}

.play-all-btn:active {
    transform: scale(0.92);
    transition-duration: 0.1s;
}

@keyframes play-ring-spin {
    to { transform: rotate(360deg); }
}

.shuffle-all-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid rgba(196, 160, 48, 0.10);
    background: var(--mp-glass-bg);
    color: var(--mp-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.shuffle-all-btn .btn-label {
    pointer-events: none;
}

.shuffle-all-btn:hover {
    color: var(--mp-text);
    background: rgba(196, 160, 48, 0.06);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 10px rgba(196, 160, 48, 0.12);
    transform: translateY(-1px);
}

.shuffle-all-btn:active {
    transform: translateY(0) scale(0.97);
}

.shortcuts-hint-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mp-text-faint);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.shortcuts-hint-btn:hover {
    color: var(--mp-text);
    background: var(--mp-hover-row);
    border-color: var(--mp-glass-border);
}

.search-songs {
    position: relative;
    width: 200px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-songs:focus-within {
    width: 280px;
}

.search-songs svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mp-text-faint);
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-songs:focus-within svg {
    color: var(--mp-accent);
}

.search-songs input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: var(--mp-glass-bg);
    border: 1px solid var(--mp-glass-border);
    border-radius: 10px;
    color: var(--mp-text);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.25s ease;
}

.search-songs input::placeholder {
    color: var(--mp-text-faint);
    transition: color 0.2s ease;
}

.search-songs input:focus {
    border-color: var(--mp-accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.15), inset 0 0 12px rgba(212, 175, 55, 0.03);
}

.search-songs input:focus::placeholder {
    color: rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   SONG LIST
   ========================================================================== */

.song-list {
    padding: 8px 16px 0;
}

.song-list-header {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr 60px;
    gap: 16px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--mp-border);
    margin-bottom: 4px;
    background: rgba(10, 10, 15, 0.85);
    z-index: 5;
}

.song-list-header span,
.song-list-header button {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--mp-text-faint);
}

.col-sortable {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.col-sortable:hover {
    color: var(--mp-text);
}

.col-sortable.sort-active {
    color: var(--mp-accent);
}

.sort-arrow::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
}

.col-sortable.sort-asc .sort-arrow::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
}

.col-sortable.sort-desc .sort-arrow::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.col-num {
    text-align: center;
}

.col-duration {
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Song Row */
.song-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr 60px;
    gap: 16px;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: inset 0 0 0 0 var(--mp-accent);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    align-items: center;
    content-visibility: auto;
    contain-intrinsic-size: auto 56px;
}

.song-row:hover {
    background: var(--mp-hover-row);
    box-shadow: inset 3px 0 0 var(--mp-accent);
}

.song-row.active {
    background: rgba(212, 175, 55, 0.12);
    box-shadow: inset 3px 0 0 var(--mp-accent);
    position: relative;
}

.song-row.active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(212, 175, 55, 0.06);
    border-radius: inherit;
    opacity: 0;
    animation: active-row-pulse 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes active-row-pulse {
    from { opacity: 0; }
    to { opacity: 1; }
}

.song-row.active .song-num {
    color: var(--mp-accent);
}

.song-row.active .song-title-text {
    color: var(--mp-accent);
    text-shadow: 0 0 8px var(--mp-accent-glow);
}

.song-num {
    text-align: center;
    font-size: 0.85rem;
    color: var(--mp-text-dim);
    font-variant-numeric: tabular-nums;
}

.song-row:hover .song-num .num-text {
    display: none;
}

.song-row:hover .song-num .play-icon {
    display: block;
}

.song-row.active .song-num .num-text {
    display: none;
}

.song-row.active .song-num .playing-icon {
    display: flex;
}

.song-num .play-icon {
    display: none;
    color: var(--mp-text);
}

.song-num .playing-icon {
    display: none;
    gap: 2px;
    align-items: flex-end;
    justify-content: center;
    height: 14px;
}

.playing-bar {
    width: 3px;
    background: var(--mp-accent);
    border-radius: 1px;
    animation: playing-bars 0.8s ease-in-out infinite alternate;
}

.playing-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.playing-bar:nth-child(2) { height: 100%; animation-delay: 0.2s; animation-name: playing-bars-alt; }
.playing-bar:nth-child(3) { height: 40%; animation-delay: 0.4s; }
.playing-bar:nth-child(4) { height: 80%; animation-delay: 0.1s; animation-name: playing-bars-alt; }

@keyframes playing-bars {
    0% { height: 20%; }
    100% { height: 100%; }
}

@keyframes playing-bars-alt {
    0% { height: 100%; }
    50% { height: 30%; }
    100% { height: 80%; }
}

.song-title-col {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.song-thumb {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.song-row:hover .song-thumb {
    box-shadow: 0 0 10px rgba(110, 69, 226, 0.4);
    transform: scale(1.05);
}

.song-row.active .song-thumb {
    box-shadow: 0 0 12px var(--mp-accent-glow);
}

.song-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-title-info {
    min-width: 0;
}

.song-title-text {
    font-size: 0.9rem;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist-mobile {
    display: none;
    font-size: 0.75rem;
    color: var(--mp-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist, .song-album {
    font-size: 0.85rem;
    color: var(--mp-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist:hover, .song-album:hover {
    color: var(--mp-text);
    text-decoration: underline;
}

.song-duration {
    font-size: 0.85rem;
    color: var(--mp-text-dim);
    text-align: right;
    font-variant-numeric: tabular-nums;
    position: relative;
}

.song-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    right: 0;
}

.song-duration-text {
    transition: opacity 0.2s ease;
}

.song-row:hover .song-duration-text {
    opacity: 0;
}

.song-row:hover .song-row-actions {
    opacity: 1;
}

.song-action-btn {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.song-action-btn:hover {
    color: var(--mp-text);
}

.song-action-btn:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: 2px;
}

.song-action-btn.is-favorite svg {
    fill: var(--mp-accent);
    stroke: var(--mp-accent);
    animation: heart-pop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.np-favorite-btn.heart-pop {
    animation: heart-pop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Empty State */
.music-empty-state {
    text-align: center;
    padding: 80px 32px;
    color: var(--mp-text-dim);
}

.music-empty-state svg {
    filter: drop-shadow(0 0 20px var(--mp-accent-glow));
}

.music-empty-state h3 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--mp-text);
    margin: 24px 0 10px;
}

.music-empty-state p {
    font-size: 0.9rem;
    color: var(--mp-text-dim);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.music-empty-state code {
    background: var(--mp-glass-bg);
    border: 1px solid var(--mp-glass-border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--mp-accent);
}

/* ==========================================================================
   NOW PLAYING BAR
   ========================================================================== */

.now-playing-bar {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(20, 20, 35, 0.92) 0%, rgba(12, 12, 22, 0.98) 100%);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    z-index: 100;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4), 0 -1px 8px rgba(212, 175, 55, 0.08);
    position: relative;
}

/* Playing glow effect */
.now-playing-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--mp-accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.now-playing-bar.is-playing::before {
    opacity: 1;
    animation: np-bar-glow 3s ease-in-out infinite alternate;
}

@keyframes np-bar-glow {
    0% { box-shadow: 0 0 8px var(--mp-accent-glow); }
    100% { box-shadow: 0 0 16px var(--mp-accent-glow); }
}

/* Track Info (left) */
.np-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.np-album-art {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 16px var(--mp-accent-glow);
    transition: box-shadow 0.3s ease, border-radius 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s ease;
}

.np-album-art:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 24px var(--mp-accent-glow);
}

.np-album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-text {
    min-width: 0;
}

.np-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-title.has-song:hover {
    text-decoration: underline;
    cursor: pointer;
}

.np-artist {
    font-size: 0.75rem;
    color: var(--mp-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-favorite-btn {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.np-favorite-btn:hover {
    color: var(--mp-accent);
    transform: scale(1.1);
}

.np-favorite-btn.is-favorite svg {
    fill: var(--mp-accent);
    stroke: var(--mp-accent);
    color: var(--mp-accent);
}

/* Player Controls (center) */
.np-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.np-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.np-buttons button {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.15s;
    position: relative;
}

.np-buttons button:hover {
    color: var(--mp-text);
    transform: scale(1.1);
}

.np-buttons button.active {
    color: var(--mp-accent);
}

.now-playing-bar .np-play-pause {
    width: 36px;
    height: 36px;
    background: var(--mp-text);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.now-playing-bar .np-play-pause:hover {
    transform: scale(1.08);
    background: #fff;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.now-playing-bar .np-play-pause:active {
    transform: scale(0.95);
}

.repeat-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--mp-accent);
}

/* Progress Bar */
.np-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.np-time-current, .np-time-total {
    font-size: 0.7rem;
    color: var(--mp-text-faint);
    min-width: 35px;
    font-variant-numeric: tabular-nums;
}

.np-time-current {
    text-align: right;
}

.np-time-total {
    text-align: left;
}

.np-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.15s;
}

.np-progress-track:hover {
    height: 6px;
}

.np-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--mp-accent), var(--mp-accent-hover));
    border-radius: 2px;
    position: relative;
    transition: none;
    transform-origin: left;
    transform: scaleX(0);
    will-change: transform;
}

.np-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: var(--mp-text);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    will-change: transform, opacity;
}

.np-progress-track:hover .np-progress-fill::after,
.np-progress-track:active .np-progress-fill::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.np-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Volume (right) */
.np-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.np-queue-btn {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.np-queue-btn:hover {
    color: var(--mp-text);
}

.np-queue-btn.active {
    color: var(--mp-accent);
}

.np-volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.np-volume-btn {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.np-volume-btn:hover {
    color: var(--mp-text);
}

.np-volume-track {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.np-volume-track:hover {
    height: 6px;
}

.np-volume-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mp-accent), var(--mp-accent-hover));
    border-radius: 2px;
    position: relative;
    transition: none;
}

.np-volume-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: var(--mp-text);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    will-change: transform, opacity;
}

.np-volume-track:hover .np-volume-fill::after,
.np-volume-track:active .np-volume-fill::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.np-volume-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* ==========================================================================
   QUEUE PANEL
   ========================================================================== */

.queue-panel {
    position: fixed;
    top: 70px;
    right: 0;
    width: 360px;
    bottom: var(--mp-now-playing-height);
    background: rgba(15, 15, 25, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(212, 175, 55, 0.1);
    z-index: 90;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    will-change: transform, opacity;
}

.queue-panel.open {
    transform: translateX(0);
    opacity: 1;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--mp-border);
}

.queue-header h3 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--mp-text);
    margin: 0;
}

.queue-close {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.queue-close:hover {
    color: var(--mp-text);
    background: var(--mp-hover-row);
}

.queue-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.queue-section {
    margin-bottom: 24px;
}

.queue-section h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--mp-text-faint);
    margin: 0 0 12px;
}

.queue-empty {
    font-size: 0.85rem;
    color: var(--mp-text-faint);
    padding: 8px 0;
}

.queue-song {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border-left: 2px solid transparent;
}

.queue-song:hover {
    background: var(--mp-hover-row);
    border-left: 2px solid var(--mp-accent);
}

.queue-song-art {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.queue-song:hover .queue-song-art {
    box-shadow: 0 0 8px rgba(110, 69, 226, 0.4);
}

.queue-song-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-song-info {
    min-width: 0;
    flex: 1;
}

.queue-song-title {
    font-size: 0.85rem;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-song-artist {
    font-size: 0.75rem;
    color: var(--mp-text-dim);
}

.queue-song-remove {
    background: none;
    border: none;
    color: var(--mp-text-faint);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.15s;
}

.queue-song:hover .queue-song-remove {
    opacity: 1;
}

.queue-song-remove:hover {
    color: var(--mp-accent-hover);
}

.queue-song.is-current {
    background: rgba(212, 175, 55, 0.08);
}

.queue-song.is-current .queue-song-title {
    color: var(--mp-accent);
}

/* ==========================================================================
   SIDEBAR OVERLAY (mobile)
   ========================================================================== */

.music-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.music-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   RESPONSIVE - Mobile (<768px)
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --mp-now-playing-height: 140px;
    }

    .music-app {
        grid-template-columns: 1fr;
    }

    .music-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 50;
        will-change: transform;
    }

    .music-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-mobile-toggle {
        display: block;
    }

    .music-main {
        grid-column: 1 / -1;
    }

    /* Playlist header compact */
    .playlist-header {
        padding: 24px 16px 16px 56px;
        gap: 16px;
    }

    .playlist-art {
        width: 120px;
        height: 120px;
        min-width: 120px;
    }

    .playlist-title {
        font-size: 1.5rem;
    }

    /* Controls */
    .playlist-controls {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .shuffle-all-btn .btn-label {
        display: none;
    }

    .shuffle-all-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        border-radius: 50%;
    }

    .search-songs {
        width: 100%;
        order: 3;
    }

    .search-songs:focus-within {
        width: 100%;
    }

    .controls-left {
        gap: 10px;
    }

    .play-all-btn {
        width: 30px;
        height: 30px;
        box-shadow: none;
    }

    .play-all-btn svg {
        width: 12px;
        height: 12px;
    }

    .controls-right {
        flex: 1;
        justify-content: flex-end;
    }

    /* Song list - hide album column */
    .song-list {
        padding: 8px 8px 0;
    }

    .song-list-header {
        grid-template-columns: 32px 1fr 70px;
        gap: 8px;
        padding: 8px;
    }

    .song-list-header .col-artist,
    .song-list-header .col-album {
        display: none;
    }

    .song-row {
        grid-template-columns: 32px 1fr 70px;
        gap: 8px;
        padding: 8px;
    }

    .song-artist, .song-album {
        display: none;
    }

    .song-artist-mobile {
        display: block;
    }

    .song-thumb {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    /* Now Playing Bar */
    .now-playing-bar {
        grid-template-columns: 1fr auto;
        padding: 8px 12px;
        gap: 2px 8px;
        overflow: hidden;
    }

    .np-track-info {
        order: 1;
    }

    .np-controls {
        order: 3;
        grid-column: 1 / -1;
    }

    .np-right {
        display: flex;
        order: 2;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    .np-volume-track {
        width: 60px;
    }

    .np-album-art {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .np-buttons {
        gap: 10px;
    }

    .np-shuffle, .np-repeat {
        display: flex;
    }

    .np-shuffle svg, .np-repeat svg {
        width: 14px;
        height: 14px;
    }

    .np-prev, .np-next {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .now-playing-bar .np-play-pause {
        width: 44px;
        height: 44px;
    }

    /* Queue */
    .queue-panel {
        width: 100%;
        right: 0;
    }

    .queue-panel.open {
        transform: translateX(0);
    }
}

/* ==========================================================================
   RESPONSIVE - Tablet (769px - 1024px)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --mp-sidebar-width: 220px;
    }

    .playlist-art {
        width: 148px;
        height: 148px;
        min-width: 148px;
    }

    .playlist-title {
        font-size: 2rem;
    }

    .song-list-header,
    .song-row {
        grid-template-columns: 40px 1fr 1fr 60px;
    }

    .col-album, .song-album {
        display: none;
    }

    .np-volume-track {
        width: 70px;
    }

    .search-songs input {
        max-width: 180px;
    }

    .queue-panel {
        width: 300px;
    }
}

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

.music-main::-webkit-scrollbar,
.music-sidebar::-webkit-scrollbar,
.queue-content::-webkit-scrollbar {
    width: 8px;
}

.music-main::-webkit-scrollbar-track,
.music-sidebar::-webkit-scrollbar-track,
.queue-content::-webkit-scrollbar-track {
    background: transparent;
}

.music-main::-webkit-scrollbar-thumb,
.music-sidebar::-webkit-scrollbar-thumb,
.queue-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.music-main::-webkit-scrollbar-thumb:hover,
.music-sidebar::-webkit-scrollbar-thumb:hover,
.queue-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.3);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.song-row {
    animation: fade-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: calc(min(var(--row-index, 0), 12) * 0.025s);
}

/* Suppress fade-in animations during sort/filter */
.no-animate .song-row {
    animation: none !important;
}

/* Touch device: always show progress/volume thumb */
@media (pointer: coarse) {
    .np-progress-fill::after,
    .np-volume-fill::after {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    .song-action-btn {
        padding: 10px;
        margin: -6px;
    }

    /* Show favorite button always on touch devices */
    .song-row-actions {
        opacity: 1;
    }

    /* Keep duration visible alongside actions */
    .song-row .song-duration-text {
        opacity: 1;
    }
}

/* Song row loading shimmer */
.song-row.loading .song-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.15), transparent);
    animation: shimmer 1.2s ease infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Loading Skeleton */
.song-list-skeleton {
    padding: 8px 16px;
}

.skeleton-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr 60px;
    gap: 16px;
    padding: 8px 16px;
    align-items: center;
}

.skeleton-row::before {
    content: '';
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
}

.skeleton-row::after {
    content: '';
    height: 12px;
    border-radius: 4px;
    grid-column: 2 / -1;
    animation: shimmer 1.5s ease infinite;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
}

@media (max-width: 768px) {
    .skeleton-row {
        grid-template-columns: 32px 1fr 50px;
    }
}

/* Now-playing album art vinyl spin */
.np-album-art.spinning {
    border-radius: 50%;
    animation: vinyl-spin 8s linear infinite;
}

.np-album-art.spinning.paused {
    animation-play-state: paused;
}

@keyframes vinyl-spin {
    to { transform: rotate(360deg); }
}

/* Track change crossfade */
.np-track-info {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.np-track-info.transitioning {
    opacity: 0;
    transform: translateY(4px);
}

/* Queue overlay (same pattern as sidebar overlay) */
.queue-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 85;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.queue-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Song row focus-visible for keyboard navigation */
.song-row:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: -2px;
}

/* Create Playlist Modal */
.playlist-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-overlay-in 0.2s ease-out;
}

@keyframes modal-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.playlist-modal {
    background: rgba(25, 25, 40, 0.98);
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    padding: 28px;
    width: 90%;
    max-width: 400px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modal-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.playlist-modal h3 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 1.1rem;
    color: var(--mp-text);
    margin: 0 0 16px;
}

.playlist-modal input {
    width: 100%;
    padding: 10px 14px;
    background: var(--mp-glass-bg);
    border: 1px solid var(--mp-glass-border);
    border-radius: 8px;
    color: var(--mp-text);
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.playlist-modal input:focus {
    border-color: var(--mp-accent);
}

.playlist-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.playlist-modal-actions button {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-modal-actions .modal-cancel {
    background: transparent;
    color: var(--mp-text-dim);
    border: 1px solid var(--mp-border);
}

.playlist-modal-actions .modal-cancel:hover {
    color: var(--mp-text);
    background: var(--mp-hover-row);
}

.modal-confirm {
    background: var(--mp-accent);
    color: #000;
    font-weight: 600;
}

.modal-confirm:hover {
    background: var(--mp-accent-hover);
}

/* Context Menu */
.song-context-menu {
    position: fixed;
    background: rgba(25, 25, 40, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 180px;
    z-index: 300;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.05);
    animation: context-menu-in 0.15s ease-out;
}

@keyframes context-menu-in {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--mp-text-dim);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.context-menu-item:hover {
    background: var(--mp-hover-row);
    color: var(--mp-text);
}

.context-menu-divider {
    height: 1px;
    background: var(--mp-border);
    margin: 4px 0;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.music-toast-container {
    position: fixed;
    bottom: calc(var(--mp-now-playing-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.music-toast {
    background: rgba(25, 25, 40, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-left: 3px solid var(--mp-accent);
    border-radius: 8px;
    padding: 10px 20px;
    color: var(--mp-text);
    font-size: 0.85rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
}

.music-toast.toast-out {
    animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* ==========================================================================
   KEYBOARD SHORTCUTS OVERLAY
   ========================================================================== */

.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.shortcuts-overlay.open {
    opacity: 1;
    visibility: visible;
}

.shortcuts-modal {
    background: rgba(25, 25, 40, 0.98);
    border: 1px solid var(--mp-border);
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.shortcuts-overlay.open .shortcuts-modal {
    transform: scale(1) translateY(0);
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--mp-border);
}

.shortcuts-header h3 {
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--mp-text);
    margin: 0;
}

.shortcuts-close {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.shortcuts-close:hover {
    color: var(--mp-text);
    background: var(--mp-hover-row);
}

.shortcuts-body {
    padding: 16px 24px 24px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.shortcut-row:last-child {
    border-bottom: none;
}

.shortcut-row kbd {
    display: inline-block;
    min-width: 32px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-family: var(--font-display, 'Orbitron', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mp-accent);
    text-align: center;
}

.shortcut-row span {
    font-size: 0.85rem;
    color: var(--mp-text-dim);
}

/* ==========================================================================
   FOCUS-VISIBLE (keyboard navigation)
   ========================================================================== */

.music-app button:focus-visible,
.music-app input:focus-visible,
.music-app [role="button"]:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: 2px;
}

.np-play-pause:focus-visible {
    outline-offset: 3px;
    box-shadow: 0 0 0 4px var(--mp-accent-glow) !important;
}

.playlist-item:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: -2px;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .song-row,
    .playlist-art,
    .playlist-header,
    .play-all-btn,
    .np-play-pause,
    .np-favorite-btn,
    .np-buttons button,
    .shuffle-all-btn,
    .queue-panel,
    .music-sidebar,
    .sidebar-mobile-toggle,
    .song-thumb,
    .np-album-art,
    .np-track-info,
    .song-context-menu,
    .playlist-modal-overlay,
    .playlist-modal,
    .shortcuts-overlay,
    .shortcuts-modal,
    .song-action-btn svg,
    .song-row-actions,
    .song-duration-text,
    .sidebar-footer,
    .stat-item,
    .create-playlist-btn {
        transition: none !important;
        animation: none !important;
    }

    .playing-bar {
        animation: none !important;
        height: 60% !important;
    }

    .playlist-art:hover {
        transform: none;
    }

    .np-album-art.spinning {
        animation: none !important;
        border-radius: 50%;
    }

    .song-row.active {
        animation: none !important;
    }

    .now-playing-bar.is-playing::before {
        animation: none !important;
    }

    .music-sidebar-overlay,
    .queue-overlay {
        transition: none !important;
    }

    .music-sidebar::after,
    .snp-bars span,
    .scroll-to-playing,
    .scroll-to-playing svg {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   SCREEN READER ONLY
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none;
}

/* ==========================================================================
   ALBUM AUTO-PLAYLISTS (Sidebar)
   ========================================================================== */

.sidebar-section-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.5px;
    color: var(--mp-text-faint);
    padding: 4px 8px 2px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--mp-border), transparent);
}

.playlist-item .playlist-count {
    margin-left: auto;
    font-family: 'Poppins', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--mp-text-faint);
    text-transform: none;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.playlist-item:hover .playlist-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--mp-text-dim);
}

.playlist-item.active .playlist-count {
    background: rgba(212, 175, 55, 0.15);
    color: var(--mp-accent);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.1);
}

/* ==========================================================================
   PLAYLIST HEADER ART COLLAGE
   ========================================================================== */

.playlist-art-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    gap: 2px;
    border-radius: 8px;
    overflow: hidden;
}

.playlist-art-collage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-art-collage .collage-placeholder {
    background: linear-gradient(135deg, var(--mp-purple), var(--mp-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Single cover variant */
.playlist-art-single {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.playlist-art-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   SCROLL TO PLAYING BUTTON
   ========================================================================== */

.scroll-to-playing {
    position: fixed;
    bottom: calc(var(--mp-now-playing-height) + 16px);
    right: 24px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 12px;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 24px;
    color: var(--mp-accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(212, 175, 55, 0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: scroll-btn-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.scroll-to-playing:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--mp-accent);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

.scroll-to-playing:active {
    transform: translateY(0) scale(0.97);
}

.scroll-to-playing.hidden {
    display: none;
}

.scroll-to-playing svg {
    flex-shrink: 0;
    animation: scroll-btn-pulse 2s ease-in-out infinite;
}

@keyframes scroll-btn-in {
    from { opacity: 0; transform: translateY(8px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scroll-btn-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@media (max-width: 768px) {
    .scroll-to-playing {
        bottom: calc(var(--mp-now-playing-height) + 10px);
        right: 12px;
        padding: 6px 12px 6px 10px;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   FIREFOX SCROLLBAR
   ========================================================================== */

.music-main,
.music-sidebar,
.queue-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
