/* VARIABLES & CONFIGURATION */
:root {
  /* Colors */
  --bg-color: #f4f6f8;
  --text-primary: #1a1a1a;
  --text-secondary: #636e72;
  --accent-color: #2d3436;
  --highlight-color: #ff4757;
  --success-color: #00b894;
  --danger-color: #ff7675;

  /* Dimensions */
  --header-height: 70px;
  --sidebar-width: 400px;
  --card-width: 70vw;
  --card-height: 70vw;

  /* Animations */
  --ease-elastic: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-smooth: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lib-filters, 
.grid-artist {
  scrollbar-width: none;  
  -ms-overflow-style: none; 
}

.lib-filters::-webkit-scrollbar,
.grid-artist::-webkit-scrollbar {
  display: none;
}

/* Responsive Variables Overrides */
@media (min-width: 768px) {
  :root {
    --card-width: 320px;
    --card-height: 320px;
    #player-drag-handle { display: none; }
  }
}

@media (min-width: 1024px) {
  :root {
    --card-width: 450px;
    --card-height: 450px;
  }
}


/* GLOBAL RESET & BASE STYLES */
html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);

  overflow-x: clip;
  overflow-y: auto;  
  height: auto;     
  transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

body {
  scrollbar-width: thin; 
  scrollbar-color: #ccc transparent;
  overscroll-behavior-x: none; 
}

/* Body State when Sidebar is open */
body.sidebar-is-open {
  padding-left: var(--sidebar-width);
}

h1 {
  font-size: 40px;
  letter-spacing: 1px;
}

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  font-family: inherit;
}


/* UTILITIES & GLOBAL ANIMATIONS */
.hidden {
  display: none !important;
}

.view-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;

  margin-top: 90px;
  overflow: visible !important;
  animation: none;

  animation: fadeIn 0.4s ease;
  margin-top: 90px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; } /* QUAN TRỌNG: transform phải là none */
}


/* COMPONENT: HEADER & LOGO */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  box-sizing: border-box;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.95);
}

/* Logo Styles */
.logo {
  display: flex;
  align-items: center;
  user-select: none;
  margin: 0;
  padding: 0;
  transform: translateX(-50px);
}

.logo-img {
  height: 70px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover .logo-img {
  transform: rotate(-10deg) scale(1.1);
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #059669 0%, #0284C7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
  line-height: 1;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
  top: 2px;
  right: 35px;
}

/* COMPONENT: SEARCH */
.search-wrapper {
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 50vw;
  margin: 0;
  z-index: 20;
}

.search-wrapper input {
  width: 100%;
  padding: 10px 50px 10px 40px;
  border-radius: 50px;
  border: 1px solid #e1e1e1;
  background: #f4f6f8;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: 0.3s;
}

.search-wrapper input:focus {
  background: #fff;
  border-color: #ccc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: #888;
  pointer-events: none;
}

#btn-search-trigger {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  z-index: 22;
  transition: background 0.2s;
}

#btn-search-trigger:hover {
  background: #000;
}

.btn-delete-history {
    flex-shrink: 0 !important; 
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: all 0.2s;
}

.btn-delete-history:hover {
    color: #ff4757; 
    background: rgba(255, 71, 87, 0.1);
}

/* COMPONENT: USER ICON */
/* --- USER MENU & DROPDOWN STYLES --- */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.user-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden; 
    padding: 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.user-icon-btn:hover {
    background-color: #f4f6f8;
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-dropdown-menu {
    position: absolute;
    top: 55px; 
    right: 0;
    width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid #f0f0f0;
    z-index: 3000;
    padding: 8px 0;
    animation: slideDownFade 0.2s ease;
}

.dropdown-triangle {
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-top: 1px solid #f0f0f0;
    border-left: 1px solid #f0f0f0;
}

.dropdown-header-info {
    padding: 8px 20px;
    display: flex;
    flex-direction: column;
}

.user-name-bold {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-role-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--accent-color);
}

.dropdown-item:hover i {
    color: var(--accent-color);
}

.dropdown-item.danger {
    color: var(--danger-color);
}

.dropdown-item.danger:hover {
    background-color: #fff0f0;
}

