:root {
  --primary-color: #1851f1;
  --primary-hover: #113dbb;
  --bg-color: #0b111e;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #10b981;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  background-image: radial-gradient(circle at 10% 20%, rgba(24, 81, 241, 0.15) 0%, transparent 45%),
                    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 45%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.main-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  width: 100%;
  position: relative;
}

.player {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(15px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 90vh;
  max-height: 780px;
}

.player .icon-pause {
  display: none;
}

.player.playing .icon-pause {
  display: inline-block;
}

.player.playing .icon-play {
  display: none;
}

.dashboard {
  padding: 30px 30px 20px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95) 0%, rgba(17, 24, 39, 0.7) 100%);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

/* HEADER */
header {
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
}

header h4 {
  color: var(--primary-color);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 5px;
}

header h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* CD */
.cd {
  display: flex;
  margin: 10px auto;
  width: 160px;
  height: 160px;
  position: relative;
  justify-content: center;
  align-items: center;
}

.cd-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #222;
  background-size: cover;
  background-position: center;
  border: 4px solid var(--card-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.cd-visualizer {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: transparent;
  border: none;
}

/* CONTROL */
.control {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  margin: 20px 0 10px;
}

.control .btn {
  color: var(--text-muted);
  padding: 15px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control .btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.control .btn.active {
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(24, 81, 241, 0.4);
}

.control .btn-toggle-play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(24, 81, 241, 0.4);
}

.control .btn-toggle-play:hover {
  background-color: var(--primary-hover);
  transform: scale(1.05);
}

/* Seek Bar & Timers */
.progress-container {
  width: 100%;
  margin-top: 15px;
}

.progress {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.progress::-webkit-slider-runnable-track {
  height: 6px;
}

.progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  cursor: pointer;
  box-shadow: -400px 0 0 400px var(--primary-color);
}

.time-container {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* PLAYLIST */
.playlist {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.playlist::-webkit-scrollbar {
  width: 5px;
}

.playlist::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 10px;
}

.song {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.song:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(24, 81, 241, 0.2);
  transform: translateY(-1px);
}

.song.active {
  background-color: rgba(24, 81, 241, 0.15);
  border-color: var(--primary-color);
}

.song .thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.song .body {
  flex: 1;
  padding: 0 16px;
  min-width: 0;
}

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

.song .author {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.song .option {
  color: var(--text-muted);
  font-size: 14px;
  padding: 5px;
}

.song.active .option {
  color: var(--primary-color);
}



/* Artist Links badges */
.artist-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
}

.artist-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 50px;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.artist-link.spotify {
  border-color: rgba(29, 185, 84, 0.2);
}
.artist-link.spotify:hover {
  background: rgba(29, 185, 84, 0.15);
  border-color: rgba(29, 185, 84, 0.6);
  box-shadow: 0 0 15px rgba(29, 185, 84, 0.25);
  transform: translateY(-2px);
}

.artist-link.yt-music {
  border-color: rgba(255, 0, 0, 0.2);
}
.artist-link.yt-music:hover {
  background: rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.6);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.25);
  transform: translateY(-2px);
}

/* Top Nav Layout */
.top-nav {
  position: absolute;
  top: 25px;
  left: 25px;
  right: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.back-home, .admin-upload-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s;
}

.back-home:hover, .admin-upload-btn:hover {
  color: #fff;
}

/* Modal Overlay Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--card-border);
  padding: 30px;
  border-radius: 24px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.close-modal {
  color: var(--text-muted);
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #fff;
}

.modal h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #fff;
}

.input-group {
  margin-bottom: 18px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.input-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.input-group input:focus {
  border-color: var(--primary-color);
}

.upload-action-btn {
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(24, 81, 241, 0.3);
  transition: background-color 0.3s;
}

.upload-action-btn:hover {
  background-color: var(--primary-hover);
}

.upload-status {
  margin-top: 15px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.upload-status.success {
  color: var(--accent);
}

.upload-status.error {
  color: #ef4444;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 480px) {
  .main-container {
    padding: 0;
  }
  .player {
    border-radius: 0;
    height: 100vh;
    max-height: 100%;
    border: none;
  }
  .dashboard {
    padding: 20px 20px 15px;
  }
  .cd {
    width: 120px;
    height: 120px;
  }
  .playlist {
    padding: 15px;
  }
  .top-nav {
    top: 15px;
    left: 15px;
    right: 15px;
  }
}

/* Desktop Split-Pane Layout */
@media (min-width: 769px) {
  .player {
    max-width: 900px;
    height: 560px;
    max-height: 90vh;
    flex-direction: row;
    align-items: stretch;
  }

  .dashboard {
    width: 45%;
    height: 100%;
    border-right: 1px solid var(--card-border);
    border-bottom: none;
    padding: 40px 30px;
    justify-content: center;
  }

  .playlist {
    width: 55%;
    height: 100%;
    padding: 40px 30px;
  }
}