/* ============================================
   MUSIC PLAYER v2.0 — STYLESHEET
   Optimized, modular, maintainable
   ============================================ */

/* ─── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    /* Brand colors */
    --primary: #dc3545;
    --primary-dark: #c82333;
    --primary-light: #ff7788;
    --success: #28a745;
    --success-dark: #1e7e34;
    --info: #17a2b8;
    --warning: #ffc107;
    --warning-dark: #ff9800;
    
    /* Neutrals */
    --bg-body: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-alt: #2d2d2d;
    --bg-input: #222;
    --border: #333;
    --border-hover: #444;
    
    /* Text */
    --text-primary: #fff;
    --text-secondary: #ddd;
    --text-muted: #888;
    --text-dim: #666;
    --text-placeholder: #444;
    
    /* Sizing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 15px;
    --radius-full: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(220, 53, 69, 0.2);
    --shadow-primary: 0 4px 15px rgba(220, 53, 69, 0.3);
    
    /* Transitions */
    --trans-fast: 0.2s ease;
    --trans-normal: 0.3s ease;
    --trans-slow: 0.5s ease;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: block;
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text-secondary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    transition: background-color 1.5s ease;
    background-image: 
        radial-gradient(circle at top right, rgba(220, 53, 69, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(0, 123, 255, 0.05), transparent 40%);
}

body.custom-bg {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.custom-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
}

/* ─── Scrollbars ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--trans-normal);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: linear-gradient(135deg, #555 0%, #444 100%);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

button.active {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

button.active:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838 0%, #1ba87d 100%);
}

button.loop-one {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-body) 100%);
    border-right: 2px solid var(--primary);
    z-index: 9000;
    transition: width var(--trans-normal);
    overflow: hidden;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
}

#sidebar.collapsed {
    width: 70px;
}

.sidebar-toggle {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--trans-normal);
    text-align: center;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.sidebar-toggle:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
    box-shadow: none !important;
}

.sidebar-content {
    padding: 10px 0;
    overflow-y: auto;
    height: calc(100vh - 70px);
}

.sidebar-btn {
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--trans-normal);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    white-space: nowrap;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.sidebar-btn:hover:not(:disabled) {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: var(--primary);
    transform: none !important;
    box-shadow: none !important;
}

.sidebar-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sidebar-btn.active {
    background: rgba(40, 167, 69, 0.2);
    border-left-color: var(--success);
    box-shadow: none !important;
}

.sidebar-icon {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

.sidebar-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1;
    transition: opacity var(--trans-fast);
}

#sidebar.collapsed .sidebar-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

#sidebar.collapsed .sidebar-btn {
    justify-content: center;
    padding: 15px;
}

/* ─── Main Content ─────────────────────────────────────────────────────────── */
#main-content {
    margin-left: 280px;
    transition: margin-left var(--trans-normal);
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sidebar.collapsed + #main-content {
    margin-left: 70px;
}

/* ─── Metadata Display ────────────────────────────────────────────────────── */
#metadata-container {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
    width: 90%;
    max-width: 800px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    padding: 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: background var(--trans-slow), box-shadow var(--trans-slow);
}

#cover-art-container {
    width: 180px;
    height: 180px;
    min-width: 180px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

#cover-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

#cover-art.loaded {
    display: block;
}

#cover-placeholder {
    font-size: 4em;
    color: var(--text-placeholder);
}

#info-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#info-details .label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

#info-details .value {
    color: var(--text-primary);
    font-size: 1.2em;
    margin-bottom: 8px;
    font-weight: 600;
}

/* ─── Playback Controls ───────────────────────────────────────────────────── */
#playback-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    width: 90%;
    max-width: 600px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all var(--trans-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-primary);
    padding: 0;
    text-transform: none;
    letter-spacing: 0;
}

.control-btn-play {
    width: 80px;
    height: 80px;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.6);
}

.control-btn:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.control-icon {
    font-size: 24px;
}

.control-btn-play .control-icon {
    font-size: 32px;
}

.control-label {
    display: none;
}

#loop-button {
    width: auto;
    padding: 0 20px;
    border-radius: 30px;
    gap: 8px;
}

