/* music-player.css - Wide Unhiintify Player (wide, not tall) */
.music-window {
  max-width: none;
  width: 100%;
  min-width: 800px;
  min-height: 400px;
}

.music-window .window-header {
  padding: 0.6rem 1.2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.music-window .window-content {
  padding: 0;
  overflow: hidden;
  height: calc(100% - 48px);
  background: var(--bg-primary);
}

.unhiintify-player {
  display: flex;
  height: 100%;
  min-height: 420px;
  background: var(--bg-primary);
  border: none;
  box-sizing: border-box;
}

/* Sidebar - Now Playing, compact */
.player-sidebar {
  width: 24%;
  min-width: 240px;
  padding: 1rem 1.2rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--bg-secondary);
  overflow-y: auto;
}

.now-playing {
  text-align: center;
}

.artwork-container {
  width: 140px;
  height: 140px;
  margin: 0 auto 0.75rem;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.artwork-container:hover {
  border-color: var(--border-light);
  transform: scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.artwork-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.artwork-emoji {
  font-size: 3.2rem;
  color: var(--text-secondary);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.song-title {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.song-artist {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
  font-weight: 300;
}

.song-album {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 300;
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.control-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.control-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.1);
  border-color: var(--border-light);
  box-shadow: 0 0 12px var(--glow);
}

.control-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.control-btn.play-btn {
  width: 52px;
  height: 52px;
  background: var(--bg-tertiary);
  font-size: 1.5rem;
  border: 1px solid var(--border-light);
}

.control-btn.play-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  transform: scale(1.12);
  border-color: var(--text-primary);
  box-shadow: 0 0 20px var(--glow);
}

/* Progress - More compact */
.progress-area {
  width: 100%;
  margin-top: 0.1rem;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
}

.time-display {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  min-width: 45px;
  font-weight: 300;
}

.progress-bar-container {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  cursor: pointer;
  position: relative;
  transition: height 0.2s ease, background 0.2s ease;
}

.progress-bar-container:hover {
  height: 8px;
  background: var(--border);
}

.progress-bar-fill {
  height: 100%;
  background: var(--text-primary);
  width: 0%;
  position: relative;
  transition: width 0.08s linear;
}

.progress-bar-container:hover .progress-bar-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  box-shadow: 0 0 16px var(--glow);
}

/* Volume - More compact */
.volume-area {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
}

.volume-icon {
  color: var(--text-secondary);
  font-size: 1.1rem;
  min-width: 24px;
}

.volume-slider-container {
  flex: 1;
  height: 5px;
  background: var(--bg-tertiary);
  cursor: pointer;
  position: relative;
  transition: height 0.2s ease, background 0.2s ease;
}

.volume-slider-container:hover {
  height: 7px;
  background: var(--border);
}

.volume-slider-fill {
  height: 100%;
  background: var(--text-secondary);
  width: 70%;
  transition: width 0.1s ease;
}

.volume-percent {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  min-width: 40px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 300;
}

/* Playlist Section - uses wider window */
.playlist-section {
  width: 76%;
  flex: 1;
  min-width: 0;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  overflow: hidden;
}

.playlist-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  flex-wrap: wrap;
}

.playlist-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
  text-transform: lowercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.playlist-tab i {
  font-size: 1rem;
  opacity: 0.9;
}

.playlist-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-color: var(--border);
}

.playlist-tab.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  border-bottom-color: var(--text-primary);
  margin-bottom: -1px;
  padding-bottom: calc(0.55rem + 1px);
}

.playlist-contents {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.8rem;
}

.playlist-content {
  display: none;
  height: 100%;
}

.playlist-content.active {
  display: block;
}

/* Playlist Items - fit wider layout */
.playlist-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  background: var(--bg-primary);
  margin-bottom: 0.3rem;
  border-left: 3px solid transparent;
}

.playlist-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  border-left-color: var(--text-primary);
  transform: translateX(4px);
}

.playlist-item.active {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  border-left-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--border-light);
}

.playlist-item.active .playlist-title {
  color: var(--text-primary);
  font-weight: 500;
}

.playlist-cover {
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  overflow: hidden;
}

.playlist-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-item:hover .playlist-cover {
  border-color: var(--border-light);
  transform: scale(1.06);
}

.playlist-info {
  flex: 1;
  min-width: 0;
}

.playlist-title {
  color: var(--text-secondary);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
  font-weight: 400;
  letter-spacing: 0;
}

.playlist-artist {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-weight: 300;
}

.playlist-duration {
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  background: var(--bg-primary);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
  font-weight: 300;
}

/* Active track indicator */
.playlist-item.active .playlist-duration {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* Scrollbar for playlist - theme aligned */
.playlist-contents::-webkit-scrollbar {
  width: 8px;
}

.playlist-contents::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.playlist-contents::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 2px solid var(--bg-secondary);
}

.playlist-contents::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.player-sidebar::-webkit-scrollbar {
  width: 6px;
}

.player-sidebar::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.player-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
}

.player-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Smaller viewports - stack layout */
@media (max-width: 1280px) {
  .music-window {
    min-width: auto;
    width: 96%;
    max-width: 100%;
  }
  
  .unhiintify-player {
    flex-direction: column;
    min-height: 520px;
    max-height: 88vh;
    overflow-y: auto;
  }
  
  .player-sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
  }
  
  .playlist-section {
    width: 100%;
    padding: 1.5rem;
    min-height: 380px;
  }
  
  .artwork-container {
    width: 200px;
    height: 200px;
  }
  
  .artwork-emoji {
    font-size: 4.5rem;
  }
  
  .song-title {
    font-size: 1.6rem;
  }
  
  .song-artist {
    font-size: 1rem;
  }
  
  .control-btn {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  
  .control-btn.play-btn {
    width: 64px;
    height: 64px;
    font-size: 1.9rem;
  }
  
  .playlist-item {
    padding: 0.8rem 1rem;
  }
  
  .playlist-title {
    font-size: 1.05rem;
  }
  
  .playlist-cover {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }
}

/* Extra large screens - use extra space */
@media (min-width: 1800px) {
  .unhiintify-player {
    min-height: 680px;
  }
  
  .artwork-container {
    width: 240px;
    height: 240px;
  }
  
  .artwork-emoji {
    font-size: 5.5rem;
  }
  
  .song-title {
    font-size: 2rem;
  }
  
  .song-artist {
    font-size: 1.2rem;
  }
  
  .playlist-title {
    font-size: 1.25rem;
  }
  
  .playlist-artist {
    font-size: 1.05rem;
  }
  
  .playlist-cover {
    width: 52px;
    height: 52px;
    font-size: 2rem;
  }
}