.dropdown-item.danger i {
    color: var(--danger-color);
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.divider {
    height: 1px;
    background-color: #eee;
    margin: 6px 0;
}

.header-user-section {
    position: relative;
    margin-left: auto;
}

.user-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-icon-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: transparent;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 12px;
    overflow: hidden;
    z-index: 3000;
    border: 1px solid #eee;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: #f4f6f8;
    color: var(--accent-color);
}

/* Suggestions Box */
.suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  margin-top: 10px;
  z-index: 2002;
  overflow: hidden;
  border: 1px solid #eee;
  max-height: 300px;
  overflow-y: auto;
}

.suggestion-header {
  padding: 10px 20px 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  background: #fff;
}

.suggestion-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 15px !important;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  border-bottom: 1px solid #f9f9f9;
  background: white;
}

.suggestion-left {
  display: flex !important;
  align-items: center;
  gap: 12px;
  flex: 1;          
  min-width: 0;     
  margin-right: 10px; 
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f4f6f8;
}

.suggestion-item i {
  color: #b2bec3;
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
}

.suggestion-text {
  display: block;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.suggestion-active {
  background-color: #f0f0f0 !important; 
  border-left: 3px solid var(--accent-color); 
}

.search-header {
  position: sticky !important;          
  top: 70px !important;
  z-index: 900;
  display: flex;
  align-items: flex-start !important;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px 0;
  background-color: rgba(244, 246, 248, 0.95);
  -webkit-backdrop-filter: blur(10px); 
  backdrop-filter: blur(10px);         
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.btn-text {
  background: none;
  border: 1px solid #ccc;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.btn-text:hover {
  background: var(--highlight-color);
  color: white;
  border-color: transparent;
}


/* COMPONENT: SIDEBAR & NAVIGATION */
/* Floating Menu Button */
.floating-menu-btn {
  position: fixed;
  top: 85px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1000;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  opacity: 1;
  visibility: visible;
}

.floating-menu-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: transparent;
}

body.sidebar-is-open .floating-menu-btn {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
}

/* Sidebar Container */
.sidebar {
  position: fixed;
  top: 70px;
  left: 0;
  height: calc(100% - 70px);
  width: var(--sidebar-width);
  background: #fff;
  z-index: 1500;
  border-right: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  padding: 15px 0;
  box-sizing: border-box;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.open {
  transform: translateX(0);
}

/* Library Toggle Button in Sidebar */
#btn-toggle-library {
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

#btn-toggle-library:hover {
  color: var(--accent-color);
}

#btn-toggle-library:hover i {
  color: var(--danger-color);
}

/* Sidebar Content Styles */
.lib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 15px 20px;
}

.lib-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lib-actions {
  display: flex;
  gap: 5px;
}

.lib-icon-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.lib-icon-btn:hover {
  background: #f0f0f0;
  color: var(--text-primary);
}

.lib-filters {
  display: flex;
  gap: 10px;
  padding: 0 20px 15px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.lib-filters::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  background: #f4f6f8;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
}

.chip.active {
  background: var(--accent-color);
  color: white;
}

.lib-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 5px 10px;
}

.lib-content::-webkit-scrollbar {
  width: 4px;
}

