/* ===========================
   AURYNIS - STYLES
   =========================== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a24;
    --bg-hover: #22222f;
    --bg-active: #2a2a3a;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2a;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-glow: rgba(124,58,237,0.4);
    --text-primary: #f8f8ff;
    --text-secondary: #a0a0b8;
    --text-muted: #606078;
    --border-color: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --player-height: 90px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --gradient-primary: linear-gradient(135deg,#7c3aed,#a855f7);
    --gradient-card: linear-gradient(180deg,rgba(124,58,237,0.15) 0%,transparent 100%);
    --gradient-hero: linear-gradient(135deg,#0a0a0f 0%,#1a0a2e 50%,#0a0a0f 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 30px rgba(124,58,237,0.3);
    --radius-sm: 6px; --radius-md: 12px; --radius-lg: 16px;
    --radius-xl: 24px; --radius-full: 9999px;
    --transition-fast: 150ms ease; --transition-normal: 250ms ease; --transition-slow: 400ms ease;
    /* Expanded player colors - nadpisywane przez JS */
    --expanded-bg1: #0d0015;
    --expanded-bg2: #1a0a2e;
    --expanded-bg3: #0f1a3e;
    --expanded-accent1: rgba(124,58,237,0.35);
    --expanded-accent2: rgba(168,85,247,0.25);
}

body.theme-light {
    --bg-primary: #f0f0f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8f0;
    --bg-hover: #dcdcec;
    --bg-active: #d0d0e4;
    --bg-card: #ffffff;
    --bg-card-hover: #f4f4fc;
    --text-primary: #0a0a1a;
    --text-secondary: #4a4a6a;
    --text-muted: #8888aa;
    --border-color: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.15);
    --gradient-hero: linear-gradient(135deg,#f0f0f8 0%,#e8d8ff 50%,#f0f0f8 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
    --expanded-bg1: #f0e8ff;
    --expanded-bg2: #e8d8ff;
    --expanded-bg3: #d8e8ff;
    --expanded-accent1: rgba(124,58,237,0.15);
    --expanded-accent2: rgba(168,85,247,0.1);
}

body.theme-light .topbar { background: rgba(240,240,248,0.95) !important; }
body.theme-light .play-btn { background: #0a0a1a !important; color: #fff !important; }
body.theme-light .player-bar { background: var(--bg-secondary); }
body.theme-light .expanded-title,
body.theme-light .expanded-artist { color: var(--text-primary) !important; }
body.theme-light .expanded-times { color: var(--text-muted) !important; }
body.theme-light .expanded-controls .btn-icon { color: var(--text-secondary) !important; }
body.theme-light .expanded-controls .btn-icon:hover { color: var(--text-primary) !important; background: var(--bg-hover) !important; }
body.theme-light .expanded-close { background: var(--bg-hover) !important; color: var(--text-primary) !important; border-color: var(--border-color) !important; }
body.theme-light .expanded-progress .progress-bar { background: var(--bg-hover) !important; }
body.theme-light .expanded-progress .progress-fill { background: var(--accent-primary) !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }

body {
    font-family: 'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
    background: var(--bg-primary); color: var(--text-primary);
    height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    grid-template-areas: "sidebar main" "player player";
    overflow: hidden;
    user-select: none;
    transition: background var(--transition-normal),color var(--transition-normal);
}

body.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== SIDEBAR ===== */
.sidebar {
    grid-area: sidebar;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    padding: 20px 0; position: relative;
    transition: width var(--transition-slow);
    overflow: hidden; z-index: 100;
}

.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px; flex-shrink: 0;
}

.logo-icon {
    width: 40px; height: 40px; background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%,100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
    50% { box-shadow: 0 0 40px rgba(124,58,237,0.6); }
}

.logo-text {
    font-size: 22px; font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    white-space: nowrap;
}

.sidebar-nav { flex-shrink: 0; margin-bottom: 8px; }
.nav-list { list-style: none; padding: 0 10px; }

.nav-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; border-radius: var(--radius-md);
    cursor: pointer; color: var(--text-secondary);
    font-size: 14px; font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap; margin-bottom: 2px;
}

.nav-item i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item span { overflow: hidden; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--bg-active); color: var(--text-primary); }
.nav-item.active i { color: var(--accent-secondary); }

.sidebar-section {
    flex: 1; overflow: hidden; display: flex; flex-direction: column;
    padding: 16px 10px 0; margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 6px; margin-bottom: 10px; flex-shrink: 0;
}

.section-header span {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap;
}

