/* Force queue button background to black always */
.volume-controls .queue-right {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: #ec407a;
    min-width: 0;
    font-size: 18px;
}
.volume-controls .queue-right:hover,
.volume-controls .queue-right:focus {
    background: #181818 !important;
}
/* Queue button at far right of player bar */
.player > .queue-right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #181818;
    border: 1px solid rgba(236, 64, 122, 0.3);
    color: #ec407a;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 4100;
    display: flex;
    align-items: center;
    gap: 6px;
}
/* Action buttons for table rows */
.table-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255,255,255,0.06);
    color: #b3b3b3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.18s, color 0.18s, transform 0.15s;
    outline: none;
}
.action-btn:active {
    transform: scale(0.96);
}
.action-btn.edit {
    background: rgba(33, 150, 243, 0.13);
    color: #2196f3;
}
.action-btn.edit:hover {
    background: #2196f3;
    color: #fff;
    box-shadow: 0 4px 16px rgba(33,150,243,0.18);
}
.action-btn.delete {
    background: rgba(244, 67, 54, 0.13);
    color: #f44336;
}
.action-btn.delete:hover {
    background: #f44336;
    color: #fff;
    box-shadow: 0 4px 16px rgba(244,67,54,0.18);
}
.action-btn.view {
    background: rgba(76, 175, 80, 0.13);
    color: #4caf50;
}
.action-btn.view:hover {
    background: #4caf50;
    color: #fff;
    box-shadow: 0 4px 16px rgba(76,175,80,0.18);
}
/* General button styles for dashboard */
.btn {
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    background: rgba(255,255,255,0.07);
    color: #fff;
}
.btn-secondary {
    background: rgba(255,255,255,0.10);
    color: #b3b3b3;
    border: 1px solid rgba(255,255,255,0.13);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
    transform: translateY(-1px);
}
/* Dropdown menu for admin avatar/profile */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #232323;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 1000;
    padding: 10px 0;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: #333;
}
.dropdown-divider {
    height: 1px;
    background: #444;
    margin: 5px 0;
}
:root {
    --sidebar-width: 250px;
    --player-height: 70px;
    --bg-base: #121212;
    --bg-highlight: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #ec407a;
    --pink-light: #f8bbd0;
    --pink-mid: #f48fb1;
    --pink-dark: #ec407a;
    --nav-width: 260px; /* width of left secondary content bar */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px; /* Giảm kích thước font cơ sở so với phiên bản trước */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    height: 100vh;
    display: grid;
    grid-template:
        "header header" 80px
        "nav main" 1fr
        "player player" 90px
        / var(--nav-width) 1fr;
    overflow: hidden;
}

/* Header (Top Bar) */
.header {
    grid-area: header;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid rgba(236, 64, 122, 0.2);
    z-index: 100;
    height: 80px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo img:hover {
    transform: scale(1.1);
}

.home-icon {
    color: var(--accent-color);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.home-icon:hover {
    transform: scale(1.1);
    color: var(--pink-light);
}

.header-center {
    flex: 1;
    max-width: 750px;
    margin: 0 auto;
    position: relative;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-highlight);
    padding: 12px 20px;
    border-radius: 28px;
    width: 100%;
    border: 1px solid rgba(236, 64, 122, 0.3);
    transition: all 0.3s ease;
}

.header-search:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(236, 64, 122, 0.1);
}

.header-search .search-icon {
    color: var(--accent-color);
    font-size: 20px;
}

.header-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 17px;
    padding: 8px;
}

.header-search input:focus {
    outline: none;
}

.header-search input::placeholder {
    color: var(--text-secondary);
}

