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

body {
  font-family: 'Circular', Arial, sans-serif;
  background: linear-gradient(to bottom, #121212, #000000);
  color: #fff;
  min-height: 100vh;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  background-color: #000;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.logo {
  color: #1DB954;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 30px;
}

.nav-item {
  display: flex;
  align-items: center;
  color: #b3b3b3;
  padding: 10px 0;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-item:hover {
  color: #fff;
}

.nav-icon {
  margin-right: 15px;
  font-size: 20px;
}

/* Artist dropdown section */
.artist-section {
  margin-top: 30px;
}

.artist-dropdown {
  position: relative;
}

.artist-header {
  display: flex;
  align-items: center;
  padding: 12px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.artist-header:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.artist-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
}

.artist-info {
  flex: 1;
}

.artist-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.artist-subtitle {
  font-size: 12px;
  color: #b3b3b3;
}

.dropdown-arrow {
  font-size: 12px;
  color: #b3b3b3;
  transition: transform 0.2s;
}

.artist-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.albums-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.artist-dropdown.open .albums-dropdown {
  max-height: 400px;
}

.album-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.album-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.album-item.active {
  background-color: rgba(29, 185, 84, 0.3);
}

.album-item-img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  margin-right: 12px;
}

.album-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.album-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.album-item-year {
  font-size: 12px;
  color: #b3b3b3;
}

.main-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
  transition: background 0.4s ease-in-out;
}

.album-header {
  display: flex;
  align-items: flex-end;
  margin-bottom: 30px;
  padding-bottom: 24px;
}

.album-cover {
  width: 230px;
  height: 230px;
  box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
}

.album-info {
  margin-left: 24px;
}

.album-type {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.album-title {
  font-size: 72px;
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1;
}

.album-metadata {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #b3b3b3;
}

.album-metadata .artist-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
}

.album-metadata .artist-name {
  color: #fff;
  font-weight: 600;
  margin-right: 8px;
}

.album-year, .album-songs {
  margin: 0 4px;
}

.dot {
  height: 4px;
  width: 4px;
  background-color: #b3b3b3;
  border-radius: 50%;
  display: inline-block;
  margin: 0 4px;
}

.action-buttons {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.play-button {
  background-color: #1DB954;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 16px;
  transition: transform 0.2s, background-color 0.2s;
}

.play-button:hover {
  transform: scale(1.05);
  background-color: #1ed760;
}

.heart-button, .more-button {
  font-size: 20px;
  color: #b3b3b3;
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 16px;
  transition: color 0.2s;
}

.heart-button:hover, .more-button:hover {
  color: #fff;
}

.track-list-header {
  display: grid;
  grid-template-columns: 50px 6fr 4fr 1fr 120px;
  padding: 0 16px;
  margin-bottom: 16px;
  color: #b3b3b3;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.track-list {
  list-style: none;
}

.track {
  display: grid;
  grid-template-columns: 50px 6fr 4fr 1fr 120px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 16px;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.track:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.track.playing {
  background-color: rgba(255, 255, 255, 0.2);
  color: #1DB954;
}

.track-number {
  color: #b3b3b3;
  font-size: 16px;
  text-align: center;
}

.track.playing .track-number, .track:hover .track-number {
  color: #fff;
}

.track-title {
  font-weight: 500;
}

.track-artist {
  color: #b3b3b3;
  font-size: 14px;
}

.track-duration {
  color: #b3b3b3;
  text-align: right;
}

.track-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.track-actions button {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 4px 10px;
  font-size: 12px;
  display: none;
}
.track:hover .track-actions button {
  display: inline-block;
}
.track-add-btn:hover {
  background: #1DB954;
  color: #000;
  border-color: #1DB954;
}
.track-del-btn:hover {
  background: #b00000;
  color: #fff;
  border-color: #b00000;
}

.album-item {
  position: relative;
  padding-right: 120px;
}
.playlist-edit-btn, .playlist-icon-btn, .playlist-del-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 4px 8px;
  font-size: 12px;
  opacity: 0;
}
.playlist-icon-btn { right: 48px; }
.playlist-edit-btn { right: 88px; }
.album-item:hover .playlist-del-btn {
  opacity: 1;
}
.album-item:hover .playlist-edit-btn,
.album-item:hover .playlist-icon-btn {
  opacity: 1;
}

.now-playing-bar {
  background-color: #181818;
  border-top: 1px solid #282828;
  padding: 16px;
  display: flex;
  align-items: center;
  height: 90px;
}

.now-playing {
  display: flex;
  align-items: center;
  width: 30%;
}

.now-playing-cover {
  width: 56px;
  height: 56px;
  margin-right: 14px;
}

.now-playing-info {
  display: flex;
  flex-direction: column;
}

.now-playing-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 5px;
}

