/* User Page Styles - Futuristic Dark Theme */

:root {
    --bg-primary: #050508;
    --bg-secondary: rgba(255, 255, 255, 0.03);
    --bg-tertiary: rgba(255, 255, 255, 0.05);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #a855f7;
    --accent-4: #ec4899;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.06);
    --glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 90%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Grid Pattern */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
}

.app {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: 1fr auto;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.sidebar {
    grid-column: 1;
    grid-row: 1 / 3;
}

.main {
    grid-column: 2;
    grid-row: 1;
}

.player-bar {
    grid-column: 1 / 3;
    grid-row: 2;
}

/* Sidebar */
.sidebar {
    background: var(--glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 36px;
    padding-left: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo::before {
    content: '🎵';
    font-size: 1.4rem;
    -webkit-text-fill-color: initial;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 28px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-btn:hover::before {
    height: 50%;
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-1);
    font-weight: 600;
}

.nav-btn.active::before {
    height: 70%;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

/* Sidebar Section */
.sidebar-section {
    margin-top: 20px;
    overflow-y: auto;
    min-height: 0;
    flex-shrink: 1;
    /* Allow shrinking */
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.collections-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    /* Make collections list scrollable */
    flex: 1;
    /* Take remaining space */
    padding-right: 4px;
    /* Space for scrollbar */
    padding-bottom: 120px;
    /* Space for player bar at bottom */
}

.collection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.collection-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.collection-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-1);
    font-weight: 600;
}

.collection-item .count {
    font-size: 0.7rem;
    opacity: 0.7;
    background: rgba(99, 102, 241, 0.15);
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 600;
}

/* Main Content */
.main {
    padding: 28px 36px;
    padding-bottom: 120px;
    overflow-y: auto;
    background: transparent;
    scroll-behavior: smooth;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 28px;
    margin: -28px -36px 28px -36px;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.search-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.search-bar input {
    flex: 1;
    padding: 14px 20px 14px 48px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.song-count {
    background: rgba(99, 102, 241, 0.15);
    padding: 10px 18px;
    border-radius: 12px;
    color: var(--accent-1);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Custom Filter Dropdown */
.filter-dropdown {
    position: relative;
    min-width: 200px;
}

.filter-select-custom {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    padding: 14px 44px 14px 18px;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    user-select: none;
    position: relative;
}

.filter-select-custom::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--accent-1);
    transition: transform 0.3s ease;
}

.filter-select-custom.open::after {
    transform: translateY(-50%) rotate(180deg);
}

.filter-select-custom:hover {
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.05);
}

.filter-select-custom.open {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.filter-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--accent-1);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-options.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.filter-option {
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.filter-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-option.selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-1);
}

.filter-option .emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.filter-select {
    display: none;
}

/* Song Table */
.song-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    table-layout: fixed;
}

.song-table th {
    text-align: left;
    padding: 18px 20px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.03);
}

.song-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-secondary);
}

.song-table td.song-name,
.song-table td.song-creator {
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-table tbody tr {
    transition: all 0.3s ease;
}

.song-table tbody tr:hover {
    background: var(--bg-hover);
}

.song-table tbody tr:hover td {
    color: var(--text-primary);
}

.song-table tbody tr.playing {
    background: rgba(99, 102, 241, 0.1);
}

.song-table tbody tr.playing td:first-child {
    position: relative;
}

.song-table tbody tr.playing td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
}

.song-table tbody tr.playing .song-name {
    color: var(--accent-1);
    font-weight: 600;
}

.song-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Producers Grid */
.producers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.producer-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 28px;
    cursor: pointer;
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.producer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.producer-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--glow);
}

.producer-card:hover::before {
    opacity: 0.05;
}

.producer-card .name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
}