#loop-button .control-label {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ─── File Controls ───────────────────────────────────────────────────────── */
#file-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    width: 90%;
    max-width: 800px;
}

#folder-button {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#folder-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #34ce57 0%, var(--success) 100%);
}

#folder-button.active {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
}

#auto-lyrics-btn {
    background: linear-gradient(135deg, var(--info) 0%, #138496 100%);
}

#auto-lyrics-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1fc8e3 0%, var(--info) 100%);
}

#deep-analysis-btn {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

#deep-analysis-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7952cc 0%, #6f42c1 100%);
}

/* ─── Progress Bar ────────────────────────────────────────────────────────── */
#custom-progress-container {
    width: 90%;
    max-width: 800px;
    margin-bottom: 15px;
    background: var(--bg-input);
    height: 8px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
}

#time-display {
    width: 90%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* ─── Volume Control ──────────────────────────────────────────────────────── */
#volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    width: 90%;
    max-width: 800px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

#volume-icon {
    font-size: 1.5em;
    min-width: 30px;
    text-align: center;
    cursor: pointer;
    transition: transform var(--trans-fast);
}

#volume-icon:hover {
    transform: scale(1.1);
}

#volume-slider {
    flex: 1;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--trans-fast);
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6);
}

#volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: all var(--trans-fast);
}

#volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

#volume-percentage {
    color: var(--text-primary);
    font-weight: 600;
    min-width: 45px;
    text-align: right;
    font-size: 0.9em;
}

/* ─── Equalizer ───────────────────────────────────────────────────────────── */
#equalizer-control {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    width: 90%;
    max-width: 800px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.eq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.eq-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
}

.eq-preset-dropdown {
    padding: 6px 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.eq-preset-dropdown:hover,
.eq-preset-dropdown:focus {
    border-color: var(--primary);
}

.eq-bands {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 20px;
}

.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.eq-label {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eq-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    -webkit-appearance: none;
    width: 8px;
    height: 150px;
    background: var(--bg-input);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--trans-fast);
}

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

.eq-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm);
}

.eq-value {
    color: var(--text-primary);
    font-size: 0.8em;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    padding: 4px 8px;
    background: rgba(220, 53, 69, 0.2);
    border-radius: 4px;
}

/* ─── Playlist ────────────────────────────────────────────────────────────── */
#playlist-container {
    width: 90%;
    max-width: 800px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

#playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

#playlist-container h2 {
    color: var(--text-primary);
    font-size: 1.3em;
    margin: 0;
}

#playlist-status {
    font-style: italic;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.95em;
}

#playlist-search {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9em;
    outline: none;
}

#playlist-search:focus {
    border-color: var(--primary);
}

/* Playlist Toolbar */
.pl-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 2px solid var(--primary);
    gap: 10px;
    flex-wrap: wrap;
}

.pl-toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pl-tb-btn {
    padding: 8px 16px !important;
    font-size: 16px !important;
    min-width: 40px;
    height: 40px;
}

.pl-tb-select {
    padding: 8px 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.pl-tb-select:hover,
.pl-tb-select:focus {
    border-color: var(--primary);
}

.pl-count {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Playlist Items */
#playlist-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pl-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    min-height: 48px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--trans-normal);
    border: 2px solid transparent;
}

.pl-item:hover {
    background: #2a2a2a;
    border-color: var(--primary);
    transform: translateX(5px);
}

.pl-item.playing {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.13) 0%, transparent 100%);
    border-color: var(--primary);
}

.pl-item.selectable {
    cursor: pointer;
    user-select: none;
}

.pl-item.selected {
    background: rgba(40, 167, 69, 0.2) !important;
    border-color: var(--success) !important;
}

.pl-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.pl-item.drop-before {
    border-top: 3px solid var(--primary);
}

.pl-item.drop-after {
    border-bottom: 3px solid var(--primary);
}

.pl-checkbox {
    font-size: 20px;
    color: var(--text-dim);
    min-width: 30px;
    text-align: center;
}

.pl-item.selected .pl-checkbox {
    color: var(--success);
}

.pl-item.selected .pl-checkbox::before {
    content: '☑';
}

