/* === Shared Layout for All Sections === */
#spotify-stats,
#spotify-all-time {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2em;
  margin-top: 2em;
}

#spotify-stats .tile,
#spotify-all-time .tile {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 1.5em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#spotify-stats .tile h3,
#spotify-all-time .tile h3 {
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.25em;
  border-bottom: 2px solid #ddd;
  padding-bottom: 0.5em;
}

/* === Track Listing Styles === */
#top-tracks ul,
#top-artists ul,
#recently-played ul,
#all-time-artists ul,
#all-time-tracks ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#top-tracks li,
#recently-played li,
#top-artists li,
#all-time-artists li,
#all-time-tracks li {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #eee;
}

#top-tracks li:hover,
#all-time-tracks li:hover {
  background-color: #f3f3f3;
  border-radius: 8px;
  cursor: default;
}

#top-tracks img.cover,
#recently-played img.cover,
#top-artists img.cover,
#all-time-tracks img.cover {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* === Track Info Formatting === */
#top-tracks .track-info,
#recently-played .track-info,
#all-time-tracks .track-info {
  display: flex;
  flex-direction: column;
  font-size: 0.9em;
  overflow: hidden;
}

#top-tracks .track-info strong,
#all-time-tracks .track-info strong {
  font-size: 1em;
  line-height: 1.2;
  color: #222;
  /* allow line wrap instead of truncation */
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
}

#top-tracks .track-info small,
#recently-played .track-info small,
#all-time-tracks .track-info small {
  color: #555;
}

/* === Currently Playing Progress Bar === */
#currently-playing .progress-bar {
  background: #ddd;
  height: 6px;
  border-radius: 3px;
  margin-top: 0.5em;
  overflow: hidden;
}

#currently-playing .progress {
  background: #1DB954;
  height: 100%;
}

/* === Mobile Layout === */
@media (max-width: 600px) {
  #spotify-stats,
  #spotify-all-time {
    grid-template-columns: 1fr;
  }
}


.tile img.cover {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
  }
  

  #spotify-all-time {
    width: 100%;
    overflow-x: hidden;
  }

  #listening-plot img {
    max-width: 75%;
    height: auto;
    border-radius: 8px;
  }

  #genre-pie-tile img {
    max-width: 75%;
    height: auto;
    border-radius: 8px;
  }

  .tile-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 1em;
    width: 100%;
    height: 100%;
  }
  
  .tile-link:hover {
    background-color: #f3f3f3;
    border-radius: 8px;
  }

  