.lib-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* Library Items */
.lib-item {
  display: flex;
  position: relative;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.lib-item:hover {
  background-color: #f4f6f8;
}

.lib-img-square, .lib-img-circle, .lib-img-box {
  width: 50px;
  height: 50px;
  margin-right: 12px;
  object-fit: cover;
}

.lib-img-square, .lib-img-box {
  border-radius: 6px;
}

.lib-img-circle {
  border-radius: 50%;
}

.liked-gradient {
  background: linear-gradient(135deg, #450af5, #c4efd9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.lib-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.lib-info p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-delete-pl {
  opacity: 0;
  transition: opacity 0.2s;
}

.lib-item:hover .btn-delete-pl {
  opacity: 1;
}

.btn-delete-pl:hover {
  color: var(--danger-color) !important;
}

/* Create Playlist Feature */
.rotate-icon {
  transition: transform 0.3s ease, background-color 0.2s;
}

.rotate-icon.active {
  transform: rotate(45deg);
  color: var(--danger-color);
  background: #fff0f0;
}

.create-box {
  padding: 0 20px 10px 20px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.create-box.hidden {
  max-height: 0;
  opacity: 0;
  padding: 0 20px;
}

.create-box input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}


/* COMPONENT: HERO & COVERFLOW */
.hero-section {
  display: flex;
  position: relative;
  width: 100%;
  height: auto !important;
  min-width: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 90px;
  padding-bottom: 30px;
  background: linear-gradient(180deg, #fff 0%, var(--bg-color) 100%);
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Album Card */
.album-card {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  left: 50%;
  top: 50%;
  margin-left: calc(var(--card-width) * -0.5);
  margin-top: calc(var(--card-height) * -0.5);
  background-color: #fff;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  transition: transform 0.8s var(--ease-elastic), opacity 0.6s ease, filter 0.6s ease, box-shadow 0.6s ease;
  cursor: pointer;
  overflow: hidden;
}

.album-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Album Card States */
.album-card.active {
  transform: translateX(0) scale(1) translateZ(50px);
  z-index: 10;
  opacity: 1;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.album-card.prev {
  transform: translateX(-70%) scale(0.85) rotateY(30deg);
  z-index: 5;
  opacity: 0.6;
  filter: brightness(0.9) blur(1px);
}

.album-card.next {
  transform: translateX(70%) scale(0.85) rotateY(-30deg);
  z-index: 5;
  opacity: 0.6;
  filter: brightness(0.9) blur(1px);
}

.album-card.hidden {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

/* Album Info Overlay */
.album-info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  border-radius: 16px;
  color: var(--text-primary);
  transform: translateY(100px);
  opacity: 0;
  transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.album-card.active .album-info {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.2s;
}

.album-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.album-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Navigation Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.3s var(--ease-smooth);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nav-btn:hover {
  background: var(--accent-color);
  color: #fff;
  transform: translateY(-50%) scale(1.15);
}

.btn-left {
  left: calc(32% - 320px);
}

.btn-right {
  right: calc(32% - 320px);
}

/* --- LOADING: MUSIC WAVE --- */
.loading-wave {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 30px;
  gap: 5px;
}

.loading-bar {
  width: 5px;
  height: 10px;
  background-color: var(--accent-color); /* Tự ăn theo màu chủ đạo của web */
  border-radius: 5px;
  animation: wave-anim 0.8s ease-in-out infinite;
}

.loading-bar:nth-child(1) { animation-delay: 0.0s; }
.loading-bar:nth-child(2) { animation-delay: 0.1s; }
.loading-bar:nth-child(3) { animation-delay: 0.2s; }
.loading-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes wave-anim {
  0% { height: 10px; transform: scaleY(1); }
  50% { height: 30px; transform: scaleY(1.5); }
  100% { height: 10px; transform: scaleY(1); }
}

/* COMPONENT: MAIN CONTENT & GRIDS */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  overflow: visible !important; 
  contain: none !important;
}

.sub-section {
  margin-bottom: 60px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.see-all {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Grid Mood */
.grid-mood {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
}

.card-mood {
  position: relative;
  height: 100px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: 0.3s;
}

.card-mood:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-mood img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.card-mood span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Grid Genre */
.grid-genre {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card-genre {
  display: flex;
  align-items: center;
  background: white;
  padding: 15px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: 0.2s;
  border: 1px solid transparent;
}

.card-genre:hover {
  border-color: var(--accent-color);
  transform: scale(1.02);
}

.card-genre img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  margin-right: 15px;
}

.card-genre h4 {
  font-size: 1rem;
  font-weight: 600;
}

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

.card-artist {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.card-artist:hover {
    transform: translateY(-5px);
}

.card-artist img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    transition: box-shadow 0.3s ease;
}

.card-artist:hover img {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 2px solid var(--accent-color); 
}

.card-artist h4 {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    margin: 0;
}

/* Grid Standard */
.grid-standard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
}

.card-standard {
  cursor: pointer;
  transition: 0.3s;
}

.card-standard:hover img {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.card-standard .img-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.card-standard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s;
}

.card-standard h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;      
  display: box;              
    
  -webkit-line-clamp: 2;      
  line-clamp: 2;             
    
  -webkit-box-orient: vertical; 
  box-orient: vertical;         
    
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-standard p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}


/* COMPONENT: SONG LIST */
.song-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.song-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: white;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.song-item:hover {
  transform: translateX(5px);
  background-color: #f9f9f9;
}

/* Active Song Style */
.song-item.active {
  background-color: #eef2f5;
  border-left: 4px solid var(--accent-color);
}

.song-item.active .song-info h4 {
  color: var(--accent-color);
  font-weight: 700;
}

.song-item img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  margin-right: 15px;
  object-fit: cover;
}

.song-info h4 {
  font-size: 1rem;
  margin: 0;
}

.song-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 2px 0 0;
}


/* COMPONENT: PLAYER BAR */
.player-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 10px 25px;
  height: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  z-index: 3000;
  transition: transform 0.5s var(--ease-smooth), opacity 0.5s;
}

.hidden-bar {
  transform: translateY(150%) translateX(-50%);
  opacity: 0;
}

.player-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 5px;
}

/* Player Info */
.player-info {
  display: flex;
  align-items: center;
  width: 30%;
}

.player-info img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin-right: 12px;
  border: 2px solid #ddd;
}