.playlist-list { list-style: none; overflow-y: auto; flex: 1; }
.playlist-list::-webkit-scrollbar { width: 4px; }

.playlist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px; border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.playlist-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.playlist-item-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; overflow: hidden;
}

.playlist-item-icon img { width: 100%; height: 100%; object-fit: cover; }
.playlist-item-info { overflow: hidden; min-width: 0; }
.playlist-item-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-item-count { font-size: 11px; color: var(--text-muted); }

.sidebar-toggle {
    position: absolute; bottom: 20px; right: 14px;
    width: 28px; height: 28px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-full); color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: all var(--transition-normal);
}

.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
body.sidebar-collapsed .sidebar-toggle i { transform: rotate(180deg); }

body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .section-header span,
body.sidebar-collapsed .section-header .btn-icon,
body.sidebar-collapsed .playlist-item-info { opacity: 0; width: 0; }

/* Sidebar overlay */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 490; opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.sidebar-overlay.active { opacity: 1; pointer-events: all; }

/* ===== MAIN ===== */
.main-content {
    grid-area: main;
    display: flex; flex-direction: column;
    overflow: hidden; background: var(--bg-primary); min-width: 0;
}

/* ===== TOPBAR ===== */
.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; z-index: 50;
    transition: background var(--transition-normal);
}

.topbar-left { display: flex; gap: 4px; flex-shrink: 0; align-items: center; }

.search-container { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }

.api-selector {
    display: flex; background: var(--bg-tertiary);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    padding: 3px; gap: 2px; flex-shrink: 0;
}

.api-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 10px; border: none; background: transparent;
    color: var(--text-muted); font-family: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer; border-radius: var(--radius-md);
    transition: all var(--transition-fast); white-space: nowrap;
}

.api-btn i { font-size: 13px; }
.api-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.api-btn.active { color: white; }
.api-btn[data-api="jamendo"].active { background: linear-gradient(135deg,#0d9e6e,#00c9a7); }
.api-btn[data-api="soundcloud"].active { background: linear-gradient(135deg,#f50,#ff7700); }
.api-btn[data-api="youtube"].active { background: linear-gradient(135deg,#cc0000,#ff0000); }

.search-input-wrapper {
    flex: 1; position: relative; display: flex; align-items: center; min-width: 0;
}

.search-icon {
    position: absolute; left: 14px; color: var(--text-muted);
    font-size: 13px; pointer-events: none; z-index: 1;
}

#searchInput {
    width: 100%; padding: 9px 38px 9px 36px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-full); color: var(--text-primary);
    font-family: inherit; font-size: 14px; outline: none;
    transition: all var(--transition-normal);
}

#searchInput:focus {
    border-color: var(--accent-primary); background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input-wrapper:focus-within .search-icon { color: var(--accent-secondary); }

.search-clear {
    position: absolute; right: 4px; width: 28px; height: 28px;
    background: transparent; border: none; color: var(--text-muted);
    font-size: 12px; cursor: pointer; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
}

.search-clear:hover { color: var(--text-primary); background: var(--bg-hover); }

.topbar-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: auto; }
.theme-toggle { color: var(--text-secondary); }
.theme-toggle:hover { color: var(--warning); }

.user-avatar {
    width: 32px; height: 32px; background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; cursor: pointer; color: white;
    transition: all var(--transition-fast); flex-shrink: 0;
}

.user-avatar:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }

/* Mobile API bar */
.mobile-api-bar {
    display: none;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 6px;
    overflow-x: auto;
    flex-shrink: 0;
}

.mobile-api-bar::-webkit-scrollbar { display: none; }

/* ===== BUTTONS ===== */
.btn-icon {
    width: 36px; height: 36px; background: transparent; border: none;
    border-radius: var(--radius-full); color: var(--text-secondary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 15px; transition: all var(--transition-fast); flex-shrink: 0;
}

.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon:active { transform: scale(0.95); }

.btn-primary {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: var(--gradient-primary); border: none;
    border-radius: var(--radius-full); color: white; font-family: inherit;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast);
}

.btn-primary:hover { transform: scale(1.02); box-shadow: var(--shadow-glow); }

.btn-secondary {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; background: transparent;
    border: 1px solid var(--border-hover); border-radius: var(--radius-full);
    color: var(--text-primary); font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all var(--transition-fast);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-text {
    background: none; border: none; color: var(--text-muted);
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-text:hover { color: var(--text-primary); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { background: rgba(239,68,68,0.1); }

.btn-play-large {
    width: 56px; height: 56px; background: var(--gradient-primary); border: none;
    border-radius: var(--radius-full); color: white; font-size: 20px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast); box-shadow: var(--shadow-glow); flex-shrink: 0;
}

.btn-play-large:hover { transform: scale(1.06); }
.btn-shuffle { width: 44px; height: 44px; font-size: 18px; }

/* ===== VIEWS ===== */
.views-container { flex: 1; overflow: hidden; position: relative; min-height: 0; }

.view {
    position: absolute; inset: 0; overflow-y: auto;
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition-normal);
}

.view.active { opacity: 1; pointer-events: all; }
.view-content { padding: 24px 28px 120px; min-height: 100%; }

/* ===== HOME ===== */
.hero-section {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gradient-hero); border-radius: var(--radius-xl);
    padding: 40px 48px; margin-bottom: 36px;
    overflow: hidden; position: relative;
    border: 1px solid rgba(124,58,237,0.2);
}

.hero-section::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%,rgba(124,58,237,0.15) 0%,transparent 70%);
}

