:root { 
    --bg: #000; 
    --panel: #111; 
    --border: #333; 
    --text: #fff; 
    --subtext: #999; 
    --accent: #fff; 
}

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    overflow: hidden; 
}

header { 
    padding: 10px 20px; 
    background: var(--bg); 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    border-bottom: 1px solid var(--border); 
    z-index: 10; 
    flex-wrap: wrap;
}

button {
    padding: 8px 12px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: 0.2s;
}

button:hover {
    background: #555;
}

button:disabled {
    background: #222;
    color: #666;
}

/* Album tracklist overlay styles */
.album-tracklist-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.album-tracklist-overlay .overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.album-tracklist-overlay .overlay-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.5px;
}

.album-tracklist-overlay .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--subtext);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 1;
}

.album-tracklist-overlay .close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

.album-tracklist-overlay .track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 13px;
}

.album-tracklist-overlay .track-item:hover {
    background: rgba(255,255,255,0.1);
}

.album-tracklist-overlay .track-title {
    color: var(--text);
    flex: 1;
}

.album-tracklist-overlay .track-duration {
    color: var(--subtext);
    margin-left: 10px;
}

.album-tracklist-overlay .overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.album-tracklist .track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s;
}

.album-tracklist .track-item:hover {
    background: rgba(255,255,255,0.1);
}

.album-tracklist .track-title {
    color: var(--text);
}

.album-tracklist .track-duration {
    color: var(--subtext);
}

button:disabled {
    cursor: not-allowed;
}

input { 
    background: var(--panel); 
    border: 1px solid var(--border); 
    color: var(--text); 
    padding: 8px; 
    border-radius: 4px; 
    font-size: 12px; 
}

#sync-indicator { 
    font-size: 10px; 
    color: var(--subtext); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-left: auto; 
}

/* Layout */
#layout { 
    display: flex; 
    flex: 1; 
    overflow: hidden; 
}

#sidebar { 
    width: 280px; 
    background: var(--bg); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
}

#right-sidebar {
    width: 280px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-section { 
    padding: 20px 15px 10px; 
    font-size: 11px; 
    color: var(--subtext); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.nav-item { 
    padding: 8px 15px; 
    cursor: pointer; 
    font-size: 14px; 
    color: var(--text); 
    transition: 0.2s; 
}

.nav-item:hover { 
    background: var(--panel); 
}

.nav-item.active { 
    border-left: 3px solid var(--accent); 
    background: var(--panel); 
}

/* Main Content */
#main-content { 
    flex: 1; 
    overflow-y: auto; 
    padding: 25px; 
    scroll-behavior: smooth; 
}

.shelf { 
    margin-bottom: 40px; 
}

.shelf-title { 
    font-size: 18px; 
    font-weight: 700; 
    margin-bottom: 15px; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 8px; 
    display: flex; 
    justify-content: space-between; 
}

/* Grid & Cards */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 12px; 
}

.card { 
    cursor: pointer; 
    transition: 0.3s; 
}

.card:hover { 
    opacity: 0.6; 
}

.card img { 
    width: 100%; 
    aspect-ratio: 1; 
    background: var(--panel); 
    border: 1px solid var(--border); 
    object-fit: cover; 
    border-radius: 2px; 
}

.card-meta { 
    margin-top: 6px; 
    font-size: 11px; 
    font-weight: 600; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.card-sub { 
    margin-top: 3px; 
    font-size: 9px; 
    color: var(--subtext); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* Track List */
#track-list { 
    padding: 10px; 
}

.track { 
    padding: 10px; 
    font-size: 13px; 
    border-bottom: 1px solid #111; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    border-radius: 4px; 
}

.track:hover { 
    background: var(--panel); 
}

/* Player Bar */
#player-bar {
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

#now-playing {
    flex: 0 0 200px;
    min-width: 0;
}

#playback-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#playback-controls button {
    padding: 8px 12px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 36px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#playback-controls button:hover {
    background: #222;
}

#playback-controls button:active {
    background: #333;
}

#player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

#now-playing {
    flex: 1;
    min-width: 0;
}

#custom-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    flex: 0 0 auto;
}

#custom-audio-player button {
    background: transparent;
    color: var(--text);
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 2px;
    transition: background 0.2s;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#custom-audio-player button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#custom-audio-player button:hover {
    background: rgba(255, 255, 255, 0.1);
}

#custom-audio-player button:active {
    background: rgba(255, 255, 255, 0.2);
}

#shuffle-btn.shuffle-active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

#shuffle-btn.shuffle-active:hover {
    background: rgba(255, 255, 255, 0.3);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.progress-container span {
    font-size: 11px;
    color: var(--subtext);
    min-width: 35px;
}

#progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
}

#progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

#volume-btn {
    background: transparent;
    color: var(--text);
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    border-radius: 2px;
    transition: background 0.2s;
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
}

#volume-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#volume-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#volume-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

#volume-bar {
    width: 60px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
}

#volume-bar::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.track.playing {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent);
}

.playing-indicator {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Album button styles */
.album-btn {
    position: absolute !important;
    top: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    padding: 5px !important;
    cursor: pointer !important;
    border-radius: 2px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    font-size: 18px !important;
    color: #fff !important;
    font-weight: bold !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.album-btn.add-queue {
    left: 0 !important;
    border-radius: 2px 0 !important;
}

.album-btn.add-playlist {
    right: -5px !important;
    border-radius: 0 2px !important;
    margin-right: 0 !important;
    padding: 5px !important;
}

/* Sentinel for Infinite Scroll */
#sentinel { 
    height: 50px; 
    width: 100%; 
    margin-top: 20px; 
}