.now-playing-artist {
  font-size: 12px;
  color: #b3b3b3;
}

.player-controls {
  width: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.control-buttons {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.control-button {
  background: none;
  border: none;
  color: #b3b3b3;
  cursor: pointer;
  font-size: 16px;
  margin: 0 8px;
  transition: color 0.2s;
}

.control-button:hover {
  color: #fff;
}

.play-pause-button {
  background-color: #fff;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 16px;
  transition: transform 0.2s;
}

.play-pause-button:hover {
  transform: scale(1.05);
}

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
}

.current-time, .total-time {
  color: #b3b3b3;
  font-size: 12px;
  min-width: 40px;
}

.current-time {
  margin-right: 8px;
  text-align: right;
}

.total-time {
  margin-left: 8px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background-color: #535353;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.progress-bar-handle {
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
}

.progress-bar:hover .progress-bar-handle {
  display: block;
}

.progress {
  height: 100%;
  background-color: #b3b3b3;
  border-radius: 2px;
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  transition: background-color 0.1s;
}

.progress-bar:hover .progress {
  background-color: #1DB954;
}

.extra-controls {
  width: 30%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Enhanced Volume Control Styles */
.volume-container {
  display: flex;
  align-items: center;
  width: 160px;
  position: relative;
}

.volume-icon {
  color: #b3b3b3;
  margin-right: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s;
}

.volume-icon:hover {
  color: #fff;
}

.volume-percentage {
  color: #b3b3b3;
  font-size: 12px;
  margin-right: 8px;
  min-width: 36px;
  text-align: center;
}

.volume-bar {
  flex: 1;
  height: 4px;
  background-color: #535353;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: height 0.2s;
}

.volume-bar:hover {
  height: 6px;
}

.volume-level {
  height: 100%;
  background-color: #b3b3b3;
  border-radius: 2px;
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  transition: background-color 0.1s;
}

.volume-bar:hover .volume-level {
  background-color: #1DB954;
}

.volume-handle {
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.volume-bar:hover .volume-handle {
  display: block;
}

/* Volume tooltip on hover */
.volume-container .tooltip {
  position: absolute;
  background-color: #282828;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.volume-container:hover .tooltip {
  display: block;
}

/* Animation for volume changes */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.volume-icon.pulse {
  animation: pulse 0.3s ease-in-out;
}

/* 🎨 Album backgrounds */
.main-view.graduation-bg {
  background: linear-gradient(to bottom, #1E3264, #121212);
}

.main-view.college-dropout-bg {
  background: linear-gradient(to bottom, #af3204, #1a0000);
}

.main-view.mbdtf-bg {
  background: linear-gradient(to bottom, #8B0000, #3c0000);
}

.main-view.watch-the-throne-bg {
  background: linear-gradient(to bottom, #8B7500, #3c3000);
}

.a808s-gradient {
  background: linear-gradient(to bottom, #928f8f, #0d0d0d);
  background-size: 400% 400%;
  animation: pulseGradient 10s ease infinite;
}

@keyframes pulseGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.main-view.late-registration-bg {
  background: linear-gradient(to bottom, #333c34, #1d201d);
}

/* Offline indicator */
body.offline::before {
  content: "Offline Mode";
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff4444;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-100%);
  }
  to {
    transform: translateX(-50%) translateY(0);
  }
}

/* Install button styles */
.install-button:hover {
  background: #1ed760;
  transform: scale(1.05);
}

/* Update banner button */
.update-banner button {
  background: white;
  color: #1DB954;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

.update-banner button:hover {
  background: #f0f0f0;
}

/* Loading state for tracks */
.track.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Cache status indicator */
.cache-status {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  display: none;
  z-index: 100;
}

.cache-status.show {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 📱 Mobile responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    padding: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    overflow-x: auto;
  }

  .logo {
    margin-bottom: 0;
  }

  .nav-items {
    display: flex;
  }

  .nav-item {
    margin-left: 15px;
  }

  .artist-section {
    width: 100%;
    margin-top: 15px;
  }

  .albums-dropdown {
    margin-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
  }

  .album-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .album-cover {
    width: 160px;
    height: 160px;
  }

  .album-info {
    margin-left: 0;
    margin-top: 20px;
  }

  .album-title {
    font-size: 32px;
  }

  .track-list-header {
    grid-template-columns: 50px 1fr 80px;
  }
  .track-list-header > div:nth-child(3),
  .track-list-header > div:nth-child(5) {
    display: none;
  }

  .track {
    grid-template-columns: 50px 1fr 80px;
  }
  .track-artist {
    display: none;
  }
  .track-actions {
    display: none;
  }

  .now-playing-bar {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  .now-playing, .player-controls, .extra-controls {
    width: 100%;
    margin-bottom: 10px;
  }

  .extra-controls {
    justify-content: center;
  }
  
  .volume-container {
    width: 120px;
  }
}

@media (max-width: 480px) {
  .album-title {
    font-size: 24px;
  }
  .album-type {
    font-size: 10px;
  }
  .album-metadata {
    font-size: 12px;
  }
  .play-button {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  .track-number {
    font-size: 14px;
  }
  .track-duration {
    font-size: 12px;
  }
  .now-playing-cover {
    width: 48px;
    height: 48px;
  }
  .now-playing-title {
    font-size: 13px;
  }
  .now-playing-artist {
    font-size: 11px;
  }
  .control-button {
    font-size: 14px;
  }
  .play-pause-button {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

/* 🎨 Album backgrounds */
.main-view.graduation-bg {
  background: linear-gradient(to bottom, #1E3264, #121212);
}

.main-view.college-dropout-bg {
  background: linear-gradient(to bottom, #af3204, #1a0000);
}

.main-view.mbdtf-bg {
  background: linear-gradient(to bottom, #8B0000, #3c0000);
}

.main-view.watch-the-throne-bg {
  background: linear-gradient(to bottom, #8B7500, #3c3000);
}

.a808s-gradient {
  background: linear-gradient(to bottom, #928f8f, #0d0d0d);
  background-size: 400% 400%;
  animation: pulseGradient 10s ease infinite;
}

@keyframes pulseGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.main-view.late-registration-bg {
  background: linear-gradient(to bottom, #333c34, #1d201d);
}

.main-view.astroworld-bg {
  background: linear-gradient(to bottom, #4A90E2, #2E5C8A, #1A3A5C, #0F2A44);
}

.main-view.rodeo-bg {
  background: linear-gradient(to bottom, #8B7E9A, #6B5B73, #4A3D4C, #2D2329, #121212);
}

.main-view.birds-bg {
  background: linear-gradient(to bottom, #C85A54, #A64944, #8B3A36, #6B2B28, #4A1D1A);
}

.main-view.utopia-bg {
  background: linear-gradient(to bottom, #8B6F47, #6B5537, #4A3B27, #2D2317, #121212);
}

.main-view.days-before-rodeo-bg {
  background: linear-gradient(to bottom, #4A90E2, #3A7BC8, #2E5C8A, #1E3D5A, #0F2A44);
}

.visitor-stats {
  display: none; /* Hidden unless ?admin=1 is present */
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #121212;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-family: sans-serif;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  z-index: 1000;
  line-height: 1.6;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}
