/* ===== FONT & HEADER ===== */
body, button, a { font-family: 'Montserrat', sans-serif; }

/* Header text */
.show-info h1 {
  color: #FFFFFF !important;
  font-size: 20px !important;
  font-weight: 600;
}
.show-info p, #current-track {
  color: #B3B3B3 !important;
}

/* Playlist text */
#playlist, #playlist li, .track-num, .track-title {
  color: #FFFFFF !important;
}

/* ===== LAYOUT ===== */
html, body {
  height: 100%; margin: 0; padding: 0; overflow: hidden;
}
.player-container {
  display: flex; flex-direction: column; height: 100%; background: #181818;
}
.header {
  display: flex; align-items: center; background: #282828; padding: 20px;
}
.cover {
  width: 345px; height: 200px; object-fit: cover; margin-right: 20px;
  border-radius: 5px;
}
.main-play {
  background: #1DB954; border: none; color: #fff; font-size:24px;
  width:60px;height:60px;border-radius:50%;display:flex;
  align-items:center;justify-content:center;cursor:pointer;margin-top:10px;
}

/* ===== PLAYLIST & SCROLL ===== */
#playlist {
  flex: 1 1 auto; margin:0; padding:0; list-style:none;
  background: #181818; overflow-y:auto;
}
#playlist li {
  display:flex;justify-content:space-between;
  align-items:center;padding:10px 20px;border-bottom:1px solid #333;
}
#playlist li:hover { background: #282828; }
.track-info {
  display:flex;align-items:center;gap:10px;
}
.track-num { width:20px; font-weight:500; }
.track-title {
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:300px; font-weight:500;
}

/* ===== ROW BUTTONS ===== */
.controls {
  display:flex; gap:8px; align-items:center;
}
.btn {
  display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:50%;border:none;
  cursor:pointer;padding:0;
}
.btn.play-btn { background:#1DB954; }
.btn.play-btn:hover { background:#1ed760; }
.btn.download-btn { background:#007BFF; text-decoration:none; }
.btn.download-btn:hover { background:#339CFF; }

/* ===== CUSTOM AUDIO CONTROLS ===== */
.custom-audio-controls {
  display:flex;align-items:center;gap:12px;
  padding:10px 20px;background:#282828;
  border-top:1px solid #333;
  border-bottom-left-radius:5px;
  border-bottom-right-radius:5px;
}
.ctrl-btn {
  width:36px;height:36px;border:none;
  background:#1DB954;color:#fff;border-radius:50%;
  font-size:16px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.ctrl-btn.mute { background:#444; }
.ctrl-btn:hover { opacity:0.85; }
.progress-container {
  position:relative;flex:1;height:6px;
  background:#444;border-radius:3px;cursor:pointer;
}
.buffered-bar {
  position:absolute;left:0;top:0;height:100%;
  background:rgba(255,255,255,0.2);width:0;border-radius:3px;
}
.played-bar {
  position:absolute;left:0;top:0;height:100%;
  background:#1DB954;width:0;border-radius:3px;
}
.thumb {
  position:absolute;top:50%;
  width:12px;height:12px;margin-top:-6px;
  background:#fff;border-radius:50%;
  transform:translateX(-50%);pointer-events:none;
}
.time {
  font-size:14px;color:#ccc;white-space:nowrap;
}

/* ===== HIDE NATIVE AUDIO ===== */
audio { display:none; }

/* ===== SCROLLBAR ===== */
#playlist::-webkit-scrollbar { width:8px }
#playlist::-webkit-scrollbar-track { background:transparent }
#playlist::-webkit-scrollbar-thumb {
  background:rgba(255,255,255,0.2);border-radius:4px;
}
#playlist {
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,0.2) transparent;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet and smaller desktop screens */
@media screen and (max-width: 1024px) {
  .cover {
    width: 280px;
    height: 160px;
  }
  
  .header {
    padding: 15px;
  }
  
  .show-info h1 {
    font-size: 18px !important;
  }
  
  .track-title {
    max-width: 250px;
  }
}

/* Mobile landscape and small tablets */
@media screen and (max-width: 768px) {
  .header {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
  
  .cover {
    width: 200px;
    height: 120px;
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .show-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .show-info h1 {
    font-size: 18px !important;
    margin: 5px 0;
  }
  
  .show-info p {
    font-size: 16px;
    margin: 3px 0;
  }
  
  .main-play {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin-top: 8px;
    align-self: center;
  }
  
  #playlist li {
    padding: 12px 15px;
  }
  
  .track-title {
    max-width: 280px;
    font-size: 16px;
  }
  
  .track-num {
    font-size: 16px;
  }
  
  .btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  .custom-audio-controls {
    padding: 12px 15px;
    gap: 10px;
  }
  
  .ctrl-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .time {
    font-size: 12px;
  }
}

/* Mobile portrait */
@media screen and (max-width: 480px) {
  .header {
    padding: 10px;
  }
  
  .cover {
    width: 150px;
    height: 90px;
    margin-bottom: 10px;
  }
  
  .show-info h1 {
    font-size: 16px !important;
  }
  
  .show-info p {
    font-size: 14px;
  }
  
  .main-play {
    width: 45px;
    height: 45px;
    font-size: 18px;
    align-self: center;
  }
  
  #playlist li {
    padding: 10px 12px;
  }
  
  .track-info {
    gap: 8px;
  }
  
  .track-num {
    width: 18px;
    font-size: 14px;
  }
  
  .track-title {
    max-width: 200px;
    font-size: 14px;
  }
  
  .controls {
    gap: 6px;
  }
  
  .btn {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  
  .custom-audio-controls {
    padding: 10px 12px;
    gap: 8px;
  }
  
  .ctrl-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .progress-container {
    height: 8px;
  }
  
  .thumb {
    width: 14px;
    height: 14px;
    margin-top: -7px;
  }
  
  .time {
    font-size: 11px;
  }
}

/* Very small mobile screens */
@media screen and (max-width: 360px) {
  .header {
    padding: 8px;
  }
  
  .cover {
    width: 120px;
    height: 72px;
  }
  
  .show-info h1 {
    font-size: 14px !important;
  }
  
  .show-info p {
    font-size: 12px;
  }
  
  .track-title {
    max-width: 160px;
    font-size: 12px;
  }
  
  .track-num {
    font-size: 12px;
  }
  
  .btn {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }
  
  .ctrl-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .time {
    font-size: 10px;
  }
}

/* Touch improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
  .btn, .ctrl-btn, .main-play {
    min-height: 44px;
    min-width: 44px;
  }
  
  #playlist li {
    min-height: 50px;
  }
  
  .progress-container {
    height: 12px;
    padding: 3px 0;
  }
  
  .thumb {
    width: 18px;
    height: 18px;
    margin-top: -9px;
  }
}