.header-search .filter-toggle {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.header-search .filter-toggle:hover {
    color: var(--accent-color);
    background: rgba(236, 64, 122, 0.1);
}

.header-search .filter-toggle.active {
    color: var(--accent-color);
    background: rgba(236, 64, 122, 0.15);
}

/* Khi có filter đang được áp dụng */
.header-search .filter-toggle.has-filters {
    color: #fff;
    background: linear-gradient(135deg, #ec407a, #d81b60);
    box-shadow: 0 2px 8px rgba(236, 64, 122, 0.4);
}

.header-search .filter-toggle.has-filters:hover {
    background: linear-gradient(135deg, #f06292, #ec407a);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.5);
}

/* Search Filter Dropdown */
.search-filter-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--bg-highlight);
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 16px;
    padding: 20px;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-filter-panel.show {
    display: block;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(236, 64, 122, 0.2);
}

.filter-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.filter-clear {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.filter-clear:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.filter-item select,
.filter-item input {
    background: var(--bg-base);
    border: 1px solid rgba(236, 64, 122, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(236, 64, 122, 0.1);
}

.filter-item select {
    cursor: pointer;
}

.filter-item input[type="range"] {
    padding: 0;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* Active Filters Tags */
.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-tag {
    background: rgba(236, 64, 122, 0.15);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.filter-tag i {
    cursor: pointer;
    font-size: 11px;
    transition: color 0.3s ease;
}

.filter-tag i:hover {
    color: var(--text-primary);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    margin-top: 20px;
    border-top: 1px solid rgba(236, 64, 122, 0.2);
    position: sticky;
    bottom: 0;
    background: var(--bg-highlight);
    padding-bottom: 4px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ec407a, #d81b60);
    color: #fff;
    box-shadow: 0 2px 8px rgba(236, 64, 122, 0.4);
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, #f06292, #ec407a);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.5);
}

.filter-btn.cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-btn.cancel:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

.filter-btn.apply {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 2px 8px rgba(236, 64, 122, 0.3);
}

.filter-btn.apply:hover {
    background: #d81b60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-button {
    padding: 10px 20px;   /* Điều chỉnh padding của nút */
    font-size: 16px;      /* Điều chỉnh cỡ chữ nút */
    font-weight: 600;
    border-radius: 22px;
}

/* Navigation Sidebar */
.nav-container {
    /* Secondary content bar on the left */
    grid-area: nav;
    background: var(--bg-base);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid rgba(236, 64, 122, 0.08);
    width: 260px;                /* fixed sidebar width on desktop */
    min-width: 220px;
    box-sizing: border-box;
    position: sticky;            /* keep visible while scrolling */
    top: 16px;
    height: calc(100vh - 32px);
    overflow-y: auto;
    scroll-behavior: smooth;
}

.nav-section {
    background: transparent;
    border-radius: 0;
    padding: 16px;
    border: none;
}

/* Compact variant for when sidebar should be slimmed down */
.nav-container.compact {
    width: 84px;
    min-width: 84px;
}

.nav-container.compact .nav-section {
    padding: 10px;
    text-align: center;
}

.nav-container.compact .nav-section .create-playlist-text { display: none; }

/* Small screen: collapse the sidebar under the header */
@media (max-width: 900px) {
    .nav-container {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        display: block;
        padding: 8px 0;
        margin-bottom: 18px;
    }

    /* Stack main content under the sidebar area */
    .main-content {
        padding: 16px;
    }
}

.nav-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-size: 20px;     /* Điều chỉnh cỡ chữ tiêu đề sidebar */
    margin-bottom: 16px;
}

.nav-section-title i {
    color: var(--accent-color);
    cursor: pointer;
}

/* Add Playlist Icon Button */
.add-playlist-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec407a 0%, #ff6090 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(236, 64, 122, 0.3);
}

.add-playlist-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.5);
}

.add-playlist-icon i {
    color: white;
    font-size: 16px;
}

.nav-menu {
    list-style: none;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 16px;     /* Điều chỉnh cỡ chữ menu */
}

.nav-menu li a i {
    color: var(--accent-color);
    font-size: 18px;     /* Điều chỉnh kích thước icon */
}

.create-playlist {
    padding: 16px;
}

.create-playlist-text {
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.create-playlist-btn {
    width: 100%;
    background: linear-gradient(135deg, #ec407a 0%, #ff6090 100%);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(236, 64, 122, 0.3);
}

.create-playlist-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.5);
}

.create-playlist-btn i {
    font-size: 14px;
}

/* Main Content */
.main-content {
    grid-area: main;
    background: linear-gradient(to bottom, rgba(236, 64, 122, 0.1), var(--bg-base));
    padding: 32px 48px;
    overflow-y: auto;
    max-width: 100%;
}

.section-title {
    font-size: 32px;     /* Tăng size tiêu đề lên */
    margin-bottom: 24px;
    margin-top: 20px;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 45px;
    height: 3px;         /* Điều chỉnh độ dày của gạch chân */
     margin-top: 0 !important;
     padding-top: 0 !important;
    background: var(--accent-color);
}

.section-subtitle {
    font-size: 18px;     /* Điều chỉnh cỡ chữ phụ đề */
    margin-bottom: 22px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Tăng size card lên */
    gap: 28px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-highlight);
    padding: 20px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 1px solid rgba(236, 64, 122, 0.15);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(236, 64, 122, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 12px 24px rgba(236, 64, 122, 0.3);
}

.card-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.card-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .card-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(236, 64, 122, 0.4);
}

.play-button:hover {
    background: var(--pink-dark);
    transform: scale(1.1);
}

.card-info {
    position: relative;
    z-index: 1;
}

.card-title {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-stats {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-stats i {
    color: var(--accent-color);
    font-size: 12px;
}

.artist-card img {
    border-radius: 50%;
}

.ranking-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
}

.ranking-number {
    font-size: 28px;     /* Điều chỉnh cỡ chữ số thứ tự */
    font-weight: 700;
    color: var(--accent-color);
    min-width: 30px;
}

.ranking-info {
    flex: 1;
}

.ranking-img {
    width: 60px;         /* Điều chỉnh kích thước ảnh */
    height: 60px;
    border-radius: 4px;
}

.ranking-info h3 {
    font-size: 18px;
}

.ranking-info p {
    font-size: 16px;
}

/* Player Bar */
.player {
    grid-area: player;
    background: linear-gradient(180deg, rgba(24, 24, 40, 0.98) 0%, rgba(18, 18, 28, 0.99) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(236, 64, 122, 0.25);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 90px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
}

/* Make player fixed at bottom on all non-admin pages */
body:not(.admin) .player,
.player.fixed-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

/* Keep original player flow inside admin panel (admin uses .admin-container) */
.admin-container .player {
    position: relative !important;
    bottom: auto !important;
    z-index: auto !important;
}

/* Add bottom padding to main content so fixed player doesn't overlap */
.main-content {
    padding-bottom: calc(100px + 24px); /* player height + breathing room */
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 220px;
    max-width: 280px;
}

.now-playing img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.now-playing img:hover {
    transform: scale(1.05);
}

.now-playing-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.now-playing-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.now-playing-artist {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Position volume controls at right edge of the player */
.player .volume-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
    justify-content: flex-end;
}

.player-controls button {
    font-size: 18px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 50%;
}

.player-controls button:hover {
    color: #ec407a;
    background: rgba(236, 64, 122, 0.1);
    transform: scale(1.1);
}

.player-controls button.active {
    color: #ec407a;
}

.player-controls .play-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
    background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(236, 64, 122, 0.4);
}

.player-controls .play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(236, 64, 122, 0.5);
    background: linear-gradient(135deg, #f06292 0%, #ec407a 100%);
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    flex: 1;
    max-width: 400px;
    transition: height 0.15s ease;
}

.progress-bar:hover {
    height: 6px;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #ec407a 0%, #f06292 100%);
    border-radius: 4px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar:hover .progress::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Player progress placed below controls */
.player-progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 0 10px;
}

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 600px;
}

/* allow child controls to receive pointer events */
.player-center .player-controls,
.player-center .player-progress {
    width: 100%;
    justify-content: center;
}

.player .time-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    min-width: 40px;
    font-weight: 500;
}