.pl-num {
    color: var(--text-dim);
    font-weight: bold;
    min-width: 30px;
    font-size: 0.9em;
}

.pl-item.playing .pl-num {
    color: var(--primary);
}

.pl-thumb {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pl-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.pl-placeholder {
    font-size: 1.5em;
    color: var(--text-placeholder);
}

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

.pl-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-artist {
    color: var(--text-muted);
    font-size: 0.85em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-album {
    color: var(--text-dim);
    font-size: 0.8em;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-badges {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.pl-badge {
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.pl-badge-lyrics {
    background: var(--success);
    color: white;
}

.pl-badge-meta {
    background: var(--primary);
    color: white;
}

.pl-badge-analysis {
    background: #6f42c1;
    color: white;
}

.pl-analysis {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.75em;
}

.pl-analysis span {
    background: rgba(220, 53, 69, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

.pl-duration {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

.pl-edit-btn {
    background: linear-gradient(135deg, var(--info) 0%, #138496 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-full) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    cursor: pointer;
    font-size: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-normal);
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 0 !important;
}

.pl-edit-btn:hover {
    transform: scale(1.1) !important;
}

.pl-menu-btn {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: none !important;
    border-radius: var(--radius-full) !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    cursor: pointer;
    font-size: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-normal);
    margin-left: 5px;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 0 !important;
}

.pl-menu-btn:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    color: var(--primary) !important;
    transform: scale(1.1) !important;
}

/* Selection Bar */
.pl-sel-bar {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success);
    border-radius: var(--radius-lg);
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.pl-sel-count {
    color: var(--success);
    font-weight: 600;
    margin-right: auto;
}

/* Context Menu */
.pl-ctx-menu {
    position: fixed;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    z-index: 10001;
    padding: 8px;
    min-width: 200px;
}

.pl-ctx-menu button {
    width: 100%;
    text-align: left;
    padding: 10px 15px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    transition: all var(--trans-fast);
    font-size: 14px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.pl-ctx-menu button:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    transform: translateX(5px) !important;
}

.pl-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
    font-style: italic;
}

/* ─── Lyrics Display ──────────────────────────────────────────────────────── */
#lyrics-display {
    position: relative;
    width: 90%;
    max-width: 800px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    text-align: center;
    margin-bottom: 25px;
}

.lyric-line {
    font-size: 1.8em;
    color: var(--text-dim);
    margin: 10px 0;
    transition: all var(--trans-normal);
    cursor: pointer;
    line-height: 1.4;
}

.lyric-line.active {
    color: var(--primary);
    font-size: 2em;
    font-weight: 700;
}

.lyrics-control-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.lyrics-control-panel button {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 16px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(220, 53, 69, 0.3);
    transition: all var(--trans-fast);
}

.lyrics-control-panel button:hover {
    background: rgba(220, 53, 69, 0.8);
    transform: scale(1.1);
}

.lyrics-control-panel button.active {
    background: rgba(40, 167, 69, 0.8);
    border-color: var(--success);
}

/* Lyrics Search Overlay */

.lyrics-control-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

/* Lyrics Search Overlay */
#lyrics-search-overlay {
    position: absolute;
    top: 60px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(220, 53, 69, 0.5);
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#lyrics-search-overlay.lyrics-search-hidden {
    display: none;
}

#lyrics-search-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(220, 53, 69, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

#lyrics-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.3);
}

#lyrics-search-results {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--trans-fast);
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-result-item:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: translateX(5px);
}

.search-result-time {
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    min-width: 50px;
}

.search-result-text {
    color: var(--text-primary);
    font-size: 14px;
}

.search-result-text mark {
    background: rgba(220, 53, 69, 0.4);
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: 3px;
}

.search-no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

#lyrics-search-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(220, 53, 69, 0.8);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
}

#lyrics-search-close:hover {
    background: var(--primary);
    transform: scale(1.1);
}

#export-lyrics-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 16px;
    font-size: 12px;
    background: linear-gradient(135deg, var(--info) 0%, #138496 100%);
    opacity: 0.8;
}

#export-lyrics-button:hover:not(:disabled) {
    opacity: 1;
}

