/* ========== SPOTIFY FLOATING ICON WIDGET ========== */

/* Floating Icon Button */
.spotify-icon-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
  box-shadow: 0 8px 24px rgba(29, 185, 84, 0.4);
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotify-icon-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
}

.spotify-icon-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(29, 185, 84, 0.6);
}

.spotify-icon-btn.playing {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(29, 185, 84, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(29, 185, 84, 0.7), 0 0 20px rgba(29, 185, 84, 0.5); }
}

/* Album Art in Icon */
.spotify-icon-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.spotify-icon-btn.playing .spotify-icon-artwork {
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Expanded Card */
.spotify-expanded-card {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(30px);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9998;
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  pointer-events: none;
}

.spotify-expanded-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.spotify-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.spotify-card-artwork {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.spotify-card-track {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-card-artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress Bar */
.spotify-card-progress {
  margin: 15px 0;
}

.spotify-card-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.spotify-card-progress-fill {
  height: 100%;
  background: #1DB954;
  border-radius: 2px;
  transition: width 1s linear;
}

.spotify-card-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* Link to Spotify */
.spotify-open-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px;
  background: rgba(29, 185, 84, 0.1);
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: 8px;
  color: #1DB954;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s ease;
}

.spotify-open-link:hover {
  background: rgba(29, 185, 84, 0.2);
  border-color: rgba(29, 185, 84, 0.5);
}

/* Dynamic Theme */
body.spotify-theme-active {
  transition: background-color 1s ease;
}

body.spotify-theme-active::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
  background: var(--spotify-theme-color, #1DB954);
  transition: background 1s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .spotify-icon-btn {
    width: 56px;
    height: 56px;
    bottom: 80px;
    right: 16px;
  }

  .spotify-expanded-card {
    bottom: 145px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: calc(100vw - 32px);
  }

  .spotify-card-track {
    font-size: 15px;
  }

  .spotify-card-artist {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .spotify-icon-btn {
    width: 50px;
    height: 50px;
    bottom: 75px;
    right: 12px;
  }

  .spotify-expanded-card {
    bottom: 135px;
    right: 12px;
    left: 12px;
    padding: 16px;
  }

  .spotify-card-artwork {
    width: 50px;
    height: 50px;
  }
}