.hero-content { position: relative; z-index: 1; }
.hero-content h1 { font-size: 40px; font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.gradient-text { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-content p { font-size: 15px; color: var(--text-secondary); }
.hero-visual { position: relative; z-index: 1; flex-shrink: 0; }
.visualizer-rings { position: relative; width: 130px; height: 130px; }

.ring {
    position: absolute; border-radius: var(--radius-full);
    border: 2px solid var(--accent-primary);
    animation: ringPulse 2s ease-in-out infinite;
}

.ring-1 { inset: 25px; opacity: 0.8; } .ring-2 { inset: 12px; opacity: 0.5; animation-delay: 0.3s; } .ring-3 { inset: 0; opacity: 0.3; animation-delay: 0.6s; }
@keyframes ringPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); opacity: 0.3; } }

.content-section { margin-bottom: 36px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title h2 { font-size: 20px; font-weight: 700; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 14px; }

.card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    overflow: hidden; cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid transparent; position: relative;
}

.card:hover { background: var(--bg-card-hover); border-color: var(--border-color); transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-artwork { width: 100%; aspect-ratio: 1; position: relative; overflow: hidden; background: var(--bg-tertiary); }
.card-artwork img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.card:hover .card-artwork img { transform: scale(1.05); }

.card-artwork-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--gradient-card); font-size: 30px; color: var(--text-muted);
}

.card-play-btn {
    position: absolute; bottom: 10px; right: 10px;
    width: 40px; height: 40px; background: var(--gradient-primary);
    border: none; border-radius: var(--radius-full); color: white; font-size: 15px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    opacity: 0; transform: translateY(8px);
    transition: all var(--transition-normal); box-shadow: var(--shadow-md);
}

.card:hover .card-play-btn { opacity: 1; transform: translateY(0); }
.card-play-btn:hover { transform: scale(1.08) !important; }
.card-info { padding: 12px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-artist { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-source-badge {
    position: absolute; top: 8px; right: 8px;
    padding: 3px 7px; border-radius: var(--radius-full);
    font-size: 10px; font-weight: 700; text-transform: uppercase; color: white;
}

.source-sc { background: rgba(255,85,0,0.9); }
.source-yt { background: rgba(255,0,0,0.9); }
.source-jm { background: rgba(13,158,110,0.9); }

.genres-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; }

.genre-card {
    padding: 22px 18px; border-radius: var(--radius-lg);
    cursor: pointer; position: relative; overflow: hidden;
    transition: all var(--transition-normal); font-size: 14px; font-weight: 700; color: white;
}

.genre-card::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.2); transition: background var(--transition-fast); }
.genre-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.genre-card:hover::after { background: rgba(0,0,0,0.05); }
.genre-card span { position: relative; z-index: 1; }
.genre-card i { position: absolute; bottom: -5px; right: 10px; font-size: 44px; opacity: 0.3; transform: rotate(-15deg); }

.loading-skeleton { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 14px; }
.skeleton-card { background: var(--bg-card); border-radius: var(--radius-lg); aspect-ratio: 1/1.3; animation: skeletonPulse 1.5s ease-in-out infinite; }
@keyframes skeletonPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== SEARCH ===== */
.search-results-header { margin-bottom: 20px; }
.search-results-header h2 { font-size: 20px; font-weight: 700; }
.search-results-header h2 span { color: var(--accent-secondary); }

.search-placeholder, .search-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 20px; text-align: center;
}

.placeholder-icon {
    width: 80px; height: 80px; background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--text-muted); margin-bottom: 20px;
}