.p-text h4 {
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.p-text p {
  font-size: 0.75rem;
  color: #666;
  margin: 0;
}

/* Spin Animation */
.spin-disk {
  animation: spin 4s linear infinite;
  animation-play-state: paused;
}

.playing .spin-disk {
  animation-play-state: running;
}

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

/* Player Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.player-controls button {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #555;
  transition: 0.2s;
}

.player-controls button:hover {
  color: var(--accent-color);
}

.active-btn {
  color: var(--success-color) !important;
}

#btn-dialog-cancel {
  transition: all 0.2s ease;
  border-radius: 18px !important; 
}

#btn-dialog-cancel:hover {
  color: white !important;          
  border-color: #ffffff !important;    
  transform: scale(1.15) !important;     
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#btn-dialog-confirm {
  width: auto; 
  height: 36px; 
  border: 1px solid black; 
  padding: 0 20px; 
  border-radius: 18px; 
  font-size: 0.9rem;
}

.main-play-btn {
  width: 45px;
  height: 45px;
  background: var(--accent-color) !important;
  color: white !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Heart Button */
.heart-btn {
  transition: transform 0.2s, color 0.2s;
}

.heart-btn i {
  color: #555;
}

.heart-btn:hover {
  transform: scale(1.1);
}

.heart-btn.active {
  color: #ff4757;
  animation: heartbeat 0.4s ease-in-out;
}

.heart-btn.active i {
  color: #ff4757;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Add Playlist Button */
.add-pl-btn {
  transition: transform 0.2s, color 0.2s;
  font-size: 1.1rem;
  color: #555;
}

.add-pl-btn:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

.add-pl-btn.success {
  color: var(--success-color) !important;
  animation: successPop 0.4s ease;
}

.add-pl-btn.success i::before {
  content: "\f00c"; /* FontAwesome check icon */
}

@keyframes successPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Close Player Button */
.close-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin-left: 10px;
}

.close-btn:hover {
  background: #d63031;
}

.close-btn i {
  line-height: 2;
  top: 1px;
  position: relative;
}

/* Player Extras & Volume */
.player-extras {
  display: flex;
  align-items: center;
  gap: 15px;
}

.volume-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#btn-volume {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  cursor: pointer;
}

#btn-volume:hover {
  background: #f0f0f0;
}

.volume-slider-box {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 110px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  opacity: 1;
  visibility: visible;
  z-index: 100;
}

.volume-slider-box.hidden {
  opacity: 0;
  visibility: hidden;
  bottom: 100%;
}

.volume-slider-box::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

#volume-slider {
  width: 80px;
  height: 4px;
  transform: rotate(-90deg);
  transform-origin: center;
  margin: 0;
  cursor: pointer;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.progress-container span {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
  width: 35px;
  text-align: center;
}

/* Range Input Customization */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #e1e1e1;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

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

/* GENRE FILTERS */
.genre-filter-container {
    display: flex !important;
    gap: 12px !important;   
    margin-top: 15px !important;
    overflow-x: auto !important; 
    overflow-y: hidden !important;
    touch-action: pan-x !important; 
    pointer-events: auto !important;
    width: 100% !important; 
    max-width: 100vw !important; 
    box-sizing: border-box !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    padding: 5px 20px 15px 20px !important; 
    -webkit-overflow-scrolling: touch !important; 
    scroll-snap-type: x proximity !important; 
    overscroll-behavior-x: contain !important; 
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.genre-filter-container::-webkit-scrollbar {
    display: none;
}

.filter-chip-btn {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Hiệu ứng click nảy hơn */
    flex: 0 0 auto !important; 
    white-space: nowrap !important;
    display: inline-block !important;
    scroll-snap-align: start; 
}

.filter-chip-btn.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: scale(1.05);
    
}

