/* Global resets and base styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #121212;
  color: #ffffff;
  /* Ensure the page content doesn't get hidden behind the mini player */
  padding-bottom: 4.5rem;
}

button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: color 0.2s ease;
}

button:hover {
  color: #1DB954;
}

/* Mini player bar anchored to the bottom of the viewport */
#miniPlayer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #181818;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Increase top padding to accommodate the progress bar (4px) */
  padding: calc(0.5rem + 4px) 1rem 0.5rem 1rem;
  border-top: 1px solid #282828;
  z-index: 1000;
  /* Allow absolute positioning of the progress bar within the mini player */
  position: fixed;
  overflow: hidden;
}

/* Layout container for mini player left side (cover + info) */
.mini-left {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

/* Cover image in the mini player */
.mini-cover {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* Cover image in the full player */
/* The full-size album cover should maintain a 1:1 aspect ratio.  By using
   aspect-ratio, the height will automatically adjust relative to the width,
   preserving the square shape of most album art.  object-fit: cover ensures
   the image fills the square without distortion. */
.full-cover {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 1rem;
}

.mini-info {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.mini-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Remove old font-size rules for expand button.  Sizing is handled via .icon rules */

/* Full player overlay that slides over the page */
#fullPlayer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #121212;
  color: #ffffff;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  z-index: 999;
}

/* When expanded, the full player is visible */
#fullPlayer.expanded {
  transform: translateY(0);
}

/* When collapsed, the full player is hidden off-screen */
#fullPlayer.collapsed {
  transform: translateY(100%);
}

/* Header inside the full player containing the collapse button and track info */
.full-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

/* Style for the track info in the full player */
.full-info {
  flex: 1;
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapse button styling */
#collapseBtn {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* Controls in the full player */
.full-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Playlist styling */
#trackList {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  border-top: 1px solid #282828;
}

#trackList li {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #282828;
  cursor: pointer;
  color: #b3b3b3;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#trackList li:hover {
  background: #282828;
  color: #ffffff;
}

/* Highlight the currently playing track */
#trackList li.active {
  background: #1DB954;
  color: #121212;
}

/* Hide the YouTube iframe off-screen */
#hidden-player {
  display: none;
}

/* Icon sizing for mini and full players */
/* Icon sizing using inline SVGs */
.mini-buttons .icon {
  width: 1rem;
  height: 1rem;
}

.full-controls .icon,
#collapseBtn .icon,
#expandBtn .icon {
  width: 1.4rem;
  height: 1.4rem;
}

/* Progress bar styling for both mini and full players */
.progress-container {
  position: relative;
  width: 100%;
  height: 4px;
  background: #282828;
  cursor: pointer;
  overflow: hidden;
}

.progress-container .progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: #1DB954;
}

/* Mini player specific progress bar adjustments */
#miniProgressContainer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #282828;
}

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