/* Lyrics Export Menu */
.lyrics-export-menu {
    position: fixed;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.lyrics-export-menu button {
    width: 100%;
    text-align: left;
    padding: 10px 15px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.lyrics-export-menu button:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    transform: translateX(3px) !important;
}

/* Lyrics Display Size Modes */
#lyrics-display.lyrics-compact .lyric-line {
    font-size: 1.2em;
    margin: 6px 0;
}

#lyrics-display.lyrics-compact .lyric-line.active {
    font-size: 1.4em;
}

#lyrics-display.lyrics-large .lyric-line {
    font-size: 2.2em;
    margin: 15px 0;
}

#lyrics-display.lyrics-large .lyric-line.active {
    font-size: 2.5em;
}

/* Lyrics Settings Modal */
.lyrics-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyrics-settings-content {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.lyrics-settings-content h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.settings-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(220, 53, 69, 0.2);
}

.settings-group label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 14px;
}

.settings-group select,
.settings-group input[type="range"] {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    margin-top: 5px;
}

#smoothing-value {
    display: inline-block;
    margin-left: 10px;
    color: var(--primary);
    font-weight: 600;
}

/* Fullscreen Lyrics */
/* Pull the background canvas out of the flex flow so the lyrics content stays centered */
#fullscreen-lyrics-viz-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#fullscreen-lyrics {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10, 10, 10, 0.95) 0%, rgba(0, 0, 0, 1) 100%);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity var(--trans-normal);
}

#fullscreen-lyrics.show {
    display: flex;
}

#fullscreen-lyrics.fullscreen-lyrics-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.fullscreen-lyrics-content {
    position: relative;
    z-index: 2;
    width: 80%;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.fullscreen-lyrics-content::-webkit-scrollbar {
    width: 8px;
}

.fullscreen-lyrics-content::-webkit-scrollbar-track {
    background: transparent;
}

.fullscreen-lyrics-content::-webkit-scrollbar-thumb {
    background: rgba(220, 53, 69, 0.5);
    border-radius: 4px;
}

.fullscreen-lyric-line {
    font-size: 2em;
    color: rgba(255, 255, 255, 0.4);
    margin: 20px 0;
    transition: all var(--trans-normal);
    cursor: pointer;
    line-height: 1.6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.fullscreen-lyric-line.active {
    color: white;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.8), 0 2px 10px rgba(0, 0, 0, 0.9);
    animation: lyricPulse 2s ease-in-out infinite;
}

.fullscreen-lyrics-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 3;
    opacity: 0;
    transition: opacity var(--trans-normal);
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

#fullscreen-lyrics:hover .fullscreen-lyrics-controls {
    opacity: 1;
}

.fullscreen-lyrics-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(220, 53, 69, 0.8);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-normal);
    z-index: 3;
    backdrop-filter: blur(10px);
}

.fullscreen-lyrics-close:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* ─── Modals ──────────────────────────────────────────────────────────────── */
/* Folder History Modal */
#folder-history-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-history-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.folder-history-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    border: 2px solid var(--primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.folder-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--primary);
    background: var(--bg-card);
}

.folder-history-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--trans-fast);
}

.folder-history-close:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: rotate(90deg);
}

.folder-history-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.folder-history-current {
    background: rgba(40, 167, 69, 0.15);
    border: 2px solid var(--success);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.folder-history-current h3 {
    color: var(--success);
    margin: 0 0 15px 0;
    font-size: 1.1em;
}

.folder-history-item {
    background: rgba(40, 40, 40, 0.7);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px 20px;
    cursor: pointer;
    transition: all var(--trans-normal);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.folder-history-item:hover {
    border-color: var(--primary);
    background: rgba(220, 53, 69, 0.1);
    transform: translateX(5px);
}

.folder-item-name {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.folder-item-details {
    color: var(--text-muted);
    font-size: 0.85em;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Metadata Editor */
#metadata-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-normal);
}

#metadata-editor-modal.show {
    opacity: 1;
    pointer-events: all;
}

.metadata-editor-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.metadata-editor-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    border: 2px solid var(--primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.metadata-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--primary);
    background: var(--bg-card);
}

.metadata-editor-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--trans-fast);
}