.search-placeholder h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.search-placeholder p { font-size: 14px; color: var(--text-muted); }
.search-loading p { font-size: 16px; font-weight: 500; color: var(--text-muted); margin-top: 12px; }

.loading-spinner {
    width: 44px; height: 44px; border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary); border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* Search results */
.search-results-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px; align-items: start;
}

.top-result-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 22px; cursor: pointer;
    border: 1px solid transparent; transition: all var(--transition-normal);
}

.top-result-card:hover { background: var(--bg-card-hover); border-color: var(--border-color); }

.top-result-artwork {
    width: 100px; height: 100px; border-radius: var(--radius-md);
    overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-lg);
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--text-muted);
}

.top-result-artwork img { width: 100%; height: 100%; object-fit: cover; }
.top-result-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-result-artist { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.top-result-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.08em; margin-bottom: 12px; }

/* ===== TRACKS TABLE ===== */
.tracks-table { display: flex; flex-direction: column; }

.track-row {
    display: grid;
    grid-template-columns: 40px 1fr 130px 65px 100px;
    gap: 12px; padding: 8px 12px;
    border-radius: var(--radius-md); align-items: center;
    cursor: pointer; transition: background var(--transition-fast);
    min-width: 0; width: 100%;
}

.track-row:hover { background: var(--bg-hover); }
.track-row.playing { background: rgba(124,58,237,0.1); }

.track-num {
    font-size: 13px; color: var(--text-muted); text-align: center;
    font-weight: 500; display: flex; align-items: center; justify-content: center;
    min-width: 0;
}

.track-num .playing-icon { display: none; }
.track-row.playing .track-num .num-text { display: none; }
.track-row.playing .track-num .playing-icon { display: inline-flex; }
.track-row.playing .track-title { color: var(--accent-secondary); }

.track-info { display: flex; align-items: center; gap: 10px; overflow: hidden; min-width: 0; }

.track-artwork {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}