.producer-card .count {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 28px 0;
    margin-top: 20px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--accent-1);
    color: var(--accent-1);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--glow);
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Quality Badge */
.quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.quality-badge.lossless {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.quality-badge.high {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.quality-badge.medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.quality-badge.low {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.quality-badge.very-low,
.quality-badge.fake {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.quality-badge.pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

/* BPM Badge */
.bpm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid var(--glass-border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 1000;
}

.player-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.now-playing {
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.song-info {
    overflow: hidden;
}

.song-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-title.marquee {
    animation: marquee-scroll 15s linear infinite;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100% + 200px));
    }
}

.song-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

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

.ctrl-btn {
    min-width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ctrl-btn.mode-btn {
    width: auto;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ctrl-btn.active {
    color: #10b981 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ctrl-btn.active svg {
    color: #10b981 !important;
    fill: #10b981 !important;
    stroke: #10b981 !important;
}

.ctrl-btn.mode-btn.active {
    background: transparent !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.ctrl-btn.mode-btn.active .btn-label {
    color: #10b981 !important;
}

/* Ẩn ::before cho tất cả ctrl-btn để không hiện nền tím */
.ctrl-btn::before {
    display: none !important;
    content: none !important;
}

.ctrl-btn.mode-btn::before {
    display: none !important;
    content: none !important;
}

/* Override tất cả hover effects */
.ctrl-btn:hover::before {
    display: none !important;
    transform: none !important;
}

/* Override active state - chỉ màu xanh, không nền */
.ctrl-btn.active {
    color: #10b981 !important;
    background: transparent !important;
    box-shadow: none !important;
    animation: none !important;
}

.ctrl-btn.active svg {
    color: #10b981 !important;
    fill: #10b981 !important;
    stroke: #10b981 !important;
    filter: none !important;
    animation: none !important;
}

.ctrl-btn.mode-btn.active {
    background: transparent !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    box-shadow: none !important;
    animation: none !important;
}

.ctrl-btn.mode-btn.active .btn-label {
    color: #10b981 !important;
}

/* === AUTO MIX MIXING STATE === */
/* Hiệu ứng pulsing khi đang crossfade */
@keyframes automix-pulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
        border-color: rgba(99, 102, 241, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 40px rgba(139, 92, 246, 0.4);
        border-color: rgba(139, 92, 246, 0.8);
    }
}

@keyframes automix-text-glow {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
    }

    50% {
        text-shadow: 0 0 15px rgba(139, 92, 246, 0.8), 0 0 30px rgba(99, 102, 241, 0.5);
    }
}

.ctrl-btn.mode-btn.mixing {
    animation: automix-pulse 1.5s ease-in-out infinite !important;
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
}

.ctrl-btn.mode-btn.mixing .btn-label {
    animation: automix-text-glow 1.5s ease-in-out infinite !important;
    color: #8b5cf6 !important;
}

.play-btn {
    width: 52px;
    height: 52px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    box-shadow: var(--glow);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.4);
}

.skip-btn {
    font-size: 11px;
    font-weight: 700;
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.player-progress span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 40px;
}

.player-progress input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 4px;
    cursor: pointer;
}

.player-progress input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-1);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: all 0.2s ease;
}

.player-progress input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.player-right {
    min-width: 200px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.volume-control-vertical {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-icon {
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.volume-icon:hover {
    color: var(--text-primary);
}

#volumeBar {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 4px;
    cursor: pointer;
}

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

/* Up Next Info */
.up-next-info {
    text-align: right;
    min-width: 140px;
}

.up-next-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 4px;
}

.up-next-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-next-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    .sidebar {
        display: none;
    }

    .main {
        grid-column: 1;
        grid-row: 1;
    }

    .player-bar {
        grid-column: 1;
        grid-row: 2;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .content {
        padding-bottom: 100px;
    }

    .now-playing,
    .player-right {
        min-width: auto;
    }

    .up-next-info {
        display: none;
    }
}

/* ============================================
   ADDITIONAL FIXES FOR DARK THEME
   ============================================ */

/* Form Inputs */
input[type="text"],
input[type="url"],
input[type="number"],
input[type="search"],
textarea {
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Select Dropdowns */
select {
    padding: 12px 38px 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all 0.3s ease;
}

select:hover,
select:focus {
    outline: none;
    border-color: var(--accent-1);
    background-color: rgba(99, 102, 241, 0.05);
}

select option {
    background: #1a1a24;
    color: var(--text-primary);
    padding: 10px;
}

/* Generic Button Styles */
button,
.btn,
input[type="button"],
input[type="submit"] {
    font-family: inherit;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover,
.btn:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
    background: var(--bg-hover);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

/* Primary Button */
.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
    color: white;
}

/* Fix table row backgrounds - ensure no white backgrounds */
.song-table tbody tr {
    background: transparent;
}

.song-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.song-table tbody tr:hover {
    background: var(--bg-hover);
}

.song-table tbody tr.playing {
    background: rgba(99, 102, 241, 0.08) !important;
}

.song-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.05) !important;
}

/* Row Number */
.row-number {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* File input hidden */
input[type="file"] {
    display: none;
}

/* Fix SVG icons visibility */
svg {
    flex-shrink: 0;
}

/* ============================================
   MOBILE RESPONSIVE - 768px (Tablet Small)
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        gap: 12px;
    }

    .search-box {
        max-width: 240px;
    }

    .view-controls {
        display: none;
    }

    .content {
        padding: 12px;
    }

    /* Hide some columns on mid-size screens */
    .song-table th:nth-child(3),
    .song-table td:nth-child(3),
    .song-table th:nth-child(4),
    .song-table td:nth-child(4) {
        display: none;
    }

    .player-bar {
        padding: 12px;
        gap: 12px;
    }
}

/* ============================================
   MOBILE RESPONSIVE - 480px (Phone)
   ============================================ */
