/* Global Player Styles */
.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white-98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px var(--shadow-heavy);
}

.global-player.active {
  transform: translateY(0);
}

.global-player-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.global-player-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 300px;
}

.global-player-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.global-player-details {
  min-width: 0;
  flex: 1;
}

.global-player-title {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-player-artist {
  margin: 0;
  font-size: 13px;
  color: var(--light-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Global Player Link Styles */
.global-player-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.global-player-title-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.global-player-artist-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.global-player-artist-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.global-player-source {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.global-player-source.soundcloud {
  background: var(--soundcloud-bg);
  color: var(--soundcloud-color);
}

.global-player-source.mp3 {
  background: var(--primary-bg-medium);
  color: var(--primary);
}

.global-player-source i {
  font-size: 9px;
}

.global-player-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.global-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.global-play-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Resume Available State */
.global-play-btn.resume-available {
  background: var(--primary);
  animation: pulse-blue 2s infinite;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

.global-play-btn.resume-available:hover {
  background: var(--primary-dark);
}

@keyframes pulse-blue {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
  }
}

.global-progress-container {
  display: flex;
/*  align-items: center;*/
  gap: 12px;
  flex: 1;
  min-width: 300px;
}
.global-progress-wrapper{
    width: 100%;
    
}
.global-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-width: 200px;
  margin-top: 7px;
}

.global-progress {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s ease;
  border-radius: 3px;
}

.global-time {
  font-size: 13px;
  color: var(--light-text);
  font-weight: 600;
  white-space: nowrap;
  min-width: 40px;
  text-align: center;
}

.global-player-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.global-volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--light-text);
}

.global-volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
}

.global-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.global-volume-slider::-moz-range-thumb {
  background: var(--primary);
  border: none;
}

.global-close-btn {
  background: none;
  border: none;
  color: var(--light-text);
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.global-close-btn:hover {
  background: var(--border);
  color: var(--dark-text);
}

/* Mobile Resume Message */
.mobile-resume-message {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  animation: slideInDown 0.3s ease;
}

.mobile-resume-message:hover {
  background: var(--primary-dark);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* Body padding when global player is active */
body.global-player-active {
  padding-bottom: 90px;
}

/* Current Track Display Styles - SIMPLE LINE */
.global-current-track {
  text-align: center;
  margin-top: 8px;
  width: 100%;
/*  height: 18px; /* Reserve space to prevent layout shifts */
  display: none; /* Hidden by default */
  overflow: hidden;
}

.global-current-track.visible {
  display: block;
}

.current-track-info {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.current-track-label {
  display: none; /* Hide "Now Playing:" */
}

.current-track-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--dark-text);
}

.current-track-artist {
  font-size: 13px;
  color: var(--light-text);
}

.current-track-artist::before {
  content: " by ";
  color: var(--light-text);
}

/* Mobile Global Player */
@media (max-width: 768px) {
  .global-player {
    padding: 12px;
  }

  .global-player-content {
    flex-direction: column;
    gap: 12px;
  }

  .global-player-info {
    width: 100%;
    order: 2;
    max-width: none;
  }

  .global-player-controls {
    width: 100%;
    order: 1;
  }

  .global-player-actions {
    display: flex;
    justify-content: flex-end;
    order: 3;
  }

  /* Hide volume control on mobile but keep close button */
  .global-volume-control {
    display: none;
  }

  .global-player-cover {
    width: 40px;
    height: 40px;
  }

  .global-play-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .global-progress-container {
    min-width: auto;
  }

  .global-progress-bar {
    min-width: 150px;
  }

  .global-time {
    font-size: 12px;
    min-width: 35px;
  }

  .global-player-title {
    font-size: 14px;
  }

  .global-player-artist {
    font-size: 12px;
  }

  /* Mobile current track display */
  .global-current-track {
    margin-top: 6px;
    height: 24px;
  }

  .current-track-title,
  .current-track-artist {
    font-size: 12px;
  }

  body.global-player-active {
    padding-bottom: 125px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .global-player {
    background: rgba(20, 20, 20, 0.95);
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .global-player-title {
    color: #ffffff;
  }

  .global-player-artist {
    color: #cccccc;
  }

  .global-progress-bar {
    background: rgba(255, 255, 255, 0.2);
  }

  .global-time {
    color: #cccccc;
  }

  .global-close-btn {
    color: #cccccc;
  }

  .global-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }
}

@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
