/* Music Player Component Styles */

:root {
  /* Use site fonts */
  --music-font: "Geist", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Wrapper for the whole player */
.music-player {
  opacity: 0; /* hidden until data shows */
  width: 100%; /* stretch full available width (mobile first) */
  /* Removed fixed max-width to allow responsive scaling */
  height: auto;
  background-color: #000;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  /* subtle shadow   */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  font-family: var(--music-font);
  margin: 12px 0; /* space between alexa row and social icons */
}

/* --------------------------------------------------------------
   Desktop / large-screen refinement
   -------------------------------------------------------------- */
@media (min-width: 1024px) {
  /* Cap the overall player width so both the black container and the
     dot-matrix grid stay compact on laptops/desktops while aligning with
     the main content column (flush left within the wrapper). */
  .music-player {
    max-width: 560px; /* tweak to taste */
    margin-left: 0;   /* left-aligned */
    margin-right: 0;  /* prevent centering */
  }
}

.grid-container {
  display: grid;
  /* Each of the 49 columns shares equal flexible space */
  grid-template-columns: repeat(49, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  margin-bottom: 12px;
}

.grid-square {
  width: 100%;
  aspect-ratio: 1 / 1; /* keep each square a perfect square */
  background-color: rgba(102, 102, 102, 0.6);
  transition: background-color 0.05s ease-out;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.album-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.album-thumbnail {
  width: 40px;
  height: 40px;
  background-image: url("album.png");
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease;
}

.album-thumbnail::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: inherit;
  z-index: 1;
  transition: background-color 0.2s ease;
}

.album-thumbnail:hover::before {
  background-color: rgba(0, 0, 0, 0.5);
}

#play-pause-button svg {
  z-index: 2;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.album-thumbnail:active,
.volume-control-container:active {
  transform: scale(0.9);
}

.volume-control-container {
  cursor: pointer;
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.volume-control-container svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.volume-control-container:hover svg {
  opacity: 0.9;
}

.track-info {
  display: flex;
  flex-direction: column;
}

.track-title {
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  opacity: 0.9;
  color: #fff;
}

.track-time {
  user-select: none;
  font-size: 11.5px;
  color: #9ca3af;
}

#audio-player {
  display: none;
}

/* Generic fade-in blur utility so JS can re-trigger it */
.fade-in-blur {
  animation: textFadeInBlur 0.5s ease-out forwards;
  opacity: 0; /* start hidden until animation runs */
}

/* ----------------------------------------------------------------------------
   Custom overrides: hide play/pause & volume icons, keep thumbnail intact
   ---------------------------------------------------------------------------- */
#play-icon,
#pause-icon,
#volume-on-icon,
#volume-off-icon {
  display: none !important; /* ensure JS cannot re-show them */
}

/* Completely hide the volume control container so layout stays clean */
#volume-button {
  display: none !important;
}