/* ======================================
   WavePlay - Spotify-inspired Dark Theme
   ====================================== */

:root {
    --bg-primary: #121212;
    --bg-secondary: #181818;
    --bg-elevated: #242424;
    --bg-highlight: #2a2a2a;
    --bg-card: #1e1e1e;
    --accent: #1db954;
    --accent-hover: #1ed760;
    --accent-dim: rgba(29, 185, 84, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #6a6a6a;
    --border: #333;
    --danger: #e74c3c;
    --warning: #f39c12;
    --waveform-bg: #404040;
    --waveform-played: #1db954;
    --waveform-unplayed: #535353;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.5);
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* =============================================
   GLOBAL SVG ICON SIZING
   All inline SVGs default to 20x20 unless a parent
   explicitly overrides. This prevents icons from
   blowing up to fill their container.
   ============================================= */
svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-highlight); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Layout ---- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr auto;
    height: 100vh;
    overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
    grid-row: 1;
    grid-column: 1;
    min-height: 0;
    overflow: hidden;
}
.sidebar-top {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-top::-webkit-scrollbar { width: 6px; }
.sidebar-top::-webkit-scrollbar-thumb { background: var(--bg-highlight); border-radius: 3px; }
.sidebar-bottom {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 16px;
}

.logo svg { width: 32px; height: 32px; fill: var(--accent); }
.logo h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }

.nav-section { margin-top: 8px; }
.nav-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover { color: var(--text-primary); background: var(--bg-highlight); }
.nav-item.active { color: var(--text-primary); background: var(--accent-dim); }
.nav-item.active .nav-icon { color: var(--accent); }

.nav-icon { display: inline-flex; width: 20px; height: 20px; opacity: 0.8; }
.nav-icon svg { width: 20px; height: 20px; }

.sidebar-playlists {
    margin-top: 4px;
}

.playlist-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
}
.playlist-sidebar-item:hover { background: var(--bg-highlight); color: var(--text-primary); }
.playlist-sidebar-item .pl-thumb {
    width: 40px; height: 40px;
    border-radius: 4px;
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.playlist-sidebar-item .pl-thumb svg { width: 18px; height: 18px; }
.playlist-sidebar-item .pl-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Main Content ---- */
.main-content {
    background: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 32px;
    padding-bottom: 32px;
    grid-row: 1;
    grid-column: 2;
    min-height: 0;
}

/* Header bar */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.content-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.content-header h2 svg { width: 28px; height: 28px; }

.header-actions { display: flex; gap: 10px; }

/* ---- Buttons ---- */
.btn {
    padding: 10px 24px;
    border-radius: 24px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.03); }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-small { padding: 6px 16px; font-size: 12px; }
.btn-small svg { width: 14px; height: 14px; }

.btn-icon {
    width: 36px; height: 36px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,0.1); border: none;
    color: var(--text-primary); cursor: pointer; transition: all var(--transition);
}
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }

/* ---- Forms / Inputs ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-highlight);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition);
    font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--accent);
}
.form-textarea { min-height: 80px; resize: vertical; }

.form-checkbox {
    display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px;
}
.form-checkbox input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--accent);
}

.file-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-card);
}
.file-drop:hover, .file-drop.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.file-drop .drop-icon { margin-bottom: 12px; }
.file-drop .drop-icon svg { width: 40px; height: 40px; color: var(--text-muted); }
.file-drop p { color: var(--text-secondary); font-size: 14px; }
.file-drop .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---- Track Cards / List ---- */
.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.track-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.track-card:hover { background: var(--bg-highlight); transform: translateY(-2px); }

