/* ========================================
   SPOTIFY APP STYLES
   Compatible with existing global.css
   ======================================== */

/* Wallpaper Background */
.spotify-wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, #1e3a5f 0%, #0a0e1a 50%, #000000 100%);
  z-index: 0;
}

/* Spotify page content override */
#spotifyPage .content {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}


/* Back Button */
.back-button-spotify {
  position: fixed;
  top: 54px;
  left: 15px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1DB954;
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  z-index: 999;
  cursor: pointer;
  transition: opacity 0.2s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.back-button-spotify:active {
  opacity: 0.6;
}

.back-arrow-spotify {
  padding-bottom: 8px;
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
}

.back-text {
  font-size: 17px;
}

/* ========================================
   SPOTIFY CONTAINER
   ======================================== */

.spotify-container {
  padding-top: 60px;
  padding-bottom: 140px; /* Space for player bar */
  min-height: 100vh;
}

/* ========================================
   PLAYLIST HEADER
   ======================================== */

.playlist-header {
  text-align: center;
  padding: 30px 20px 20px;
}

.playlist-cover {
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  pointer-events: none;
}

.playlist-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
  color: #fff;
}

.playlist-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 8px;
  font-weight: 400;
}

.playlist-description {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-weight: 400;
}

/* ========================================
   PLAY ALL BUTTON
   ======================================== */

.play-all-section {
  padding: 20px;
  display: flex;
  justify-content: center;
}

.play-all-btn {
  background: #1DB954;
  color: #000;
  border: none;
  border-radius: 30px;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

.play-all-btn:active {
  transform: scale(0.95);
  background: #1ed760;
}

.play-icon {
  font-size: 18px;
  line-height: 1;
}

/* ========================================
   SONGS LIST
   ======================================== */

.songs-list {
  padding: 0 15px 20px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.song-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.song-item.playing {
  background: rgba(29, 185, 84, 0.2);
}

.song-number {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.song-item.playing .song-number {
  color: #1DB954;
}

.song-cover {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.song-info {
  flex: 1;
  min-width: 0;
}

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

.song-item.playing .song-title {
  color: #1DB954;
}

.song-artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.song-duration {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  font-weight: 400;
}

/* Romantic Note */
.song-note {
  padding: 12px 15px;
  margin: -8px 10px 8px 10px;
  background: rgba(29, 185, 84, 0.15);
  border-left: 3px solid #1DB954;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  display: none;
  animation: slideDown 0.3s ease;
  font-weight: 400;
}

.song-note.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   PLAYER BAR (Fixed Bottom)
   ======================================== */

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 428px;
  margin: 0 auto;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

.player-progress {
  padding: 0 15px;
  padding-top: 8px;
}

.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  background: #1DB954;
  width: 0%;
  transition: width 0.1s linear;
}

.player-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px 12px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.song-cover-mini {
  width: 45px;
  height: 45px;
  border-radius: 4px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.song-text {
  flex: 1;
  min-width: 0;
}

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

.song-artist-mini {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* ========================================
   PLAYER CONTROLS
   ======================================== */

.player-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.control-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0.8;
  user-select: none;
  -webkit-user-select: none;
}

.control-btn:active {
  transform: scale(0.9);
  opacity: 1;
}

.control-btn.play-btn {
  background: #fff;
  color: #000;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 16px;
  opacity: 1;
}

.control-btn.play-btn:active {
  transform: scale(0.95);
}

/* Home Indicator */
.home-indicator {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  z-index: 1001;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 390px) {
  .playlist-cover {
    width: 180px;
    height: 180px;
  }
  
  .heart-icon {
    font-size: 70px;
  }
  
  .playlist-title {
    font-size: 24px;
  }
}

@media (max-width: 375px) {
  .playlist-cover {
    width: 170px;
    height: 170px;
  }
  
  .heart-icon {
    font-size: 65px;
  }
  
  .playlist-title {
    font-size: 22px;
  }
  
  .song-item {
    padding: 8px;
  }
}

/* ========================================
   ICON IMAGES
   ======================================== */

.play-icon-img {
  width: 20px;
  height: 20px;
  filter: brightness(0); /* Rende nero */
}

.control-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1); /* Rende bianco */
}

.control-icon-main {
  width: 18px;
  height: 18px;
  filter: brightness(0); /* Rende nero (su sfondo bianco) */
}

/* Aggiusta padding pulsanti per icone */
.control-btn {
  padding: 6px;
}

.control-btn.play-btn {
  padding: 10px;
}

/* ========================================
   SONG COVER IMAGES
   ======================================== */

.song-cover {
  position: relative;
  overflow: hidden;
}

.song-cover-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.song-cover-emoji {
  font-size: 24px;
  line-height: 1;
}

/* Player Bar Mini Cover */
.player-cover-img {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
