.music-player-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Lyrics Display */
.lyrics-container {
  position: fixed;
  z-index: 9998;
  text-align: center;
  pointer-events: auto;
  max-width: 600px;
  width: fit-content;
  padding: 12px 24px;
  
  /* Glassmorphism */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.lyrics-container:active {
  cursor: grabbing;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .lyrics-container {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .lyrics-container:active {
  background: rgba(0, 0, 0, 0.6);
}

@media screen and (max-width: 768px) {
  .lyrics-container {
    padding: 8px 16px;
  }
  
  .lyric-line.current {
    font-size: 16px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  }
  .lyric-line.next {
    font-size: 12px;
  }
}

.lyrics-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lyric-line {
  display: block;
  font-weight: 600;
  color: var(--text-primary, #333);
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.8);
  opacity: 0.9;
  line-height: 1.2;
  transition: all 0.3s ease;
}

.lyric-line.next {
  opacity: 0.6;
  font-weight: 500;
}

.lyrics-placeholder {
  font-size: 14px;
  opacity: 0.8;
  font-weight: 500;
}

[data-theme="dark"] .lyric-line {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Lyric Transition */
.lyric-fade-enter-active,
.lyric-fade-leave-active {
  transition: all 0.3s ease;
}

.lyric-fade-enter-from {
  opacity: 0;
  transform: translateY(10px);
}

.lyric-fade-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

/* Widget Container */
.player-widget {
  display: flex;
  align-items: center;
  background: var(--bg-secondary, #fff);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color, #eee);
  border-radius: 999px;
  padding: 8px 12px 8px 8px; /* Adjusted padding */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 480px; /* Increased max-width */
  width: fit-content;
}

[data-theme="dark"] .player-widget {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(40, 40, 40, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Cover Art */
.cover-container {
  position: relative;
  cursor: pointer;
  margin-right: 12px;
  flex-shrink: 0;
}

.cover-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--border-light, #f5f5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary, #fff);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s linear;
}

.cover-img.rotating {
  animation: rotate 10s linear infinite;
}

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

.cover-placeholder {
  color: var(--text-tertiary, #999);
}

/* Content Area */
.content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0; /* Text truncation fix */
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.song-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: 12px;
}

.song-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.song-artist {
  font-size: 11px;
  color: var(--text-secondary, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-control-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.volume-slider-container {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 10px; /* Gap bridge */
  z-index: 100;
}

.volume-track {
  background: var(--bg-secondary, #fff);
  padding: 0;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color, #eee);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  width: 36px;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .volume-track {
  background: rgba(40, 40, 40, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Vertical Slider using Transform */
.volume-slider-vertical {
  width: 100px; /* Height of the slider area */
  height: 4px; /* Width of the track */
  transform: rotate(-90deg);
  border-radius: 2px;
  cursor: pointer;
  appearance: none;
  outline: none;
  background: rgba(128, 128, 128, 0.2); /* Default background */
}

/* Remove separate volume bar */

/* Track background line - removed as handled by input background */
.volume-track::before {
  display: none;
}

/* Slider Thumb Styling */
.volume-slider-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--text-primary, #333);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  margin-top: -4px; /* Center thumb: (track height 4px - thumb height 12px) / 2 */
  position: relative;
  z-index: 2;
}

.volume-slider-vertical::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: transparent;
  border: none;
}

/* More Menu Styles */
.more-control-wrapper {
  position: relative;
}

.more-menu-popup {
  position: absolute;
  bottom: 140%;
  right: 0;
  width: 180px;
  background: var(--bg-secondary, #fff);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  padding: 6px;
  z-index: 100;
  overflow: hidden;
}

[data-theme="dark"] .more-menu-popup {
  background: rgba(40, 40, 40, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.more-menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary, #333);
}

.more-menu-item:hover {
  background: rgba(128, 128, 128, 0.1);
}

.menu-icon {
  margin-right: 10px;
  display: flex;
  align-items: center;
  color: var(--text-secondary, #666);
}

.menu-text {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

/* Toggle Switch Style */
.menu-toggle {
  width: 32px;
  height: 18px;
  background: rgba(128, 128, 128, 0.2);
  border-radius: 999px;
  position: relative;
  transition: all 0.3s;
}

.menu-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.3s;
}

.menu-toggle.active {
  background: var(--text-primary, #333);
}

.menu-toggle.active::after {
  transform: translateX(14px);
}

[data-theme="dark"] .menu-toggle.active {
  background: #fff;
}

[data-theme="dark"] .menu-toggle.active::after {
  background: #000;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #666);
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  width: 32px;
  height: 32px;
}

.icon-btn svg {
  width: 18px; /* Slightly larger icons */
  height: 18px;
}

.icon-btn:hover {
  background: rgba(128, 128, 128, 0.1);
  color: var(--text-primary, #000);
}

.icon-btn.active {
  color: var(--link-color, #000);
  background: rgba(128, 128, 128, 0.15);
}

/* Progress Bar */
.progress-container {
  height: 4px;
  width: 100%;
  cursor: pointer;
  padding: 2px 0; /* Increase hit area */
}

.progress-bg {
  height: 3px;
  background: var(--border-color, #eee);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--link-color, #000);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Playlist Panel */
.playlist-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 280px;
  max-height: 400px;
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .playlist-panel {
  background: rgba(35, 35, 35, 0.95);
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.1);
}

.playlist-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #f5f5f5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.playlist-items {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.playlist-items::-webkit-scrollbar {
  width: 4px;
}

.playlist-items::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.playlist-items li {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid transparent; /* Prevent jump */
}

.playlist-items li:hover {
  background: rgba(128, 128, 128, 0.05);
}

.playlist-items li.active {
  background: rgba(128, 128, 128, 0.1);
}

.item-index {
  width: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

.active .item-index {
  color: var(--link-color);
}

.item-info {
  flex: 1;
  overflow: hidden;
}

.item-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-artist {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transitions */
.fade-slide-enter-active,
.fade-slide-leave-active {
  transition: all 0.3s ease;
}

.fade-slide-enter-from,
.fade-slide-leave-to {
  opacity: 0;
  transform: translateY(10px);
}
/* Context Menu */
.context-menu {
  position: fixed;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 12px;
  min-width: 200px;
  color: #333;
  transform-origin: top left;
}

[data-theme="dark"] .context-menu {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.menu-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .menu-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.menu-item:last-child {
  margin-bottom: 0;
}

.menu-item label {
  font-size: 13px;
  font-weight: 500;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.value {
  font-size: 12px;
  color: #666;
  width: 32px;
  text-align: right;
}

[data-theme="dark"] .value {
  color: #aaa;
}

/* Range Input */
input[type="range"] {
  width: 80px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--link-color, #333);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
  margin-top: -4px; /* Center thumb: (track height 4px - thumb height 12px) / 2 */
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Color Input */
input[type="color"] {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50%;
}