.track-artwork img { width: 100%; height: 100%; object-fit: cover; }
.track-artwork-placeholder { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.track-details { overflow: hidden; min-width: 0; flex: 1; }
.track-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.track-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-source { display: flex; align-items: center; min-width: 0; overflow: hidden; }

.source-tag {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; padding: 3px 8px;
    border-radius: var(--radius-full); white-space: nowrap; overflow: hidden;
}

.source-tag.soundcloud { color: #ff5500; background: rgba(255,85,0,0.1); }
.source-tag.youtube { color: #ff0000; background: rgba(255,0,0,0.1); }
.source-tag.jamendo { color: #0d9e6e; background: rgba(13,158,110,0.1); }

.track-duration { font-size: 12px; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

.track-actions {
    display: flex; align-items: center; gap: 2px; justify-content: flex-end;
    opacity: 0; transition: opacity var(--transition-fast);
}

.track-row:hover .track-actions { opacity: 1; }
.track-actions .btn-icon { width: 28px; height: 28px; font-size: 13px; }
.track-like-btn.liked i { color: var(--danger); }

/* ===== LIBRARY ===== */
.library-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.library-header h2 { font-size: 24px; font-weight: 700; }
.library-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

.filter-btn {
    padding: 7px 16px; background: var(--bg-tertiary);
    border: 1px solid var(--border-color); border-radius: var(--radius-full);
    color: var(--text-secondary); font-family: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all var(--transition-fast);
}

.filter-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.filter-btn.active { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-primary); font-weight: 700; }

.library-items { display: flex; flex-direction: column; gap: 2px; }

.library-item {
    display: flex; align-items: center; gap: 14px; padding: 10px 14px;
    border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast);
}

.library-item:hover { background: var(--bg-hover); }

.library-item-artwork {
    width: 50px; height: 50px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--text-muted);
}

.library-item-artwork.liked-icon { background: linear-gradient(135deg,#7c3aed,#e11d48); color: white; }
.library-item-artwork img { width: 100%; height: 100%; object-fit: cover; }
.library-item-info { flex: 1; overflow: hidden; min-width: 0; }
.library-item-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-item-meta { font-size: 12px; color: var(--text-muted); }

.library-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 80px 20px; text-align: center;
    gap: 10px; color: var(--text-muted);
}

.library-empty i { font-size: 44px; margin-bottom: 6px; }
.library-empty h3 { font-size: 18px; color: var(--text-primary); }

/* ===== PLAYLIST HERO ===== */
.playlist-hero { display: flex; align-items: flex-end; gap: 24px; padding: 32px 0 28px; margin-bottom: 20px; }

.liked-hero {
    background: linear-gradient(135deg,#1a0a2e,#2d0a3e);
    padding: 36px 28px; border-radius: var(--radius-xl);
    margin: 0 0 24px; border: 1px solid rgba(124,58,237,0.2);
}

.playlist-hero-icon {
    width: 180px; height: 180px;
    background: linear-gradient(135deg,#7c3aed,#e11d48);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 56px; color: white; flex-shrink: 0;
    box-shadow: var(--shadow-lg); overflow: hidden;
}

.playlist-hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.playlist-hero-info span.playlist-type { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); display: block; margin-bottom: 6px; }
.playlist-hero-info h1 { font-size: 42px; font-weight: 800; line-height: 1.1; margin-bottom: 10px; }
.playlist-hero-info p { font-size: 13px; color: var(--text-muted); }
.playlist-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }

/* ===== QUEUE ===== */
.queue-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.queue-header h2 { font-size: 22px; font-weight: 700; }
.queue-now-playing, .queue-next { margin-bottom: 28px; }
.queue-now-playing h3, .queue-next h3 { font-size: 11px; font-weight: 700; margin-bottom: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.queue-current, .queue-list { display: flex; flex-direction: column; gap: 2px; }

.queue-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: var(--radius-md);
    cursor: pointer; transition: all var(--transition-fast);
}

.queue-item:hover { background: var(--bg-hover); }
.queue-item.current { background: rgba(124,58,237,0.1); }
.queue-item-num { width: 22px; text-align: center; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.queue-item.current .queue-item-num { color: var(--accent-secondary); }

.queue-item-artwork {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--bg-tertiary); overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-muted);
}

.queue-item-artwork img { width: 100%; height: 100%; object-fit: cover; }
.queue-item-info { flex: 1; overflow: hidden; min-width: 0; }
.queue-item-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item-artist { font-size: 11px; color: var(--text-muted); }
.queue-empty-msg { color: var(--text-muted); font-size: 14px; padding: 16px 0; }
.queue-remove-btn { opacity: 0; transition: opacity var(--transition-fast); width: 28px; height: 28px; font-size: 12px; }
.queue-item:hover .queue-remove-btn { opacity: 1; }

/* ===== PLAYER BAR ===== */
.player-bar {
    grid-area: player;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 200; position: relative;
    display: flex; flex-direction: column;
    justify-content: center;
}

/* Górna linia - TYLKO mobile (ukryta na desktop) */
.player-top-row {
    display: none;
}

/* Dolna linia - desktop */
.player-bottom-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    height: var(--player-height);
}

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

.player-artwork, .desktop-artwork {
    width: 52px; height: 52px; border-radius: var(--radius-md);
    overflow: hidden; flex-shrink: 0; position: relative;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
}

.player-artwork-placeholder { font-size: 18px; color: var(--text-muted); }
.player-meta { overflow: hidden; flex: 1; min-width: 0; }
.player-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.player-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track-actions { display: flex; gap: 2px; flex-shrink: 0; }
.heart-btn.liked i { color: var(--danger); }

.player-controls { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.control-buttons { display: flex; align-items: center; gap: 4px; }
.control-btn { color: var(--text-secondary); }
.control-btn:hover { color: var(--text-primary); }
.control-btn.active { color: var(--accent-secondary) !important; }

.play-btn {
    width: 38px; height: 38px; background: var(--text-primary);
    border-radius: var(--radius-full); color: var(--bg-primary) !important;
    font-size: 14px; transition: all var(--transition-fast); flex-shrink: 0;
}

.play-btn:hover { transform: scale(1.06); }

.progress-container { display: flex; align-items: center; gap: 10px; width: 100%; }
.time-current, .time-total { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 34px; font-weight: 500; flex-shrink: 0; }
.time-total { text-align: right; }

.progress-bar, .volume-bar {
    flex: 1; height: 4px; background: var(--bg-hover);
    border-radius: var(--radius-full); position: relative;
    cursor: pointer; transition: height var(--transition-fast);
}

.progress-bar:hover, .volume-bar:hover { height: 6px; }

.progress-fill, .volume-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--text-primary); border-radius: var(--radius-full); pointer-events: none;
}

.progress-bar:hover .progress-fill, .volume-bar:hover .volume-fill { background: var(--accent-secondary); }

.progress-handle, .volume-handle {
    position: absolute; top: 50%; transform: translate(-50%,-50%);
    width: 12px; height: 12px; background: white;
    border-radius: var(--radius-full); opacity: 0;
    transition: opacity var(--transition-fast); pointer-events: none;
}