@media (max-width: 480px) {
    .app {
        grid-template-rows: 1fr auto;
        min-height: 100dvh;
    }

    .header {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        height: auto;
        background: rgba(5, 5, 8, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .search-box {
        max-width: 100%;
        width: 100%;
        height: 36px;
    }

    .search-box input {
        padding: 8px 36px;
        font-size: 13px;
    }

    .header-actions {
        justify-content: space-between;
    }

    .view-controls {
        display: none;
    }

    .content {
        padding: 8px;
        padding-bottom: 200px;
        /* Thêm khoảng trống để không bị Player Bar che */
    }

    /* Song Cards - More Compact */
    .song-table {
        display: block;
        width: 100%;
    }

    .song-table thead {
        display: none;
    }

    .song-table tbody {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .song-table tr {
        display: grid;
        grid-template-areas:
            "info info"
            "badges badges"
            "actions actions";
        grid-template-columns: 1fr auto;
        padding: 12px;
        background: var(--bg-secondary);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        gap: 12px;
    }

    .song-table td {
        display: block;
        padding: 0;
        border: none;
    }

    /* Column 1: Hide STT */
    .song-table td:nth-child(1) {
        display: none;
    }

    /* Column 4: Song Title & info (Primary Area) */
    .song-table td:nth-child(4) {
        grid-area: info;
        display: block;
    }

    /* Column 2 & 3: Quality & BPM (Badges Area) */
    .song-table td:nth-child(2),
    .song-table td:nth-child(3) {
        grid-area: badges;
        display: inline-flex;
        align-items: center;
        width: auto !important;
        margin-right: 8px;
    }

    /* Column 5: Producer (Secondary info) */
    .song-table td:nth-child(5) {
        display: block;
        grid-area: info;
        /* Keep with info */
        margin-top: 4px;
        opacity: 0.7;
    }

    /* Column 6: Duration */
    .song-table td:nth-child(6) {
        grid-area: badges;
        display: inline-flex;
        margin-left: auto;
        color: var(--text-muted);
    }

    .song-info-cell {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .song-info-cell img {
        width: 40px;
        height: 40px;
        border-radius: 6px;
    }

    .song-title-text {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .song-artist-text {
        font-size: 12px;
        color: var(--text-secondary);
        opacity: 0.8;
    }

    /* Badges Row */
    .song-table td:nth-child(3),
    .song-table td:nth-child(4),
    .song-table td:nth-child(5) {
        grid-area: badges;
        display: inline-flex;
        align-items: center;
        width: auto !important;
        margin-right: 8px;
    }

    .quality-badge,
    .bpm-badge {
        padding: 2px 8px;
        font-size: 10px;
        height: 20px;
    }

    .duration-cell {
        color: var(--text-muted);
        font-size: 11px;
    }

    /* Actions Row */
    .song-table td:last-child {
        grid-area: actions;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .song-table td:last-child .btn-icon {
        width: 32px;
        height: 32px;
    }

    /* Player Bar - Professional Mobile Layout */
    .player-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 12px calc(15px + env(safe-area-inset-bottom, 0));
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 2000;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }

    .now-playing {
        width: 100%;
        gap: 10px;
    }

    .now-playing img {
        width: 36px;
        height: 36px;
        border-radius: 4px;
    }

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

    .song-title {
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .song-artist {
        font-size: 10px;
        opacity: 0.7;
    }

    .player-center {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .player-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0 4px;
    }

    /* Hide Secondary Buttons on very small screens to avoid crowding */
    .ctrl-btn.skip-btn,
    .ctrl-btn.auto-mix-btn,
    .ctrl-btn.shuffle-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    /* Hide +/- 30s buttons on mobile to reduce clutter */
    #back30Btn,
    #fwd30Btn {
        display: none !important;
    }

    .play-btn {
        width: 44px;
        height: 44px;
        background: var(--accent-gradient);
        border: none;
    }

    .player-progress {
        width: 100%;
        gap: 8px;
    }

    .player-progress span {
        font-size: 10px;
        min-width: 30px;
    }

    /* Pagination */
    .pagination {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin: 15px 0;
    }

    .pagination button {
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 12px;
    }
}

/* ============================================
   EXTRA SMALL PHONES - 360px
   ============================================ */
@media (max-width: 360px) {
    .song-info-cell img {
        width: 40px;
        height: 40px;
    }

    .song-title-text {
        font-size: 14px;
    }

    .ctrl-btn {
        width: 40px;
        height: 40px;
    }
}


/* Sidebar Footer - Login Button (now at top) */
.sidebar-footer {
    margin-bottom: 20px;
    /* Changed from margin-top */
    padding-bottom: 20px;
    /* Changed from padding-top */
    border-bottom: 1px solid var(--glass-border);
    /* Changed from border-top */
    flex-shrink: 0;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.login-btn svg {
    width: 18px;
    height: 18px;
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.3s;
}

.user-info:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: var(--error);
}

/* Favorite Button */
.song-favorite {
    text-align: center;
    padding: 8px !important;
}

.favorite-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #ec4899;
}

.favorite-btn.active:hover {
    transform: scale(1.15);
}

/* Player Favorite Button */
.player-favorite-btn {
    margin-left: 12px;
    flex-shrink: 0;
}

.player-favorite-btn svg {
    width: 22px;
    height: 22px;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
}