.filter-chip-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.filter-chip-ghost {
    opacity: 0 !important;       
    visibility: hidden !important;  
    border: none !important;      
    background: transparent !important; 
    box-shadow: none !important;  
    padding: 0 !important;          
    margin: 0 !important;
    pointer-events: none !important; 
    cursor: default !important;
    width: 20px !important;         
    height: 1px !important;         
    flex: 0 0 auto !important;     
}

/* COMPONENT: MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  width: 350px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.modal-header button {
  border: none;
  background: none;
  font-size: 1rem;
  cursor: pointer;
  color: #888;
}

.modal-header button:hover {
  color: var(--danger-color);
}

.modal-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px 0;
}

.modal-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: 0.2s;
}

.modal-item:hover {
  background: #f4f6f8;
}

.modal-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
}

.modal-item-info h4 {
  font-size: 0.95rem;
  margin: 0;
  font-weight: 600;
}

.modal-item-info p {
  font-size: 0.8rem;
  margin: 2px 0 0;
  color: #666;
}

button, 
.nav-btn, 
.card-mood, 
.card-genre, 
.logo {
  -webkit-user-select: none;
  -moz-user-select: none;    
  -ms-user-select: none;     
  user-select: none;         
}

/* --- CUSTOM DIALOG STYLES --- */
.dialog-content {
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dialog-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 10px;
}

.dialog-icon.danger {
  color: var(--danger-color);
}


.dialog-actions {
  display: flex !important;
  gap: 10px !important;       
  justify-content: center !important;
  flex-wrap: nowrap !important; 
  width: 100% !important;
  box-sizing: border-box !important;
}

.dialog-actions button {
  min-width: 80px;
  cursor: pointer;
  transition: transform 0.2s;
}

.dialog-actions button:hover {
  transform: scale(1.05);
}

.dialog-content.alert-mode #btn-dialog-cancel {
  display: none;
}

.dialog-content.alert-mode #btn-dialog-cancel:hover {
  background-color: var(--highlight-color);
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.btn-confirm, .btn-cancel {
  white-space: nowrap !important;
  padding: 8px 15px !important;
  font-size: 0.85rem !important;
  width: auto !important;
  min-width: 80px !important; 
  flex-shrink: 0 !important;
}

.btn-confirm {
    background-color: var(--accent-color); 
    color: white;
    border: 2px solid var(--accent-color) !important; 
    padding: 8px 35px;       
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    background-color: #000; 
}

.btn-confirm:active {
    transform: scale(0.95);
}

/* RESPONSIVE QUERIES */
/* TABLET LANDSCAPE & SMALL LAPTOP (Max 1024px) */
@media (max-width: 1024px) {
  :root {
    --card-width: 280px; 
    --card-height: 280px;
  }
  
  .main-content {
    padding: 0 20px;
  }
}