.progress-bar:hover .progress-handle, .volume-bar:hover .volume-handle { opacity: 1; }

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

.source-badge {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: var(--radius-full);
    font-size: 10px; font-weight: 700;
    background: var(--bg-tertiary); color: var(--text-muted);
    border: 1px solid var(--border-color); white-space: nowrap;
}

.source-badge.soundcloud { color: #ff5500; border-color: rgba(255,85,0,0.3); }
.source-badge.youtube { color: #ff0000; border-color: rgba(255,0,0,0.3); }
.source-badge.jamendo { color: #0d9e6e; border-color: rgba(13,158,110,0.3); }

.volume-control { display: flex; align-items: center; gap: 6px; width: 120px; }

/* mobile-play-btn - ukryty na desktop */
.mobile-play-btn { display: none !important; }

/* ===== EXPANDED PLAYER ===== */
.expanded-player {
    position: fixed; inset: 0; z-index: 600;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 32px; gap: 20px;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}

.expanded-player.active { transform: translateY(0); }

/* Tło - dynamiczne przez CSS vars */
.expanded-bg {
    position: absolute; inset: 0;
    background:
        linear-gradient(160deg, var(--expanded-bg1) 0%, var(--expanded-bg2) 35%, var(--expanded-bg3) 70%, var(--expanded-bg1) 100%);
    z-index: 0;
}

.expanded-bg::after {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 25% 25%, var(--expanded-accent1) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 75%, var(--expanded-accent2) 0%, transparent 55%);
}

.expanded-player > * { position: relative; z-index: 1; }

.expanded-close {
    position: absolute; top: 16px; left: 16px;
    z-index: 10; width: 40px; height: 40px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

body.theme-light .expanded-close {
    background: rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.15);
    color: var(--text-secondary);
}

.expanded-close:hover { background: rgba(255,255,255,0.2); color: white; }

.expanded-artwork {
    width: min(260px, 62vw); height: min(260px, 62vw);
    border-radius: var(--radius-xl); overflow: hidden; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(124,58,237,0.25);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
}

body.theme-light .expanded-artwork {
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 30px rgba(124,58,237,0.15);
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}

.expanded-artwork-placeholder { font-size: 60px; color: rgba(255,255,255,0.3); }
body.theme-light .expanded-artwork-placeholder { color: rgba(0,0,0,0.25); }

.expanded-info { text-align: center; width: 100%; max-width: 380px; }
.expanded-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: rgba(255,255,255,0.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expanded-artist { font-size: 14px; color: rgba(255,255,255,0.55); }

.expanded-progress { width: 100%; max-width: 380px; }
.expanded-progress .progress-bar { height: 5px; margin-bottom: 8px; background: rgba(255,255,255,0.15); }
.expanded-progress .progress-fill { background: white; }
.expanded-progress .progress-bar:hover { height: 7px; }
.expanded-progress .progress-bar:hover .progress-fill { background: var(--accent-secondary); }
.expanded-times { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,0.45); }

.expanded-controls { display: flex; align-items: center; gap: 14px; }
.expanded-controls .btn-icon { color: rgba(255,255,255,0.65); width: 40px; height: 40px; }
.expanded-controls .btn-icon:hover { color: white; background: rgba(255,255,255,0.12); }
.expanded-controls .control-btn.active { color: var(--accent-secondary) !important; }

.expanded-play {
    width: 60px !important; height: 60px !important;
    font-size: 22px !important;
    box-shadow: 0 0 30px rgba(124,58,237,0.4);
}

.expanded-extra {
    display: flex; align-items: center; gap: 12px;
}

.expanded-extra .btn-icon { color: rgba(255,255,255,0.55); }
.expanded-extra .btn-icon:hover { color: white; background: rgba(255,255,255,0.12); }
body.theme-light .expanded-extra .btn-icon { color: var(--text-muted); }
body.theme-light .expanded-extra .btn-icon:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-xl); width: 90%; max-width: 460px;
    overflow: hidden; transform: scale(0.92) translateY(20px);
    transition: transform var(--transition-normal); box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-color); }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-color); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 7px; }

.form-group input, .form-group textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); color: var(--text-primary);
    font-family: inherit; font-size: 14px; outline: none;
    transition: all var(--transition-fast); resize: none;
}

.form-group textarea { height: 76px; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }

.playlist-modal-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; margin-bottom: 10px; }
.playlist-modal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-fast); }
.playlist-modal-item:hover { background: var(--bg-hover); }

