/* General Body & Layout */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
}

/* Prevent body scroll when a modal/overlay is open on mobile */
.body-scroll-locked {
    overflow: hidden;
}

/* Fixed Top Dashboard with Collapsible Tray */
.dashboard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.dashboard.collapsed {
    transform: translateY(-100%);
}

.dashboard.collapsed .header-bar {
    transform: translateY(100%);
}

.header-bar {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    transition: transform 0.3s ease-in-out;
    background-color: #1e1e1e; /* Ensure background on mobile */
    position: relative;
    z-index: 10;
    overflow: hidden; /* Prevent header from growing beyond its height */
}

.header-tray {
    display: none; /* Functionality moved to side menu */
}

.header-tray.expanded {
    display: none; /* Functionality moved to side menu */
}

.tray-content {
    padding: 1rem;
}

.tray-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.tray-tab {
    background: none;
    border: none;
    color: #999;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.tray-tab:hover {
    color: #fff;
}

.tray-tab.active {
    color: #fff;
    border-bottom-color: #1db954;
}

.tab-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.tab-badge.active-badge {
    background-color: #28a745;
    color: #fff;
}

.tab-badge.failed-badge {
    background-color: #ff4444;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.menu-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-right: 1rem;
    z-index: 102;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
}

.menu-toggle-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #1db954;
    margin: 3px 0;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 60px; /* Start below the header bar */
    left: -300px; /* Start off-screen */
    width: 300px;
    height: calc(100% - 60px); /* Full height minus header */
    background-color: #1e1e1e;
    padding: 1rem;
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    transition: left 0.3s ease-in-out;
    z-index: 99; /* Below header but above content */
    overflow-y: auto;
    box-sizing: border-box; /* Ensures padding is included in the 300px width */
}

.side-menu.open { left: 0; }

/* Right Side Menu */
.right-menu {
    position: fixed;
    top: 60px; /* Start below the header bar */
    right: -300px; /* Start off-screen to the right */
    width: 300px;
    height: calc(100% - 60px); /* Full height minus header */
    background-color: #1e1e1e;
    padding: 1rem;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    transition: right 0.3s ease-in-out;
    z-index: 99; /* Below header but above content */
    overflow-y: auto;
    box-sizing: border-box;
}

.right-menu.open { right: 0; }

/* Download count button - circular badge style */
.download-count-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    margin-right: 1rem;
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.download-count-btn:hover {
    opacity: 0.8;
}

/* Badge appears as a circle in the top-right */
#download-count-display {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75rem;
    padding: 0 6px;
    color: #fff;
    transition: all 0.2s;
}

/* Show badge when there are downloads */
.download-count-btn.has-badge #download-count-display {
    display: flex;
}

/* Color coding for download states */
#download-count-display.has-active {
    background-color: #28a745;
}

#download-count-display.has-failed {
    background-color: #ff4444;
}

/* Icon for the button (3 horizontal lines) */
.download-count-btn::before {
    content: '☰';
    font-size: 1.25rem;
    color: #888;
    transition: color 0.2s;
}

.download-count-btn:hover::before {
    color: #1db954;
}

/* Hide hamburger icon when badge is showing to reduce clutter */
.download-count-btn.has-badge::before {
    opacity: 0.3;
}

.side-menu-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 3px solid #1db954;
}

.side-menu-section h4 {
    color: #1db954;
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.side-menu-btn {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    text-align: left;
}

.side-menu-btn:hover:not(:disabled) {
    background-color: rgba(29, 185, 84, 0.1);
    border-color: #1db954;
}

.side-menu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.side-menu-btn.danger {
    color: #ff4444;
    border-color: #ff4444;
}

.side-menu-btn.danger:hover:not(:disabled) {
    background-color: rgba(255, 68, 68, 0.1);
}

/* Connected Accounts Section */
#connected-accounts-section {
    margin-top: 1.5rem;
}

.no-accounts {
    color: #888;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.account-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #282828;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-type {
    color: #1db954;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.account-disconnect-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.account-disconnect-btn:hover {
    color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
}

.account-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.spotify-icon {
    background-color: #1db954;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.add-account-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-account-btn .account-icon {
    width: 16px;
    height: 16px;
}