.track-card .artwork {
    width: 100%; aspect-ratio: 1;
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.track-card .artwork img { width: 100%; height: 100%; object-fit: cover; }
.track-card .artwork .no-art svg { width: 48px; height: 48px; color: var(--text-muted); }

.track-card .play-overlay {
    position: absolute; bottom: 8px; right: 8px;
    width: 48px; height: 48px;
    background: var(--accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(8px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.track-card:hover .play-overlay { opacity: 1; transform: translateY(0); }
.track-card .play-overlay svg { fill: #000; width: 20px; height: 20px; margin-left: 2px; }

.track-card .info { padding: 14px; }
.track-card .info h4 {
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-card .info p {
    font-size: 13px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 4px;
}
.track-card .info .meta {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px; font-size: 11px; color: var(--text-muted);
}

.visibility-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.visibility-badge.public { background: var(--accent-dim); color: var(--accent); }
.visibility-badge.private { background: rgba(231,76,60,0.15); color: var(--danger); }

/* Track list view */
.track-list { display: flex; flex-direction: column; gap: 2px; }

.track-list-item {
    display: grid;
    grid-template-columns: 40px 48px 1fr 1fr 80px 100px 40px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 14px;
}
.track-list-item:hover { background: var(--bg-highlight); }
.track-list-item.playing { background: var(--accent-dim); }

.track-list-item .num-col { text-align: center; position: relative; }
.track-list-item .track-num { color: var(--text-muted); font-size: 14px; }
.track-list-item .track-play-btn {
    display: none; background: none; border: none; cursor: pointer;
    color: var(--text-primary); padding: 0; line-height: 1;
}
.track-list-item .track-play-btn svg { width: 16px; height: 16px; }
.track-list-item:hover .track-num { display: none; }
.track-list-item:hover .track-play-btn { display: inline-flex; }
.track-list-item.playing .track-num { color: var(--accent); }

.track-title-link, .artist-link {
    cursor: pointer; text-decoration: none; color: inherit;
}
.track-title-link:hover { text-decoration: underline; color: var(--text-primary); }
.artist-link:hover { text-decoration: underline; color: var(--text-primary); }
.track-list-item .thumb {
    width: 40px; height: 40px; border-radius: 4px;
    background: var(--bg-elevated); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.track-list-item .thumb svg { width: 18px; height: 18px; color: var(--text-muted); }
.track-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.track-list-item .title-col {
    font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-list-item .artist-col {
    color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-list-item .plays-col { color: var(--text-muted); font-size: 13px; text-align: right; }
.track-list-item .duration-col { color: var(--text-secondary); font-size: 13px; text-align: right; }
.track-list-item .actions-col { text-align: center; }

.list-header {
    display: grid;
    grid-template-columns: 40px 48px 1fr 1fr 80px 100px 40px;
    gap: 12px;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

/* ---- Playlist Cards ---- */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.playlist-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
}
.playlist-card:hover { background: var(--bg-highlight); }

.playlist-card .pl-art {
    width: 100%; aspect-ratio: 1;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    margin-bottom: 14px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.playlist-card .pl-art img { width: 100%; height: 100%; object-fit: cover; }
.playlist-card .pl-art .no-art svg { width: 48px; height: 48px; color: var(--text-muted); }
.playlist-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.playlist-card p { font-size: 13px; color: var(--text-secondary); }

/* ---- Player Bar (bottom) ---- */
.player-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 260px 1fr 200px;
    align-items: center;
    gap: 16px;
    z-index: 100;
}

/* ---- Mobile Navigation ---- */
.mobile-nav { display: none; }

@media (max-width: 900px) {
    .mobile-nav {
        display: flex;
        grid-column: 1;
        grid-row: 3;
        background: var(--bg-secondary);
        border-top: 1px solid rgba(255,255,255,0.05);
        justify-content: space-around;
        padding: 6px 0 max(6px, env(safe-area-inset-bottom));
        z-index: 100;
    }
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        font-size: 10px; color: var(--text-muted); cursor: pointer;
        padding: 4px 8px; border-radius: 8px;
        transition: color var(--transition);
    }
    .mobile-nav-item svg { width: 22px; height: 22px; }
    .mobile-nav-item.active { color: var(--accent); }
    .mobile-nav-item:hover { color: var(--text-primary); }
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.player-thumb {
    width: 56px; height: 56px;
    border-radius: 6px;
    background: var(--bg-elevated);
    overflow: hidden; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
}
.player-thumb svg { width: 24px; height: 24px; color: var(--text-muted); }
.player-thumb img { width: 100%; height: 100%; object-fit: cover; }

.player-track-details { min-width: 0; }
.player-track-details h4 {
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-track-details p {
    font-size: 12px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.player-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.player-controls {
    display: flex; align-items: center; gap: 16px;
}

.player-controls button {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; transition: color var(--transition);
    display: flex; align-items: center; justify-content: center;
    padding: 4px;
}
.player-controls button:hover { color: var(--text-primary); }
.player-controls button svg { width: 20px; height: 20px; }

.play-btn-main {
    width: 36px !important; height: 36px;
    background: var(--text-primary) !important;
    border-radius: 50% !important;
    color: var(--bg-primary) !important;
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition) !important;
    padding: 0 !important;
}
.play-btn-main:hover { transform: scale(1.06); }
.play-btn-main svg { width: 16px !important; height: 16px !important; fill: var(--bg-primary); color: var(--bg-primary); }

.player-progress {
    display: flex; align-items: center; gap: 10px; width: 100%; max-width: 600px;
}
.player-progress .time { font-size: 11px; color: var(--text-muted); min-width: 40px; }
.player-progress .time:last-child { text-align: right; }

/* Waveform Container */
.waveform-container {
    flex: 1; height: 40px; position: relative; cursor: pointer;
    border-radius: 4px; overflow: hidden;
}

.waveform-canvas {
    width: 100%; height: 100%;
    display: block;
    pointer-events: none;
}

/* Mini waveform in player bar */
.player-waveform {
    flex: 1; height: 32px; position: relative; cursor: pointer;
    border-radius: 2px; overflow: hidden;
}

/* Large waveform on track detail */
.track-waveform {
    width: 100%; height: 80px; position: relative; cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 16px 0;
    background: var(--bg-elevated);
}

.player-right {
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
}

.volume-control {
    display: flex; align-items: center; gap: 8px;
}
.volume-control button {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.volume-control button svg { width: 20px; height: 20px; }
.volume-control button:hover { color: var(--text-primary); }

input[type="range"] {
    -webkit-appearance: none; appearance: none;
    height: 4px; border-radius: 2px;
    background: var(--bg-highlight); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%; background: var(--text-primary);
    cursor: pointer; transition: all var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"].accent::-webkit-slider-thumb { background: var(--accent); }

.volume-slider { width: 90px; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal h3 {
    font-size: 22px; font-weight: 700; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.modal h3 svg { width: 22px; height: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---- Toasts ---- */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    max-width: 360px;
}
.toast.success { background: var(--accent); color: #000; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(50%); } }

/* ---- Auth page ---- */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
}
.auth-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
}
.auth-card .logo { justify-content: center; margin-bottom: 32px; }
.auth-card h2 { text-align: center; margin-bottom: 24px; font-size: 24px; }
.auth-tabs {
    display: flex; gap: 0; margin-bottom: 28px;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border);
}
.auth-tab {
    flex: 1; padding: 10px; text-align: center;
    background: transparent; border: none;
    color: var(--text-secondary); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.auth-tab.active { background: var(--accent); color: #000; }

/* ---- Share dialog ---- */
.share-link-box {
    display: flex; gap: 8px; margin-top: 12px;
}
.share-link-box input {
    flex: 1; padding: 10px 14px;
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary); font-size: 13px;
}
.share-link-box button { flex-shrink: 0; }

/* ---- Context menu ---- */
.context-menu {
    position: fixed; z-index: 1500;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 0;
    min-width: 180px;
    box-shadow: var(--shadow);
    display: none;
}
.context-menu.show { display: block; }
.context-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.context-menu-item svg { width: 16px; height: 16px; }
.context-menu-item:hover { background: var(--bg-highlight); color: var(--text-primary); }
.context-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ---- Empty state ---- */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { margin-bottom: 16px; }
.empty-state .icon svg { width: 56px; height: 56px; color: var(--text-muted); }
.empty-state h3 { font-size: 20px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ---- Tabs ---- */
.tab-bar {
    display: flex; gap: 0; margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.tab-btn {
    padding: 12px 20px; border: none; background: none;
    color: var(--text-muted); font-size: 14px; font-weight: 600;
    cursor: pointer; position: relative; transition: color var(--transition);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--text-primary); }
.tab-btn.active::after {
    content: ''; position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 2px; background: var(--accent);
    border-radius: 2px 2px 0 0;
}

/* ---- Loading ---- */
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--bg-highlight);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Track Detail View ---- */
.track-detail-header {
    display: flex; gap: 32px; margin-bottom: 32px;
    align-items: flex-end;
}
.track-detail-art {
    width: 232px; height: 232px;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    overflow: hidden; flex-shrink: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.track-detail-art svg { width: 80px; height: 80px; color: var(--text-muted); }
.track-detail-art img { width: 100%; height: 100%; object-fit: cover; }
.track-detail-art .no-art { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.player-thumb .no-art { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.track-detail-info { min-width: 0; }
.track-detail-info h1 { font-size: 40px; font-weight: 800; line-height: 1.1; margin-bottom: 8px; }
.track-detail-info .artist { font-size: 18px; color: var(--text-secondary); margin-bottom: 12px; }
.track-detail-info .meta-row { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }

.track-actions { display: flex; gap: 12px; margin: 20px 0; align-items: center; flex-wrap: wrap; }
.play-large {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(29,185,84,0.3);
}
.play-large:hover { transform: scale(1.06); background: var(--accent-hover); }
.play-large svg { width: 24px; height: 24px; fill: #000; color: #000; margin-left: 2px; }

/* ---- Account / Admin pages ---- */
.account-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.account-section h3 {
    margin-bottom: 16px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.account-section h3 svg { width: 20px; height: 20px; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-highlight); }

.admin-user-cell {
    display: flex; align-items: center; gap: 10px;
}
.admin-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.admin-avatar svg { width: 16px; height: 16px; color: var(--text-muted); }
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Shared View ---- */
.shared-view {
    min-height: 100vh; background: var(--bg-main);
    display: flex; flex-direction: column; align-items: center;
}
.shared-header {
    width: 100%; padding: 24px; display: flex; justify-content: center;
    border-bottom: 1px solid var(--border);
}
.shared-header .logo { gap: 10px; }
.shared-content {
    padding: 48px 24px; text-align: center;
    max-width: 600px; width: 100%;
}
.shared-content .track-detail-art {
    width: 200px; height: 200px; margin: 0 auto 24px;
}
.shared-content .no-art {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}
.shared-content .no-art svg { width: 64px; height: 64px; color: var(--text-muted); }
.shared-content h2 { margin-bottom: 4px; }

.shared-player {
    display: flex; align-items: center; gap: 16px;
    width: 100%; max-width: 600px; margin: 0 auto;
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 16px 20px; text-align: left;
}
.shared-player .play-large { flex-shrink: 0; }
.shared-player-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.shared-waveform-row {
    display: flex; align-items: center; gap: 10px; width: 100%;
}
.shared-waveform-row .time { font-size: 12px; color: var(--text-muted); min-width: 36px; }
.shared-waveform-wrap {
    flex: 1; height: 40px; cursor: pointer; position: relative;
    border-radius: 2px; overflow: hidden;
}
.shared-volume {
    display: flex; align-items: center; gap: 8px;
}
.shared-volume button {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 0;
}
.shared-volume button svg { width: 16px; height: 16px; }
.shared-volume .volume-slider { width: 80px; }

/* ---- Artist Profile ---- */
.artist-profile-header {
    display: flex; gap: 24px; margin-bottom: 32px; align-items: center;
}
.artist-avatar {
    width: 160px; height: 160px; border-radius: 50%;
    background: var(--bg-elevated); overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.artist-avatar svg { width: 64px; height: 64px; color: var(--text-muted); }
.artist-info h1 { font-size: 36px; margin-bottom: 4px; }
.artist-info .stats { color: var(--text-secondary); font-size: 14px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .track-detail-info h1 { font-size: 28px; }
    .track-detail-art { width: 180px; height: 180px; }
}

@media (max-width: 900px) {
    .app-container { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; }
    .sidebar { display: none; }
    .main-content { grid-column: 1; grid-row: 1; padding: 16px; }
    .player-bar {
        grid-column: 1;
        display: flex; flex-wrap: wrap;
        gap: 8px; padding: 8px 12px;
    }
    .player-track-info { display: flex; align-items: center; gap: 8px; width: 100%; }
    .player-track-details { display: none; }
    .player-thumb { width: 40px; height: 40px; flex-shrink: 0; }
    .player-center { width: 100%; order: 2; }
    .player-controls { gap: 12px; }
    .player-controls button svg { width: 18px; height: 18px; }
    .play-btn-main { width: 36px; height: 36px; }
    .play-btn-main svg { width: 14px; height: 14px; }
    .player-progress { max-width: 100%; }
    .player-right { display: none; }
    .track-detail-header { flex-direction: column; align-items: center; text-align: center; }
    .track-detail-art { width: 200px; height: 200px; }
    .track-list-item { grid-template-columns: 48px 1fr 40px; }
    .track-list-item .artist-col,
    .track-list-item .plays-col,
    .track-list-item .duration-col,
    .track-list-item .num-col { display: none; }
    .list-header { display: none; }
    .content-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .content-header h2 { font-size: 22px; }
    .track-grid, .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    .artist-profile-header { flex-direction: column; text-align: center; }
    .artist-avatar { width: 120px; height: 120px; }
    .artist-info h1 { font-size: 28px; }
}

@media (max-width: 600px) {
    .track-detail-info h1 { font-size: 20px; }
    .track-detail-art { width: 160px; height: 160px; }
    .player-controls { gap: 8px; }
    .shared-player { flex-direction: column; align-items: center; padding: 16px; }
    .shared-player-right { width: 100%; }
    .shared-content { padding: 32px 16px; }
    .shared-content .track-detail-art { width: 160px; height: 160px; }
}