.btn-create-playlist-inline {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px;
    background: transparent; border: 1px dashed var(--border-hover);
    border-radius: var(--radius-md); color: var(--text-secondary);
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all var(--transition-fast);
}

.btn-create-playlist-inline:hover { border-color: var(--accent-primary); color: var(--accent-secondary); }

/* ===== CONTEXT MENU ===== */
.context-menu {
    position: fixed; background: var(--bg-secondary);
    border: 1px solid var(--border-hover); border-radius: var(--radius-md);
    padding: 5px; z-index: 2000; min-width: 195px;
    opacity: 0; pointer-events: none;
    transform: scale(0.95) translateY(-8px);
    transition: all 0.12s ease; box-shadow: var(--shadow-lg);
    transform-origin: top left;
}

.context-menu.active { opacity: 1; pointer-events: all; transform: scale(1) translateY(0); }
.context-menu-list { list-style: none; }

.context-menu-list li {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.context-menu-list li:hover { background: var(--bg-hover); color: var(--text-primary); }
.context-menu-list li i { width: 15px; text-align: center; font-size: 13px; }
.context-menu-list li.separator { height: 1px; background: var(--border-color); padding: 0; margin: 3px 0; cursor: default; }
.context-menu-list li.separator:hover { background: var(--border-color); color: transparent; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 110px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 3000; pointer-events: none; }

.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    box-shadow: var(--shadow-lg); transform: translateX(120%);
    transition: transform var(--transition-normal); max-width: 320px; pointer-events: all;
}

.toast.show { transform: translateX(0); }
.toast i { font-size: 15px; flex-shrink: 0; }
.toast.success { border-left: 3px solid var(--success); } .toast.success i { color: var(--success); }
.toast.error { border-left: 3px solid var(--danger); } .toast.error i { color: var(--danger); }
.toast.info { border-left: 3px solid var(--accent-secondary); } .toast.info i { color: var(--accent-secondary); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp 0.35s ease forwards; }

.wave-animation { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.wave-animation .bar { width: 2px; background: var(--accent-secondary); border-radius: 1px; animation: wave 1.2s ease-in-out infinite; }
.wave-animation .bar:nth-child(1) { animation-delay: 0s; }
.wave-animation .bar:nth-child(2) { animation-delay: 0.15s; }
.wave-animation .bar:nth-child(3) { animation-delay: 0.3s; }
.wave-animation .bar:nth-child(4) { animation-delay: 0.15s; }
@keyframes wave { 0%,100% { height: 3px; } 50% { height: 12px; } }

button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-secondary); outline-offset: 2px; }

/* ===== DESKTOP ONLY / MOBILE ONLY ===== */
.desktop-only { display: flex; }
.mobile-only { display: none; }
.mobile-menu-btn { display: none; }

/* ===== RESPONSIVE TABLET ===== */
@media (max-width: 1000px) {
    .search-results-grid { grid-template-columns: 1fr; }
    .search-results-grid .top-result-section { display: none; }
}