/* On narrow screens stack controls and progress vertically */
@media (max-width: 720px) {
    .player {
        flex-direction: column;
        align-items: center;
        padding: 10px 16px;
        gap: 8px;
        height: auto;
        min-height: 80px;
    }

    .now-playing {
        order: 1;
        width: 100%;
        justify-content: center;
        min-width: unset;
        max-width: unset;
    }

    .player-center {
        order: 2;
        width: 100%;
        max-width: 100%;
    }

    .player-controls {
        justify-content: center;
        gap: 16px;
    }

    .player-progress {
        width: 100%;
    }

    .progress-bar {
        max-width: 100%;
    }

    .player .volume-controls {
        order: 3;
        justify-content: center;
        min-width: unset;
    }
}

.progress-bar:hover .progress {
    background: linear-gradient(90deg, #ec407a 0%, #f06292 100%);
}

.progress {
    height: 100%;
    background: var(--text-secondary);
    border-radius: 2px;
    width: 30%;
}

.volume-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: visible;
    min-width: 36px;
    width: auto;
    z-index: 4001;
}

.volume-controls i {
    font-size: 18px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    margin: 0;
}

/* Vertical volume slider hidden by default; appears on hover */
.volume-controls .progress-bar {
    position: absolute;
    left: 2px;
    bottom: calc(36px + 2px);
    transform: none;
    /* Always visible when .show-volume is present */
    width: 6px;
    height: 84px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    cursor: pointer;
    align-items: flex-end;
    margin: 0;
    transition: background 0.18s, opacity 0.18s, visibility 0.18s;
    flex-direction: column;
    z-index: 4100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.volume-controls.show-volume .progress-bar {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
}

.volume-controls .progress-bar .progress {
    width: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    height: 60%; /* will be set by JS */
    transition: height 0.18s;
    position: absolute;
    bottom: 0;
    left: 0;
    /* Fill grows from bottom up */
    transform: none;
}

/* show vertical volume when hovering the volume icon or the player */
/* No hover for horizontal slider */

/* pointer-friendly area */
.volume-controls .progress-bar.vertical { padding: 6px 0; }

/* Volume percent badge */
.volume-percent {
    display: inline-block;
    min-width: 36px;
    text-align: center;
    font-size: 12px;
    color: white;
    background: rgba(0,0,0,0.45);
    padding: 4px 6px;
    border-radius: 12px;
    margin-left: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* show percent on hover/focus */
.volume-controls:hover .volume-percent,
.player:hover .volume-controls .volume-percent,
.volume-controls:focus-within .volume-percent {
    opacity: 1;
    transform: translateY(0);
}

/* Position percent badge near the speaker icon and above slider when overlaying */
.volume-controls .volume-percent {
    display: none; /* hide percent badge as requested */
}

/* Popup styles */
.spotify-style-popup h2 {
    font-size: 28px !important;  /* Điều chỉnh cỡ chữ tiêu đề popup xuống 28px */
    margin-bottom: 14px !important;
}

.spotify-style-popup p {
    font-size: 18px !important;  /* Điều chỉnh cỡ chữ nội dung popup */
    line-height: 1.5 !important;
}

.popup-primary-btn,
.popup-secondary-btn {
    font-size: 16px !important;  /* Điều chỉnh cỡ chữ nút popup */
    padding: 12px 24px !important;
}

/* Notification styles */
.notification {
    font-size: 16px;
}

.notification-icon {
    font-size: 22px;
}

/* User dropdown */
.user-dropdown {
    background: var(--bg-highlight);
    border-radius: 4px;
    padding: 4px;
    box-shadow: 0 16px 24px rgba(0,0,0,.5);
    z-index: 1000;
    border: 1px solid rgba(236, 64, 122, 0.3);
}

.user-dropdown ul {
    list-style: none;
}

.user-dropdown li a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    font-size: 16px;
}

.user-dropdown li a:hover {
    background: rgba(236, 64, 122, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-highlight);
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 20px;
    padding: 5px 14px 5px 5px;
    cursor: pointer;
}

.user-menu:hover {
    background: rgba(236, 64, 122, 0.1);
}

.user-menu img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-menu .username {
    font-size: 16px;
}

/* Media queries for responsiveness with larger text */
@media screen and (max-width: 1200px) {
    body {
        grid-template:
            "header" 70px
            "nav" auto
            "main" 1fr
            "player" 80px
            / 1fr;
    }
    
    .nav-container {
        border-right: none;
        border-bottom: 1px solid rgba(236, 64, 122, 0.2);
    }
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(236, 64, 122, 0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(236, 64, 122, 0.2);
}

.user-info:hover {
    background: rgba(236, 64, 122, 0.2);
    border-color: var(--accent-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info i {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.user-info:hover i {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-highlight);
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 12px;
    min-width: 200px;
    padding: 8px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background: rgba(236, 64, 122, 0.1);
    color: var(--accent-color);
}

.user-dropdown a i {
    width: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-dropdown a:hover i {
    color: var(--accent-color);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.user-dropdown #logoutButton {
    color: #ff5252;
}

.user-dropdown #logoutButton:hover {
    background: rgba(255, 82, 82, 0.1);
}

.user-dropdown #logoutButton i {
    color: #ff5252;
}

@media screen and (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .header-logo img {
        height: 35px; /* Logo nhỏ hơn trên thiết bị nhỏ */
    }
    
    .home-icon {
        font-size: 24px; /* Biểu tượng nhà nhỏ hơn trên thiết bị nhỏ */
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .header-center {
        width: 100%;
        margin: 10px 0;
    }
    
    .auth-button {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    .header-logo img {
        height: 30px;
    }
    
    .home-icon {
        font-size: 20px;
    }
}

/* ==================== Share Modal Styles ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-container {
    background: var(--bg-highlight);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(236, 64, 122, 0.2);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close:hover {
    background: rgba(236, 64, 122, 0.1);
    color: var(--accent-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.share-content-info {
    background: rgba(236, 64, 122, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 3px solid var(--accent-color);
}

.share-content-info strong {
    color: var(--text-primary);
    font-size: 16px;
}

/* Share Tabs */
.share-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(236, 64, 122, 0.2);
}

.share-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.share-tab:hover {
    color: var(--text-primary);
    background: rgba(236, 64, 122, 0.05);
}

.share-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.share-tab svg {
    width: 16px;
    height: 16px;
}

/* Tab Content */
.share-tab-content {
    display: none;
}

.share-tab-content.active {
    display: block;
}

/* Share URL Container */
.share-url-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.share-url-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-base);
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.share-url-input:focus {
    border-color: var(--accent-color);
}

.btn-copy,
.btn-copy-embed {
    padding: 12px 20px;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover,
.btn-copy-embed:hover {
    background: var(--pink-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.4);
}

.btn-copy svg,
.btn-copy-embed svg {
    width: 16px;
    height: 16px;
}

/* Social Share Section */
.social-share-section {
    margin-top: 24px;
}

.section-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.social-btn {
    padding: 12px 16px;
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 8px;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-btn.facebook {
    border-color: #1877f2;
}

.social-btn.facebook:hover {
    background: #1877f2;
    color: white;
}

.social-btn.twitter {
    border-color: #1da1f2;
}

.social-btn.twitter:hover {
    background: #1da1f2;
    color: white;
}

.social-btn.whatsapp {
    border-color: #25d366;
}

.social-btn.whatsapp:hover {
    background: #25d366;
    color: white;
}

.social-btn.telegram {
    border-color: #0088cc;
}

.social-btn.telegram:hover {
    background: #0088cc;
    color: white;
}

.social-btn svg {
    width: 16px;
    height: 16px;
}

/* Native Share Button */
.btn-native-share {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: linear-gradient(135deg, var(--accent-color), var(--pink-dark));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-native-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 64, 122, 0.4);
}

.btn-native-share svg {
    width: 16px;
    height: 16px;
}

/* Embed Size Section */
.embed-size-section {
    margin-bottom: 20px;
}

.size-options {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.size-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-base);
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.size-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Embed Code Container */
.embed-code-container {
    margin-bottom: 24px;
}

.embed-code-textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    background: var(--bg-base);
    border: 1px solid rgba(236, 64, 122, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    outline: none;
    margin-bottom: 12px;
}

.embed-code-textarea:focus {
    border-color: var(--accent-color);
}

/* Embed Preview */
.embed-preview-section {
    margin-top: 24px;
}

.embed-preview {
    margin-top: 12px;
    background: var(--bg-base);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(236, 64, 122, 0.2);
}

.embed-preview iframe {
    width: 100%;
    border-radius: 12px;
}

/* Basic Modal Styles (for create playlist modal) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(236, 64, 122, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(236, 64, 122, 0.05) 0%, transparent 100%);
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.25s ease;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(236, 64, 122, 0.2);
    color: var(--accent-color);
    transform: rotate(90deg);
}

.modal form {
    padding: 28px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(236, 64, 122, 0.1);
    transform: translateY(-1px);
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(236, 64, 122, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(236, 64, 122, 0.15);
    transition: all 0.3s ease;
}

.checkbox-group:hover {
    background: rgba(236, 64, 122, 0.08);
    border-color: rgba(236, 64, 122, 0.25);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.form-actions .btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #ec407a 0%, #ff6090 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.3);
}

.form-actions .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(236, 64, 122, 0.5);
    transform: translateY(-2px);
}

/* Responsive */
@media screen and (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }

    .share-url-container {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .form-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* On larger screens keep progress narrower and centered under the play button */
@media (min-width: 721px) {
    .player-progress .progress-bar {
        width: 260px;
    }
}