* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  /* Nền đen sâu */
  background: #09090b;
  color: #f4f4f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px 16px 65px;
}

.app-container {
  display: flex;
  gap: 24px;
  max-width: 850px;
  width: 100%;
}

.player-card, .playlist-card {
  /* Thẻ màu đen xám đục */
  background: #121215;
  border: 1px solid #27272a;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.player-card {
  flex: 1.2;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.playlist-card {
  flex: 1;
  min-width: 280px;
  max-height: 540px;
  display: flex;
  flex-direction: column;
}

.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* Logo màu Đỏ nhạt */
.logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: #f87171; 
  letter-spacing: 1px;
}

.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-flac { background: #ef4444; color: #fff; }
.badge-hq { background: #b91c1c; color: #fff; }
.badge-sd { background: #3f3f46; color: #a1a1aa; }

.cover-art img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.7);
  margin-bottom: 16px;
}

.song-info {
  text-align: center;
  margin-bottom: 14px;
  width: 100%;
}

.song-info h2 {
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-info h3 {
  font-size: 0.88rem;
  color: #a1a1aa;
  margin-top: 4px;
  font-weight: 400;
}

.quality-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #18181b;
  border: 1px solid #27272a;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: #a1a1aa;
}

.quality-control select {
  background: transparent;
  border: none;
  color: #f87171; /* Chữ đỏ nhạt */
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* ---------------------------------- */
/* THANH TIME & CHẤM TRÒN (PROGRESS)  */
/* ---------------------------------- */
.progress-section {
  width: 100%;
  margin-bottom: 16px;
}

.progress-container {
  background: #27272a;
  height: 6px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  position: relative;
}

.progress-bar {
  background: #f87171; /* Thanh đỏ nhạt */
  height: 100%;
  width: 0%;
  border-radius: 4px;
  position: relative;
}

/* CHẤM TRÒN KÉO THỜI GIAN */
.progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: #ffffff;
  border: 2px solid #f87171;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.8);
  transition: transform 0.1s ease;
  z-index: 2;
}

.progress-container:hover .progress-bar::after {
  transform: translateY(-50%) scale(1.3);
}

/* BỔ SUNG: KHUNG THỜI GIAN ĐẦU VÀ CUỐI */
.time-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: #71717a;
  margin-top: 8px;
}

/* ---------------------------------- */
/* NÚT BẤM CỦA TRÌNH PHÁT              */
/* ---------------------------------- */
.controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.btn {
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 1.4rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.92); }
.btn:hover { color: #f87171; }

.btn-main {
  background: #f87171; /* Nút Play chính - Đỏ nhạt */
  color: #09090b;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
}

.btn-main:hover {
  background: #fca5a5;
  color: #09090b;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: #71717a;
  padding: 0 8px;
}

.volume-container input {
  width: 100%;
  accent-color: #f87171;
  cursor: pointer;
  height: 4px;
}

/* ---------------------------------- */
/* DANH SÁCH BÀI HÁT (PLAYLIST)       */
/* ---------------------------------- */
.playlist-card h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 8px;
}

.playlist-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  padding-right: 4px;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #18181b;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.playlist-item:hover { 
  background: #27272a; 
}

.playlist-item.active {
  background: rgba(248, 113, 113, 0.15);
  border-color: #f87171;
  color: #f87171;
}

.playlist-item .item-title {
  font-weight: 600;
  font-size: 0.88rem;
  display: block;
}

.playlist-item .item-artist {
  font-size: 0.75rem;
  color: #a1a1aa;
}

/* Author Badge */
.author-badge {
  position: fixed;
  bottom: 14px;
  right: 16px;
  background: rgba(18, 18, 21, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #27272a;
  color: #71717a;
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 20px;
  z-index: 100;
}

.author-badge a {
  color: #f87171;
  text-decoration: none;
  font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body { padding: 12px 12px 65px; }
  .app-container { flex-direction: column; gap: 16px; }
  .player-card, .playlist-card { padding: 18px; border-radius: 20px; }
  .cover-art img { width: 170px; height: 170px; margin-bottom: 12px; }
  .controls { gap: 32px; }
  .playlist-card { max-height: none; }
  .playlist-list { max-height: 280px; }
  .author-badge { left: 50%; transform: translateX(-50%); right: auto; white-space: nowrap; }
}