.metadata-editor-close:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: rotate(90deg);
}

.metadata-editor-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.metadata-editor-body::-webkit-scrollbar {
    width: 8px;
}

.metadata-editor-body::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

.metadata-editor-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.metadata-editor-preview {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.metadata-preview-art {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metadata-preview-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.metadata-preview-placeholder {
    font-size: 2em;
    color: var(--text-placeholder);
}

.metadata-preview-info {
    flex: 1;
}

.metadata-preview-label {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-preview-value {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 600;
}

#metadata-editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metadata-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metadata-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.metadata-form-group label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95em;
}

.metadata-form-group input,
.metadata-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-input);
    border: 2px solid var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1em;
    outline: none;
}

.metadata-form-group input:focus,
.metadata-form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

.metadata-form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.metadata-form-group input::placeholder,
.metadata-form-group textarea::placeholder {
    color: var(--text-dim);
}

.metadata-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.metadata-form-actions button {
    flex: 1;
    padding: 14px 24px;
}

/* Custom Background Modal */
#custom-bg-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

#custom-bg-modal.show {
    display: flex;
}

.custom-bg-content {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
    padding: 30px;
    border-radius: var(--radius-xl);
    border: 2px solid var(--primary);
    max-width: 500px;
    width: 90%;
}

.custom-bg-content h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.custom-bg-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.custom-bg-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-lg);
    background: #000;
    display: none;
    object-fit: cover;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.custom-bg-preview.show {
    display: block;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    width: 100%;
    transition: background var(--trans-normal);
}

.toggle-container:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-container input[type="checkbox"] {
    appearance: none;
    width: 34px;
    height: 18px;
    background: var(--border-hover);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background var(--trans-normal);
    margin-right: 12px;
    flex-shrink: 0;
}

.toggle-container input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: var(--radius-full);
    top: 2px;
    left: 2px;
    transition: transform var(--trans-normal);
}

.toggle-container input[type="checkbox"]:checked {
    background: var(--success);
}

.toggle-container input[type="checkbox"]:checked::before {
    transform: translateX(16px);
}

/* ─── Debug Panel ─────────────────────────────────────────────────────────── */
#debug-panel {
    width: 90%;
    max-width: 800px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 15px;
    margin-top: 20px;
    border: 1px solid var(--border);
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #0f0;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

#debug-panel.visible {
    display: block;
}

/* ─── Drop Zone ───────────────────────────────────────────────────────────── */
#drop-zone {
    position: fixed;
    inset: 0;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    font-weight: bold;
    z-index: 1000;
    border: 5px dashed white;
    pointer-events: none;
}

/* ─── Mode Indicator ──────────────────────────────────────────────────────── */
#mode-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-primary);
    padding: 20px 40px;
    border-radius: var(--radius-lg);
    font-size: 1.5em;
    font-weight: bold;
    z-index: 5000;
    opacity: 0;
    transition: opacity var(--trans-normal);
    display: none;
    pointer-events: none;
    border: 2px solid var(--primary);
}

/* ─── Compact & Mini Modes ────────────────────────────────────────────────── */
#main-content.mode-mini #metadata-container {
    padding: 10px 15px;
    gap: 15px;
}

#main-content.mode-mini #cover-art-container {
    width: 80px;
    height: 80px;
    min-width: 80px;
}

#main-content.mode-mini #info-details .value {
    font-size: 0.95em;
}

#main-content.mode-mini #info-details .label {
    font-size: 0.65em;
}

/* ─── Sticky Mode ─────────────────────────────────────────────────────────── */
body.sticky-mini {
    padding-bottom: 180px;
}

.sticky-mini #metadata-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0;
    border-top: 2px solid var(--primary);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.8);
    max-width: 100%;
    margin: 0;
    animation: slideInUp 0.4s ease;
}

/* ─── Sticky Mode ─────────────────────────────────────────────────────────── */
body.sticky-mini {
    padding-bottom: 180px;
}

.sticky-mini #metadata-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0;
    border-top: 2px solid var(--primary);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.8);
    max-width: 100%;
    margin: 0;
    animation: slideInUp 0.4s ease;
}