/* Profile Header Styles */
.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(29, 185, 84, 0.15) 0%, rgba(29, 185, 84, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid rgba(29, 185, 84, 0.2);
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #282828;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-providers {
    color: #888;
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Linked Accounts List */
.linked-accounts-list {
    margin-bottom: 0.75rem;
}

.linked-account-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.linked-account-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.linked-account-item .provider-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.linked-account-item.spotify .provider-icon {
    color: #1db954;
}

.linked-account-item.deezer .provider-icon {
    color: #FEAA2D;
}

.linked-account-item.discord .provider-icon {
    color: #5865f2;
}

.linked-account-info {
    flex: 1;
    min-width: 0;
}

.linked-account-name {
    color: #fff;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.linked-account-provider {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.linked-account-item.spotify .linked-account-provider {
    color: #1db954;
}

.linked-account-item.deezer .linked-account-provider {
    color: #FEAA2D;
}

.linked-account-item.discord .linked-account-provider {
    color: #5865f2;
}

.unlink-account-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.unlink-account-btn:hover {
    color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
}

/* Link Account Buttons */
.link-account-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.link-account-buttons .add-account-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-account-buttons .provider-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.link-account-buttons .add-account-btn[data-provider="spotify"] .provider-icon {
    color: #1db954;
}

.link-account-buttons .add-account-btn[data-provider="deezer"] .provider-icon {
    color: #FEAA2D;
}

.link-account-buttons .add-account-btn[data-provider="discord"] .provider-icon {
    color: #5865f2;
}

.link-account-buttons .add-account-btn.linked {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Session Actions */
.session-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

h1 {
    color: #fff;
    font-weight: 300;
    margin: 0;
    font-size: 1.5rem;
}

.header-title-group {
    flex: 1;
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping on mobile */
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    min-width: 0; /* Allow flex item to shrink */
    overflow: hidden;
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0; /* Allow shrinking */
    overflow: hidden;
}

.header-title-container h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-icon {
    font-size: 20px;
    line-height: 1;
}

.header-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Header subtitle - hidden (simplified header) */
.header-subtitle {
    display: none !important;
}

/* Active Playlist Toggle - header button (HIDDEN - moved to right menu) */
.active-playlist-toggle {
    display: none !important;
}

/* Header Expand Button */
.header-expand-btn {
    display: none; /* Tray functionality moved to side menu */
}

/* Playlist Filter Container */
.playlist-filter-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.filter-input {
    width: 100%;
    padding: 10px 35px 10px 10px;
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.filter-input:focus {
    outline: none;
    border-color: #1db954;
}

.clear-filter-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
}

.clear-filter-btn:hover {
    color: #fff;
}

.filter-stats {
    font-size: 0.85rem;
    color: #aaa;
    margin-top: 0.5rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.match-nav-btn {
    background-color: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
}

.match-nav-btn:hover {
    background-color: #444;
}

.match-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#match-position {
    color: #e0e0e0;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

.filter-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-mode-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* Batch Selection Toolbar */
.batch-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1e1e1e;
    border-top: 2px solid #1db954;
    padding: 1rem;
    display: none;
    align-items: center;
    gap: 1rem;
    z-index: 999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.batch-toolbar.visible {
    display: flex;
}

.batch-toolbar-info {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
}

.batch-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.batch-toolbar-btn {
    background-color: #1db954;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.batch-toolbar-btn:hover {
    background-color: #1ed760;
}

.batch-toolbar-btn.secondary {
    background-color: #555;
}

.batch-toolbar-btn.secondary:hover {
    background-color: #666;
}

.batch-toolbar-btn.danger {
    background-color: #ff4444;
}

.batch-toolbar-btn.danger:hover {
    background-color: #ff6666;
}

/* Tray Actions */
.tray-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tray-action-btn {
    background-color: #1db954;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.tray-action-btn:hover {
    background-color: #1ed760;
}

/* Playlist Actions Dropdown */
.playlist-actions-dropdown {
    position: relative;
    display: inline-block;
}

.playlist-actions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    z-index: 1000;
    margin-top: 4px;
}

.playlist-action-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.playlist-action-item:hover {
    background-color: rgba(29, 185, 84, 0.1);
}

.playlist-action-item.delete {
    color: #ff4444;
    border-top: 1px solid #444;
}

.playlist-action-item.delete:hover {
    background-color: rgba(255, 68, 68, 0.1);
}

/* Download Queue List in Tab */
/* Downloads header with inline count */
.downloads-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.downloads-total-badge {
    color: #666;
    font-size: 0.75rem;
    font-weight: normal;
}

.downloads-empty {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
    font-style: italic;
}

.download-queue-list {
    max-height: 350px;
    overflow-y: auto;
}

.download-queue-list .queue-section {
    margin-bottom: 1.5rem;
}

.download-queue-list .queue-section h4 {
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
    color: #bbb;
    font-weight: 500;
}

/* Track highlighting for filter */
.track-item.filter-match {
    background-color: rgba(96, 165, 250, 0.15);
    border-left: 3px solid #60a5fa;
}

.track-item.filter-hidden {
    display: none;
}

.track-item.current-match {
    background-color: rgba(96, 165, 250, 0.3);
    border-left: 3px solid #3b82f6;
}

/* Track age display */
.track-age {
    color: #888;
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 0.5rem;
}

.isrc-code {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Download Queue Button */
.download-queue-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.download-icon {
    font-size: 1.5rem;
    color: #fff;
}

.download-count {
    background-color: #1db954;
    color: #fff;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.download-count:empty {
    display: none;
}

.controls {
    display: flex;
    flex-direction: column;
}

.controls label {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #b3b3b3;
}

.combo-search-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.new-playlist-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    background-color: #1db954;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.new-playlist-btn:hover {
    background-color: #1ed760;
}

.new-playlist-btn:active {
    background-color: #19a347;
}

.search-input {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 10px 12px;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #1db954;
    border-radius: 4px 4px 0 0;
    cursor: text;
}

.combo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #1db954;
    border-top: none;
    border-radius: 0 0 4px 4px;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin: 0;
    padding: 0;
}

.combo-dropdown.show {
    display: block;
}

.combo-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
}

.combo-dropdown-item:hover,
.combo-dropdown-item.selected {
    background-color: #1db954;
}

/* Active playlist highlight - orange/amber border to distinguish from viewing (green) */
.combo-dropdown-item.active-playlist {
    border-left: 3px solid #f59e0b;
    padding-left: 9px; /* Adjust for border */
}