/* TABLET PORTRAIT & MOBILE (Max 768px) */
@media (max-width: 768px) {
  .logo {
    display: none !important;
  }

  h1 {
    top: 90px;
    font-size: 30px;
    
  }

  .floating-menu-btn {
    position: fixed !important;
    top: 15px !important;       
    left: 15px !important;      
    z-index: 2100 !important;   
    width: 40px !important;
    height: 40px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  body.sidebar-is-open .floating-menu-btn {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .search-wrapper {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    width: calc(100% - 130px) !important; 
    max-width: none !important;
    z-index: 2000 !important;
  }
  
  .search-wrapper input {
    width: 100% !important;
    font-size: 16px !important; 
  }

  body.sidebar-is-open {
    padding-left: 0;
  }
    
  .section-header {
    margin-bottom: 20px;
  }

  .main-header {
    padding: 0 15px;
  }

  .sidebar {
    width: 85%;
    max-width: 320px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  }

  .carousel-wrapper {
    height: auto;
    margin-top: 150px;
    margin-bottom: 180px; 
  }

  .btn-left { left: 5%; }
  .btn-right { right: 5%; left: auto; }

  .grid-standard {
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 15px !important; 
  }

  .card-standard .img-wrap {
    margin-bottom: 8px !important; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
  }

  .card-standard h4 {
    font-size: 0.9rem !important; 
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-standard p {
    font-size: 0.8rem !important; 
    margin-top: 2px !important;
  }

  .grid-artist {
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px;
    overflow-x: auto; 
    padding-bottom: 10px;
  }
    
  .card-artist img { width: 90px; height: 90px; }
  .card-artist h4 { font-size: 0.85rem; }

  #player-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99999 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    box-sizing: border-box !important;
    background: white !important;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
    padding: 35px 15px 30px 15px !important; 
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
  }

  #player-bar.hidden-bar {
    transform: translateY(150%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #player-bar.collapsed {
    transform: translateY(calc(100% - 30px)) !important;
  }

  #player-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    cursor: pointer;
    z-index: 20;
    border-radius: 24px 24px 0 0;
    background: transparent;
  }

  .handle-bar {
    width: 40px;
    height: 5px;
    background-color: #e0e0e0;
    border-radius: 10px;
  }
  
  #player-drag-handle:active .handle-bar {
    background-color: #bbb;
  }

  .player-wrapper { display: contents; }
  .player-extras, #p-img { display: none !important; }

  .player-info {
    order: 1; 
    width: 100%;
    margin-bottom: 2px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 35px;
    box-sizing: border-box;
  }

  .p-text { width: 100% !important; text-align: center !important; }
  .p-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .p-text p {
    font-size: 0.8rem;
    color: #666;
    display: block !important;
    text-align: center !important;
    width: 100% !important;
  }

  .progress-container {
    order: 2; 
    width: 100%;
    margin: 0;
    padding: 0 5px;
    box-sizing: border-box;
  }
  input[type="range"] { height: 4px; }

  .player-controls {
    order: 3; 
    width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .player-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #444;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .main-play-btn {
    width: 50px !important;
    height: 50px !important;
    background: var(--text-primary) !important;
    color: white !important;
    font-size: 1.3rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
  }

  #btn-heart      { order: 1; }
  #btn-shuffle    { order: 2; }
  #btn-prev-song  { order: 3; }
  #btn-play       { order: 4; margin: 0 5px; }
  #btn-next-song  { order: 5; }
  #btn-loop       { order: 6; }
  #btn-add-pl     { order: 7; }
  .volume-wrapper-mobile { order: 8; }

  .header-user-section {
        margin-left: 10px;
    }
    .user-icon-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    #btn-dialog-confirm {
      font-size: 0.95rem !important; 
      padding: 8px 20px !important;    
      width: auto !important;
      height: auto !important;
      border-radius: 50px !important; 
      line-height: normal !important;
      margin-left: 10px; 
    }
}

/* MOBILE STANDARD (Max 480px) */
@media (max-width: 480px) {
  .grid-standard { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-artist { grid-template-columns: repeat(3, 1fr) !important; }
  
  .btn-confirm, .btn-cancel {
    font-size: 12px !important; 
    font-weight: 500 !important; 
    padding: 6px 14px !important; 
    white-space: nowrap !important;
  }
  
  .dialog-actions { gap: 8px !important; }
  
  :root {
    --card-width: 60vw;
    --card-height: 60vw;
  }
}

/* MICRO DEVICES (Max 350px) */
@media (max-width: 350px) {
  #btn-shuffle, #btn-loop, #btn-add-pl {
    display: none !important;
  }
  .player-controls { justify-content: space-around !important; }
  
  .search-wrapper { width: calc(100% - 90px) !important; }
}

/* DESKTOP & LARGE SCREENS (Min 769px) */
@media (min-width: 769px) {
  #player-bar {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    transform: translate(-50%, 0) !important;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
    width: 600px !important;
    max-width: 90% !important;
    height: auto !important;
    background: white !important;
    border-radius: 50px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 10px 30px !important;
    opacity: 1 !important;
    display: flex !important;
    z-index: 9999 !important;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s !important;
  } 

  #player-bar.hidden-bar {
    transform: translate(-50%, 200%) !important; 
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .player-bar.collapsed {
      transform: translate(-50%, 0) !important; 
  }

  #player-drag-handle, 
  #btn-hide-player,
  .mobile-only {
    display: none !important;
  }
}