@media (max-width: 900px) {
    :root { --sidebar-width: 64px; }
    .logo-text, .nav-item span, .section-header span, .section-header .btn-icon, .playlist-item-info { opacity: 0; width: 0; overflow: hidden; }
    .api-btn span { display: none; }
    .hero-content h1 { font-size: 26px; }
    .hero-visual { display: none; }
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {

    /* Layout */
    body {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr auto !important;
        grid-template-areas: "main" "player" !important;
    }

    /* Sidebar drawer */
    .sidebar {
        position: fixed !important;
        top: 0 !important; bottom: 0 !important;
        left: -280px !important;
        width: 260px !important; min-width: 260px !important;
        z-index: 500 !important;
        transition: left 0.35s cubic-bezier(0.4,0,0.2,1) !important;
        /* Przywróć nazwy w sidebarze na mobile */
        --sidebar-width: 260px;
    }

    /* Przywróć nazwy zakładek w otwartym sidebarze na mobile */
    .sidebar .logo-text,
    .sidebar .nav-item span,
    .sidebar .section-header span,
    .sidebar .playlist-item-info {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
    }

    .sidebar.mobile-open {
        left: 0 !important;
        box-shadow: 4px 0 40px rgba(0,0,0,0.7) !important;
    }

    .sidebar-overlay {
        display: block !important;
        position: fixed !important; inset: 0 !important;
        z-index: 490 !important;
    }

    .sidebar-overlay.active { opacity: 1 !important; pointer-events: all !important; }

    .sidebar-toggle { display: none !important; }
    .mobile-menu-btn { display: flex !important; }
    .desktop-only { display: none !important; }

    /* Topbar */
    .topbar { padding: 8px 12px !important; gap: 8px !important; }
    .api-selector { display: none !important; }
    .search-container { flex: 1 !important; min-width: 0 !important; gap: 6px !important; }
    .topbar-right { gap: 4px !important; }

    /* Mobile API bar */
    .mobile-api-bar {
        display: flex !important;
        padding: 6px 12px !important;
        background: var(--bg-secondary) !important;
        border-bottom: 1px solid var(--border-color) !important;
        gap: 6px !important;
        overflow-x: auto !important;
        flex-shrink: 0 !important;
    }

    .mobile-api-bar .api-btn { font-size: 12px !important; padding: 6px 10px !important; }

    /* Views */
    .view-content { padding: 12px 12px 16px !important; }

    /* Tracks - tylko 2 kolumny na mobile */
    .track-row {
        grid-template-columns: 32px 1fr !important;
        gap: 8px !important;
    }

    .track-source,
    .track-duration,
    .track-actions { display: none !important; }

    /* Cards */
    .cards-grid { grid-template-columns: repeat(auto-fill,minmax(130px,1fr)) !important; gap: 10px !important; }
    .genres-grid { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }

    /* Hero */
    .hero-section { padding: 20px !important; margin-bottom: 20px !important; }
    .hero-content h1 { font-size: 20px !important; }
    .hero-visual { display: none !important; }

    /* Playlist hero */
    .playlist-hero { flex-direction: column !important; align-items: center !important; text-align: center !important; padding: 16px 0 !important; }
    .playlist-hero-icon { width: 120px !important; height: 120px !important; font-size: 36px !important; }
    .playlist-hero-info h1 { font-size: 22px !important; }

    /* ==========================================
       PLAYER BAR MOBILE - POPRAWIONY LAYOUT
       ========================================== */
    .player-bar {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        height: auto !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    /* Górna linia - WIDOCZNA NA MOBILE */
    .player-top-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 12px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Dolna linia - tylko pasek postępu na mobile */
    .player-bottom-row {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 12px !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        height: auto !important;
        gap: 0 !important;
    }

    /* Ukryj desktop track info i extra */
    .player-bottom-row .player-track-info { display: none !important; }
    .player-bottom-row .player-extra { display: none !important; }

    /* Kontrolki na mobile - prev/next/shuffle/repeat w top row */
    .player-controls {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 0 !important;
    }

    /* Przyciski sterowania - ukryte (prev/next w top row) */
    .player-controls .control-buttons { display: none !important; }

    /* Tylko pasek postępu */
    .progress-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        width: 100% !important;
        gap: 8px !important;
        padding-bottom: 4px !important;
    }

    /* Artwork w top row */
    .player-top-row .player-artwork {
        width: 42px !important; height: 42px !important;
        flex-shrink: 0 !important; border-radius: var(--radius-sm) !important;
        display: flex !important;
    }

    /* Meta w top row */
    .player-top-row .player-meta {
        flex: 1 !important; min-width: 0 !important; overflow: hidden !important;
    }

    /* Akcje w top row - prev + play + next + serce + expand */
    .player-top-actions {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
    }

    .player-top-actions .btn-icon {
        width: 34px !important; height: 34px !important; font-size: 14px !important;
    }

    /* Pokaż mobile play button */
    .mobile-play-btn {
        display: flex !important;
        width: 36px !important; height: 36px !important;
        font-size: 15px !important;
        background: var(--text-primary) !important;
        color: var(--bg-primary) !important;
        border-radius: var(--radius-full) !important;
        flex-shrink: 0 !important;
    }

    /* Expanded player na mobile */
    .expanded-player { padding: 20px 16px !important; gap: 14px !important; }
    .expanded-artwork { width: min(220px,65vw) !important; height: min(220px,65vw) !important; }
    .expanded-title { font-size: 18px !important; }
    .expanded-play { width: 52px !important; height: 52px !important; font-size: 18px !important; }

    /* Toasty */
    .toast-container { bottom: 130px !important; right: 10px !important; }

    /* Expanded player tło na mobile */
    #expandPlayerBtn { display: flex !important; }
}

@media (min-width: 641px) {
    .mobile-menu-btn { display: none !important; }
    .sidebar-overlay { display: none !important; }
    .mobile-api-bar { display: none !important; }
    .mobile-play-btn { display: none !important; }
    .player-top-row { display: none !important; }
    .player-top-actions { display: none !important; }
}