/* Quick Links */
#quick-links-container {
    margin-top: 0.5rem;
    padding-top: 0;
}

#quick-links-container h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-link-item {
    background-color: #2a2a2a;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-link-item:hover {
    background-color: #333;
}

.quick-link-item.active {
    background-color: #1DB954; /* A nice green to indicate active state */
    color: #fff;
}

.quick-link-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.quick-link-emoji {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.quick-link-item.active-playlist {
    border: 2px solid #f59e0b; /* Orange/amber for active playlist - distinct from green viewing highlight */
    padding: 6px 8px; /* Adjust padding since border adds 2px */
}

#clear-quick-links {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

/* Main Content Area */
#main-content {
    display: flex;
    flex-direction: column; /* Mobile-first: top-bottom */
    padding-top: 60px; /* Space for the fixed dashboard */
    height: 100vh; /* Fill viewport */
    overflow: hidden; /* Children handle their own scrolling */
}

#track-viewer {
    padding: 1rem 2rem;
    width: 100%;
    box-sizing: border-box;
    flex: 1; /* Takes available space when detail pane is hidden */
    overflow-y: auto; /* Scroll independently */
    transition: flex 0.3s ease-in-out;
}

/* When detail pane is visible on mobile, shrink track viewer */
#main-content.detail-open #track-viewer {
    flex: 0 0 40vh; /* Fixed height when detail pane is open */
}

.track-viewer-full {
    padding: 1rem 2rem;
}

.track-item {
    border-bottom: 1px solid #2a2a2a;
    border-left: 3px solid transparent;
    padding: 12px 0 12px 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.track-item.viewing-track {
    background-color: rgba(29, 185, 84, 0.1);
}

.track-item.playing-track {
    border-left-color: #1db954;
}

.track-item.now-playing {
    background-color: rgba(29, 185, 84, 0.08);
    border-left-color: #1db954;
}

.track-item.selected {
    background-color: rgba(29, 185, 84, 0.15);
}

.track-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    margin-right: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid #888;
    border-radius: 3px;
    transition: all 0.2s;
    position: relative;
}

.track-checkbox:hover {
    border-color: #1db954;
    background-color: rgba(29, 185, 84, 0.1);
}

.track-checkbox:checked {
    background-color: #1db954;
    border-color: #1db954;
}

.track-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: bold;
}