.sticky-mini #custom-progress-container {
    position: fixed;
    bottom: 140px;
    left: 0;
    right: 0;
    z-index: 9999;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    background: transparent;
}

.sticky-mini #time-display {
    position: fixed;
    bottom: 150px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    max-width: calc(100% - 40px);
    margin: 0;
}

.sticky-mini #playback-controls {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(20, 20, 20, 0.9);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    width: auto !important;
    margin: 0 !important;
}

.sticky-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.8);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans-fast);
    z-index: 10000;
}

.sticky-close:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes lyricPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ─── Simulated Fullscreen Fallback ───────────────────────────────────────── */
.simulated-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background: #000 !important;
}

/* ─── Responsive: Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        left: -280px;
        width: 280px !important;
    }
    
    #sidebar:not(.collapsed) {
        left: 0;
    }
    
    .sidebar-toggle {
        position: fixed !important;
        left: 10px !important;
        top: 10px !important;
        width: 50px !important;
        height: 50px !important;
        z-index: 9001 !important;
        background: rgba(26, 26, 26, 0.95) !important;
        border-radius: var(--radius-full) !important;
        border: 2px solid var(--primary) !important;
    }
    
    #main-content {
        margin-left: 0 !important;
    }
    
    /* EQ Mobile Fixes */
    .eq-bands {
        gap: 30px !important;
    }
    
    .eq-slider {
        width: 12px !important;
        height: 180px !important;
        padding: 0 10px;
        margin: 0 -10px;
    }
    
    .eq-slider::-webkit-slider-thumb,
    .eq-slider::-moz-range-thumb {
        width: 28px !important;
        height: 28px !important;
    }
    
    /* Playlist Mobile Fixes */
    .pl-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pl-toolbar-left,
    .pl-toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .pl-tb-select {
        flex: 1;
    }
    
    .pl-sel-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pl-sel-count {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    /* Lyrics Mobile Fixes */
    .lyrics-control-panel {
        flex-wrap: wrap;
    }
    
    .lyrics-control-panel button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    #lyrics-search-overlay {
        top: 100px;
        max-height: 300px;
    }
    
    .lyrics-export-menu {
        width: calc(100% - 40px);
        left: 20px !important;
    }
    
    /* Sticky Mini Mobile Fixes */
    .sticky-mini #metadata-container {
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }
    
    .sticky-mini #playback-controls {
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }
}

/* ─── Responsive: Tablet ──────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
    #metadata-container,
    #controls {
        max-width: 90%;
    }
    
    button {
        padding: 10px 18px !important;
        font-size: 13px !important;
    }
}

/* ─── Responsive: Landscape ───────────────────────────────────────────────── */
@media (orientation: landscape) and (max-height: 600px) {
    body {
        padding: 10px !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    
    #metadata-container {
        width: 45% !important;
        padding: 10px !important;
    }
    
    #cover-art-container {
        width: 80px !important;
        height: 80px !important;
    }
    
    #sidebar {
        display: none !important;
    }
    
    #main-content {
        margin-left: 0 !important;
    }
    
    .lyric-line {
        font-size: 1.1em !important;
    }
    
    .lyric-line.active {
        font-size: 1.3em !important;
    }
    
    /* Sticky mode landscape fixes */
    .sticky-mini #metadata-container {
        bottom: 0;
        padding: 10px 15px;
    }
    
    .sticky-mini #playback-controls {
        bottom: 60px;
        padding: 5px 15px;
    }
    
    .sticky-mini #custom-progress-container {
        bottom: 110px;
    }
}

/* ─── Mobile Modal Fixes ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .metadata-editor-content,
    .folder-history-content,
    .custom-bg-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .metadata-editor-header,
    .folder-history-header {
        padding: 15px 20px;
    }
    
    .metadata-editor-header h2,
    .folder-history-header h2 {
        font-size: 1.2em;
    }
    
    .metadata-editor-body,
    .folder-history-body {
        padding: 20px;
    }
    
    .metadata-form-row {
        grid-template-columns: 1fr;
    }
    
    .metadata-form-actions {
        flex-direction: column;
    }
    
    .folder-item-details {
        flex-direction: column;
        gap: 5px;
    }
}