.track-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Title row: title + artist on one line with ellipsis */
.track-title-row {
    display: flex;
    align-items: baseline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.track-title-row .title {
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-title-row .artists {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Actions row: buttons on their own line */
.track-actions-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.track-actions-row .play-icon,
.track-actions-row .download-icon,
.track-actions-row .add-to-playlist-icon,
.track-actions-row .remove-icon {
    margin-left: 0;
}

.track-item .title {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
}

.track-item a.title {
    color: #fff;
    text-decoration: none;
}
.track-item a.title:hover {
    text-decoration: underline;
}

.track-item .artists {
    font-size: 0.9rem;
    color: #b3b3b3;
}

.track-item > div:first-child {
    display: flex;
    align-items: center;
}

.download-indicator {
    color: #1db954;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
}

.download-indicator svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.download-icon {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    user-select: none;
}

.download-icon.downloaded {
    color: #1db954;
}

.download-icon.downloadable {
    color: #888;
    transition: color 0.2s;
}

.download-icon.downloadable:hover {
    color: #1db954;
}

.download-icon.downloading {
    color: #ffa500;
    animation: spin 1s linear infinite;
}

.download-icon.download-failed {
    color: #ff4444;
    transition: color 0.2s;
}

.download-icon.download-failed:hover {
    color: #ff6666;
}

.play-icon {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    user-select: none;
    color: #1db954;
    transition: all 0.2s;
}

.play-icon:hover {
    color: #1ed760;
    transform: scale(1.1);
}

.play-icon.playing {
    color: #ffa500;
}

.add-to-playlist-container {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.add-to-playlist-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #888;
    transition: all 0.2s;
    user-select: none;
    width: 22px;
    height: 24px;
    border-radius: 4px 0 0 4px;
    background-color: rgba(255, 255, 255, 0.05);
}

.add-to-playlist-dropdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #888;
    transition: all 0.2s;
    user-select: none;
    width: 14px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.add-to-playlist-icon:hover,
.add-to-playlist-dropdown:hover {
    color: #1db954;
    background-color: rgba(29, 185, 84, 0.1);
}

/* State: Disabled (non-local playlists) */
.add-to-playlist-icon.disabled {
    color: #555;
    background-color: rgba(255, 255, 255, 0.02);
    cursor: not-allowed !important;
}

.add-to-playlist-icon.disabled:hover {
    color: #555;
    background-color: rgba(255, 255, 255, 0.02);
}

/* Keep dropdown functional even when quick-add is disabled */
.add-to-playlist-container .add-to-playlist-dropdown {
    cursor: pointer !important;
}

.add-to-playlist-container .add-to-playlist-dropdown:hover {
    color: #1db954 !important;
    background-color: rgba(29, 185, 84, 0.1) !important;
}

/* State: Already in active playlist */
.add-to-playlist-icon.in-playlist {
    color: #1db954;
    background-color: rgba(29, 185, 84, 0.2);
}

/* State: Just added (visual feedback) */
.add-to-playlist-icon.added {
    color: #1db954;
    background-color: #1db954;
    animation: flash-green 0.5s ease-in-out;
}

/* State: Already added (visual feedback) */
.add-to-playlist-icon.already-added {
    color: #ffa500;
    background-color: rgba(255, 165, 0, 0.3);
    animation: flash-orange 0.5s ease-in-out;
}

/* State: Error (visual feedback) */
.add-to-playlist-icon.error {
    color: #ff4444;
    background-color: rgba(255, 68, 68, 0.3);
    animation: flash-red 0.5s ease-in-out;
}

@keyframes flash-green {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes flash-orange {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes flash-red {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Large variants for detail pane */
.add-to-playlist-container.large,
.add-to-playlist-container-large .add-to-playlist-container {
    margin-left: 0;
}

.add-to-playlist-container.large .add-to-playlist-icon,
.add-to-playlist-container-large .add-to-playlist-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
}

.add-to-playlist-container.large .add-to-playlist-dropdown,
.add-to-playlist-container-large .add-to-playlist-dropdown {
    font-size: 14px;
    width: 20px;
    height: 36px;
}

.remove-from-playlist-icon {
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #888;
    transition: color 0.2s;
    user-select: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
}

.remove-from-playlist-icon:hover {
    color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.track-item .isrc-code {
    font-size: 0.75rem;
    color: #666;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    margin-top: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* Source icons (Shazam, Deezer, Spotify, Beatport) */
.source-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    opacity: 0.8;
}

.source-icon:hover {
    opacity: 1;
}

/* Track metadata (BPM, Key) */
.track-metadata {
    color: #888;
    font-size: 0.85em;
    font-family: inherit;
}

.track-age {
    color: #888;
    font-size: 0.85em;
}

/* Remove icon for local playlists */
.remove-icon {
    font-size: 1.2rem;
    color: #666;
    padding: 0 4px;
    transition: color 0.2s;
}

.remove-icon:hover {
    color: #ff4444;
}

/* Detail Pane */
.detail-pane {
    background-color: #1e1e1e;
    border-top: 1px solid transparent;
    overflow: hidden;
    padding: 0 2rem;
    box-sizing: border-box;
    flex: 0 0 0; /* Hidden by default */
    max-height: 0;
    opacity: 0;
    transition: flex 0.3s ease-in-out, max-height 0.3s ease-in-out, opacity 0.2s ease-in-out, padding 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.detail-pane.visible {
    flex: 0 0 calc(60vh - 60px); /* Takes 60vh minus header when visible */
    max-height: calc(60vh - 60px);
    opacity: 1;
    padding: 1rem 2rem;
    border-top-color: #333;
    overflow-y: auto;
}

/* Close button for the detail pane */
.close-pane-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(51, 51, 51, 0.9);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 10; /* Ensure it's above other content in the pane */
    display: block; /* Visible on mobile by default */
}

.close-pane-btn:hover {
    background: rgba(255, 68, 68, 0.9);
}

/* Track Detail View */
.track-detail-view {
    position: relative; /* For close button positioning */
    max-width: 800px;
    margin: 0 auto;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    padding: 1rem;
    padding-top: 2.5rem; /* Extra space for close button */
    border-radius: 8px;
}

.track-detail-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.track-detail-cover {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.track-detail-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.track-detail-header h3 {
    font-size: 1rem;
    font-weight: 400;
    color: #b3b3b3;
    margin: 0;
}

/* Genre tags - now below action buttons */
.track-detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.genre-tag {
    display: inline-block;
    background-color: #2a2a2a;
    color: #1db954;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #333;
}

.track-detail-info {
    background-color: #2a2a2a;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.track-detail-info h4 {
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.track-detail-info p {
    margin: 0.5rem 0;
    color: #b3b3b3;
}

.track-detail-info p strong {
    color: #fff;
}

.track-audio-player {
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.track-detail-lyrics h4 {
    font-size: 1.2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
}

.lyrics-content {
    line-height: 1.6;
    color: #b3b3b3;
}

/* Download Queue Panel */
.download-queue-panel {
    position: fixed;
    top: 60px;
    right: -400px;
    width: 400px;
    height: calc(100vh - 60px);
    background-color: #1e1e1e;
    border-left: 1px solid #333;
    transition: right 0.3s ease-in-out;
    z-index: 98;
    display: flex;
    flex-direction: column;
}

.download-queue-panel.open {
    right: 0;
}

.download-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #333;
}

.download-queue-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
}

.download-queue-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.download-queue-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #2a2a2a;
    background-color: transparent;
    text-align: center;
}

.download-queue-footer span {
    font-size: 0.75rem;
    color: #999;
}

.queue-section {
    margin-bottom: 2rem;
}

.queue-section h3 {
    font-size: 1rem;
    color: #b3b3b3;
    margin-top: 0;
    margin-bottom: 1rem;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-item {
    background-color: #2a2a2a;
    padding: 12px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.download-item-title {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
    flex: 1;
}

.download-item-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.download-item-status.pending {
    background-color: #555;
    color: #b3b3b3;
}

.download-item-status.downloading {
    background-color: #1db954;
    color: #fff;
}

.download-item-status.failed {
    background-color: #e22134;
    color: #fff;
}

.download-item-artist {
    font-size: 0.8rem;
    color: #b3b3b3;
}

.download-item-error {
    font-size: 0.75rem;
    color: #e22134;
    margin-top: 4px;
    margin-bottom: 4px;
}

.error-details-toggle {
    background: none;
    border: 1px solid #555;
    color: #999;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-top: 4px;
    margin-bottom: 4px;
}

.error-details-toggle:hover {
    background-color: #333;
    color: #fff;
}

.error-details {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px;
    margin-top: 4px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    max-height: 200px;
    overflow-y: auto;
}

.error-details pre {
    margin: 4px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #ccc;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
}

.error-stderr {
    margin-bottom: 8px;
}

.error-stderr strong,
.error-stdout strong {
    color: #e22134;
    font-size: 0.75rem;
}

.download-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.retry-btn {
    background-color: #1db954;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    flex: 1;
}

.retry-btn:hover:not(:disabled) {
    background-color: #1ed760;
}

.retry-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.remove-btn {
    background: none;
    color: #b3b3b3;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.remove-btn:hover:not(:disabled) {
    background-color: #333;
    color: #fff;
    border-color: #666;
}

.remove-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.download-list:empty::after {
    content: "No downloads";
    display: block;
    text-align: center;
    color: #666;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Mobile adjustments for download queue */
@media (max-width: 600px) {
    .download-queue-panel {
        width: 100%;
        right: -100%;
    }
}

/* Desktop Layout */
@media (min-width: 1024px) {
    /* Side menus push content instead of overlaying */
    .side-menu {
        position: fixed;
        left: -300px;
        box-shadow: none;
        border-right: 1px solid #333;
    }

    .side-menu.open {
        left: 0;
    }

    .right-menu {
        position: fixed;
        right: -300px;
        box-shadow: none;
        border-left: 1px solid #333;
    }

    .right-menu.open {
        right: 0;
    }

    /* Main content shifts when menus open */
    #main-content {
        flex-direction: row;
        height: calc(100vh - 60px);
        margin-left: 0;
        margin-right: 0;
        transition: margin-left 0.3s ease-in-out, margin-right 0.3s ease-in-out;
    }

    /* When left menu is open, shift content right */
    .side-menu.open ~ #main-content {
        margin-left: 300px;
    }

    /* When right menu is open, shift content left */
    .right-menu.open ~ #main-content {
        margin-right: 300px;
    }

    /* Reset mobile detail-open behavior for desktop */
    #main-content.detail-open #track-viewer {
        flex: 0 0 50%;
    }

    #track-viewer {
        width: 50%;
        flex: 0 0 50%;
        overflow-y: auto;
        height: calc(100vh - 60px);
    }

    .detail-pane {
        /* Reset mobile flex styles for desktop */
        flex: 0 0 0;
        max-height: none;
        opacity: 1;
        border-top: none;
        padding: 0;
        overflow: hidden;
    }

    .detail-pane.visible {
        /* Apply desktop styles */
        flex: 0 0 50%;
        width: 50%;
        height: 100%;
        max-height: none;
        overflow-y: auto;
        border-left: 1px solid #333;
        background-color: transparent;
        padding: 1rem 2rem;
    }

    /* Ensure body scroll lock doesn't apply to desktop */
    .body-scroll-locked {
        overflow: auto;
    }

    .track-detail-top {
        flex-direction: row;
        align-items: flex-end;
        text-align: left;
    }

    .track-detail-header {
        text-align: left;
    }

    /* Hide close button on desktop - menus stay open */
    .close-pane-btn {
        display: none;
    }
}

/* Now Playing Player in Side Menu */
.now-playing-player,
.now-playing-player-compact {
    padding: 0;
}

.now-playing-player h4 {
    margin-top: 0;
    color: #fff;
}

.now-playing-player .player-content,
.now-playing-player-compact .player-content {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.now-playing-player .player-cover-art,
.now-playing-player-compact .player-cover-art {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.now-playing-player .player-track-info,
.now-playing-player-compact .player-track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.now-playing-player .player-title,
.now-playing-player-compact .player-title {
    font-weight: 500;
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-player .player-artist,
.now-playing-player-compact .player-artist {
    font-size: 0.8rem;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-player .player-isrc,
.now-playing-player-compact .player-isrc {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

.now-playing-player .player-isrc a,
.now-playing-player-compact .player-isrc a {
    color: #666;
    text-decoration: none;
}

.now-playing-player .player-isrc a:hover,
.now-playing-player-compact .player-isrc a:hover {
    color: #1db954;
    text-decoration: underline;
}

.now-playing-player .player-audio,
.now-playing-player-compact .player-audio {
    width: 100%;
    height: 32px;
}

.now-playing-player .player-controls,
.now-playing-player-compact .player-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.player-control-btn {
    background: #252525;
    border: 1px solid #333;
    color: #1db954;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.player-control-btn:hover:not(:disabled) {
    background: #333;
    color: #1ed760;
    transform: scale(1.05);
}

.player-control-btn:disabled {
    cursor: not-allowed;
    color: #555;
}

.player-control-btn.play-pause {
    font-size: 1.4rem;
    padding: 0.5rem 1.2rem;
}

.player-controls-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.volume-icon {
    font-size: 0.9rem;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
}

.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1db954;
    cursor: pointer;
    transition: transform 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1db954;
    cursor: pointer;
    border: none;
}

.track-detail-actions {
    margin-bottom: 2rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.download-icon-large {
    font-size: 2rem;
    user-select: none;
}

.download-icon-large.downloaded {
    color: #1db954;
}

.download-icon-large.downloadable {
    color: #888;
    transition: color 0.2s;
}

.download-icon-large.downloadable:hover {
    color: #1db954;
}

.download-icon-large.downloading {
    color: #ffa500;
    animation: spin 1s linear infinite;
}

.download-icon-large.download-failed {
    color: #ff4444;
    transition: color 0.2s;
}

.download-icon-large.download-failed:hover {
    color: #ff6666;
}

.refresh-icon {
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.refresh-icon:hover {
    color: #1db954;
    transform: rotate(90deg);
}

.refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

.track-info-icons-container {
    display: flex;
    justify-content: flex-end;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.track-info-icons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-icon {
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.save-icon:hover {
    color: #3b82f6;
    transform: translateY(-2px);
}

.track-detail-error {
    padding: 2rem;
    text-align: center;
}

.track-detail-error h3 {
    color: #ff4444;
    margin-bottom: 1rem;
}

.track-detail-error p {
    color: #b3b3b3;
    margin: 0.5rem 0;
}

.track-detail-error .error-message {
    font-size: 0.875rem;
    color: #888;
}



.play-button {

    background-color: #1db954;

    color: #fff;

    border: none;

    padding: 12px 24px;

    border-radius: 50px;

    font-size: 1rem;

    font-weight: bold;

    cursor: pointer;

    transition: background-color 0.2s;

}



.play-button:hover:not(:disabled) {

    background-color: #1ed760;

}



.play-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.download-to-computer-btn {
    background-color: #3b82f6;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.download-to-computer-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.download-to-computer-btn:active {
    transform: translateY(0);
}

/* === Playlist Management UI === */

/* Current Playlist Indicator in Top Bar */
.current-playlist-indicator {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#current-playlist-name {
    font-size: 1.2rem;
    font-weight: 400;
    color: #fff;
    cursor: pointer;
}

/* Playlist Top Controls */
.playlist-top-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 1rem;
}

.top-control-btn {
    background-color: #1db954;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.top-control-btn:hover {
    background-color: #1ed760;
}

.top-control-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

.toggle-label {
    color: #fff;
    font-size: 0.9rem;
}

/* Toggle Switch (for both top bar and side menu) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #1db954;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* Playlist Details Section */
.playlist-details {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #252525;
    border-radius: 8px;
}

.playlist-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
    color: #fff;
    font-size: 1.1rem;
}

.collapse-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-btn:hover {
    background-color: #333;
    border-radius: 4px;
}

.playlist-details-content.collapsed {
    display: none;
}

.playlist-name-input,
.playlist-description-input {
    width: 100%;
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 8px;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}

.playlist-name-input {
    font-size: 1rem;
    font-weight: 500;
}

.playlist-description-input {
    min-height: 60px;
    resize: vertical;
    font-size: 0.9rem;
}

.playlist-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #1e1e1e;
    border-radius: 4px;
}

.playlist-actions span {
    color: #e0e0e0;
    font-size: 0.9rem;
}

.section-header {
    margin: 1.5rem 0 0.75rem 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

/* Sync Targets Container */
.sync-targets-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.sync-targets-grid {
    width: 100%;
}

.no-syncs-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Sync Grid Table */
.sync-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background-color: #1e1e1e;
    border-radius: 4px;
    overflow: hidden;
}

.sync-grid-table thead {
    background-color: #2a2a2a;
    color: #fff;
}

.sync-grid-table th {
    padding: 8px 6px;
    text-align: center;
    font-weight: 500;
    border-bottom: 2px solid #444;
}

.sync-grid-table th:first-child,
.sync-grid-table td:first-child {
    text-align: left;
    padding-left: 10px;
}

.sync-grid-table tr.subheader th {
    font-size: 0.75rem;
    color: #aaa;
    padding: 4px 6px;
    font-weight: 400;
}

.sync-grid-table tbody tr {
    border-bottom: 1px solid #333;
}

.sync-grid-table tbody tr:hover {
    background-color: #252525;
}

.sync-grid-table td {
    padding: 10px 6px;
    text-align: center;
}

.sync-id-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.8rem;
    color: #aaa;
}

.sync-grid-table input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #1db954;
}

.delete-sync-btn {
    background-color: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.2s;
}

.delete-sync-btn:hover {
    background-color: #f44336;
}

/* Playlist Management Buttons */
.add-sync-btn {
    width: 100%;
    background-color: #333;
    color: #1db954;
    border: 1px solid #1db954;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.add-sync-btn:hover {
    background-color: #1db954;
    color: #fff;
}

.playlist-management-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.playlist-management-actions button {
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    border: none;
    transition: background-color 0.2s;
}

.primary-btn {
    background-color: #1db954;
    color: #fff;
}

.primary-btn:hover {
    background-color: #1ed760;
}

.secondary-btn {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

.secondary-btn:hover {
    background-color: #444;
}

.delete-button {
    background-color: #d32f2f;
    color: #fff;
}

.delete-button:hover {
    background-color: #f44336;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .playlist-top-controls {
        gap: 0.5rem;
    }

    .top-control-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .toggle-label {
        display: none; /* Hide label on mobile to save space */
    }

    .sync-grid-table {
        font-size: 0.75rem;
    }

    .sync-grid-table th,
    .sync-grid-table td {
        padding: 6px 4px;
    }
}
/* Sync Management Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1a1a1a;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #333;
}

.modal-btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid #555;
    background-color: #252525;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.modal-btn:hover {
    background-color: #333;
}

.modal-btn.primary {
    background-color: #1db954;
    border-color: #1db954;
}

.modal-btn.primary:hover {
    background-color: #1ed760;
}

.modal-btn-primary {
    background-color: #1db954;
    border-color: #1db954;
}

.modal-btn-primary:hover {
    background-color: #1ed760;
}

.modal-btn.danger-btn {
    background-color: #dc2626;
    border-color: #dc2626;
}

.modal-btn.danger-btn:hover {
    background-color: #ef4444;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: background-color 0.2s;
    margin: 0.5rem 0;
}

.settings-label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.settings-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #2a2a2a;
    border: 2px solid #555;
    border-radius: 3px;
    transition: all 0.2s;
    position: relative;
}

.settings-label input[type="checkbox"]:hover {
    border-color: #1db954;
    background-color: rgba(29, 185, 84, 0.1);
}

.settings-label input[type="checkbox"]:checked {
    background-color: #1db954;
    border-color: #1db954;
}

.settings-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.settings-label input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-label span {
    color: #e0e0e0;
}

.settings-description {
    font-size: 0.85rem;
    color: #999;
    margin: 0;
    padding-left: 2rem;
}

.sync-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sync-item {
    background-color: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem;
}

.sync-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sync-item-title {
    font-weight: 500;
    color: #fff;
}

.remove-sync-btn {
    background: none;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-sync-btn:hover {
    background-color: rgba(255, 68, 68, 0.1);
}

.sync-item-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    color: #bbb;
}

.form-group input,
.form-group select {
    padding: 0.5rem;
    background-color: #1a1a1a;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1db954;
}

.sync-controls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.sync-control-group {
    margin-bottom: 0.75rem;
}

.sync-control-group h4 {
    font-size: 0.9rem;
    color: #fff;
    margin: 0 0 0.5rem 0;
}

/* Section toggle (Pull/Push header with checkbox) */
.sync-section-toggle {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.sync-section-toggle span {
    color: #fff;
}

/* Collapsible options container */
.sync-pull-options,
.sync-push-options {
    padding-left: 1.25rem;
    border-left: 2px solid #333;
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #bbb;
    cursor: pointer;
}

.sync-limit-section {
    margin-top: 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid #333;
}

.sync-limit-section h5 {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.add-sync-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #252525;
    border: 2px dashed #555;
    color: #999;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.add-sync-btn:hover {
    border-color: #1db954;
    color: #1db954;
}

/* Sync Playlist Search Dropdown */
.sync-playlist-search-wrapper {
    position: relative;
    flex: 1;
}

.sync-playlist-search {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
}

.sync-playlist-search:focus {
    outline: none;
    border-color: #1db954;
    border-radius: 4px 4px 0 0;
    cursor: text;
}

.sync-playlist-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #1db954;
    border-top: none;
    border-radius: 0 0 4px 4px;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin: 0;
    padding: 0;
}

.sync-playlist-dropdown.show {
    display: block;
}

.sync-playlist-dropdown-item {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.sync-playlist-dropdown-item:hover {
    background-color: #1db954;
}

/* Auto-Sync Section */
.sync-auto-sync {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: rgba(29, 185, 84, 0.05);
    border: 1px solid rgba(29, 185, 84, 0.2);
    border-radius: 6px;
}

.sync-auto-sync .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-sync-hint {
    font-size: 0.75rem;
    color: #888;
    margin-left: 0.5rem;
}

/* Dialog Modal Specific Styles */
.dialog-modal-content {
    max-width: 500px;
}

.dialog-input {
    width: 100%;
    padding: 0.75rem;
    background-color: #1a1a1a;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 1rem;
    box-sizing: border-box;
}

.dialog-input:focus {
    outline: none;
    border-color: #1db954;
}

#dialog-message {
    margin: 0;
    color: #e0e0e0;
    line-height: 1.5;
}

/* Playlist Selector Modal Styles */
.playlist-selector-list {
    max-height: 400px;
    overflow-y: auto;
}

.playlist-selector-item {
    padding: 1rem;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.playlist-selector-item:hover {
    background-color: rgba(29, 185, 84, 0.1);
}

.playlist-selector-item.last-selected {
    background-color: rgba(29, 185, 84, 0.15);
    border-left: 3px solid #1db954;
}

.playlist-selector-item:last-child {
    border-bottom: none;
}

.playlist-selector-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.playlist-selector-info {
    flex: 1;
}

.playlist-selector-name {
    color: #fff;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.playlist-selector-meta {
    font-size: 0.8rem;
    color: #999;
}

/* Export/Import Modal Styles */
.export-format-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.export-format-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-format-option:hover {
    border-color: #555;
    background-color: #1f1f1f;
}

.export-format-option input[type="radio"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.export-format-option input[type="radio"]:checked + .format-details {
    color: #1db954;
}

.export-format-option:has(input[type="radio"]:checked) {
    border-color: #1db954;
    background-color: #0d1f14;
}

.format-details strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.format-details p {
    font-size: 0.85rem;
    color: #999;
    margin: 0;
    line-height: 1.4;
}

.export-info {
    font-size: 0.85rem;
    color: #999;
    margin: 1rem 0 0 0;
    font-style: italic;
}

/* Import Destination Options */
.import-destination-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.import-destination-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.import-destination-option:hover {
    border-color: #555;
    background-color: #1f1f1f;
}

.import-destination-option input[type="radio"] {
    cursor: pointer;
}

.import-destination-option:has(input[type="radio"]:checked) {
    border-color: #1db954;
    background-color: #0d1f14;
}

.import-destination-option span {
    color: #fff;
    font-size: 0.95rem;
}

.file-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed #555;
    border-radius: 6px;
    background-color: #1f1f1f;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.file-input:hover {
    border-color: #1db954;
    background-color: #0d1f14;
}

.file-input::-webkit-file-upload-button {
    padding: 0.5rem 1rem;
    border: none;
    background-color: #1db954;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.file-input::-webkit-file-upload-button:hover {
    background-color: #1ed760;
}

/* Collapsible Section Styles */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.collapsible-header:hover {
    color: #1db954;
}

.collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.collapsible-header.expanded .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    max-height: 0;
}

.collapsible-content.expanded {
    opacity: 1;
    max-height: 500px;
}

.settings-description {
    font-size: 0.75rem;
    color: #999;
    margin: 0.5rem 0 0 0;
    line-height: 1.3;
}

/* Compact Menu Section Styles */
.side-menu-section.compact {
    margin: 0.75rem 0;
    padding: 0.75rem;
}

.side-menu-section.compact h4 {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.side-menu-btn.compact {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

/* Button Row - horizontal layout for paired buttons */
.btn-row {
    display: flex;
    gap: 0.5rem;
    margin: 0.25rem 0;
}

.side-menu-btn.half {
    flex: 1;
    min-width: 0;
}

/* Active Toggle in right menu */
.settings-label.active-toggle {
    background-color: rgba(29, 185, 84, 0.08);
    border: 1px solid rgba(29, 185, 84, 0.2);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.settings-label.active-toggle.is-active {
    background-color: rgba(29, 185, 84, 0.2);
    border-color: #1db954;
}

/* Playlist Details in right menu */
.playlist-details {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.playlist-details-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.playlist-details-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.playlist-details-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.playlist-details-sync {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.playlist-details-sync .sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.playlist-details-sync .sync-indicator.active {
    background-color: #1db954;
}

.playlist-details-sync .sync-indicator.error {
    background-color: #e74c3c;
}

/* Filter container compact variant */
.playlist-filter-container.compact .filter-input {
    padding: 8px 30px 8px 8px;
    font-size: 0.9rem;
}

.playlist-filter-container.compact .filter-stats {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Downloads section header badge */
.downloads-total-badge {
    color: #666;
    font-size: 0.75rem;
    font-weight: normal;
}

/* Queue section compact headers */
#download-queue-list h5 {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

/* Mobile optimizations for menus */
@media (max-width: 768px) {
    .side-menu {
        padding: 0.5rem;
    }

    .right-menu {
        padding: 0.5rem;
    }

    .side-menu-section {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }

    .side-menu-section.compact {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }

    .side-menu-btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .side-menu-btn.compact {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }

    .collapsible-header {
        padding: 0.25rem 0;
    }

    .profile-header {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .profile-avatar {
        width: 40px;
        height: 40px;
    }

    .profile-name {
        font-size: 0.9rem;
    }

    .linked-account-item {
        padding: 0.4rem;
        margin: 0.3rem 0;
    }

    .quick-link-item {
        padding: 6px 8px;
        margin-bottom: 3px;
        font-size: 0.8rem;
    }

    .new-playlist-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }

    .search-input {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .filter-input {
        padding: 8px 30px 8px 8px;
        font-size: 0.85rem;
    }

    /* Mobile track display improvements */
    .track-item {
        padding: 10px 0 10px 8px;
    }

    .track-content {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Title row on mobile */
    .track-title-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: baseline;
        min-width: 0;
    }

    .track-title-row .title {
        font-size: 0.95rem;
    }

    .track-title-row .artists {
        font-size: 0.85rem;
    }

    /* Action icons - all on their own line */
    .track-actions-row .play-icon,
    .track-actions-row .download-icon,
    .track-actions-row .add-to-playlist-icon,
    .track-actions-row .remove-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 12px;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.06);
        border-radius: 4px;
        min-width: 36px;
    }

    .track-actions-row .play-icon:hover,
    .track-actions-row .download-icon:hover,
    .track-actions-row .add-to-playlist-icon:hover,
    .track-actions-row .remove-icon:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    /* For Deezer renderer that uses track-title-row / track-actions-row */
    .track-title-row {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }

    .track-title-row .title {
        font-size: 0.95rem;
    }

    .track-title-row .artists {
        font-size: 0.85rem;
        flex: 1 1 100%;
    }

    .track-actions-row {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        margin-top: 4px;
    }

    .track-actions-row .play-icon,
    .track-actions-row .download-icon,
    .track-actions-row .add-to-playlist-icon,
    .track-actions-row .remove-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 12px;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.06);
        border-radius: 4px;
        min-width: 36px;
    }

    .track-actions-row .play-icon:hover,
    .track-actions-row .download-icon:hover,
    .track-actions-row .add-to-playlist-icon:hover,
    .track-actions-row .remove-icon:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    /* Metadata row - compact */
    .track-item .isrc-code {
        font-size: 0.7rem;
        opacity: 0.8;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: center;
    }

    .track-item .source-icon {
        width: 12px !important;
        height: 12px !important;
    }
}
