* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 11px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #1a1a2e;
  color: #e0e0e0;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- Main content ---- */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ---- Player area ---- */
.player-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #0d0d1a;
}

.display-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 50%, #0d0d1a 100%);
  min-height: 120px;
}

.display-area canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.display-area video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.display-area video.active {
  display: block;
}

.placeholder-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #555;
  font-size: 14px;
}

.placeholder-art .icon {
  font-size: 48px;
  opacity: 0.3;
}

/* ---- Transport controls ---- */
.transport {
  flex-shrink: 0;
  background: #222236;
  border-top: 1px solid #333;
  padding: 6px 10px 8px;
}

.seek-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.time-display {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  color: #8af;
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}

.seek-bar-container {
  flex: 1;
  height: 6px;
  background: #333;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.seek-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2196f3, #4caf50);
  border-radius: 3px;
  width: 0;
  pointer-events: none;
  transition: width 0.1s linear;
}

.seek-bar-container:hover .seek-bar-fill {
  background: linear-gradient(90deg, #42a5f5, #66bb6a);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.transport-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #ccc;
  font-size: 16px;
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  border-radius: 3px;
  line-height: 1;
}

.transport-btn:hover {
  background: #3a3a4e;
  border-color: #555;
  color: #fff;
}

.transport-btn:active {
  background: #4a9eff;
  color: #fff;
}

.transport-btn.play-btn {
  font-size: 20px;
  width: 36px;
  height: 32px;
}

.volume-section {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.volume-btn {
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 14px;
  cursor: default;
  padding: 2px 4px;
  border-radius: 3px;
}

.volume-btn:hover {
  color: #fff;
  background: #3a3a4e;
}

.volume-slider-container {
  width: 80px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.volume-slider-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a9eff, #7ecbff);
  border-radius: 2px;
  width: 80%;
  pointer-events: none;
}

/* ---- Playlist panel ---- */
.playlist-panel {
  width: 240px;
  background: #1e1e32;
  border-left: 1px solid #333;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.playlist-panel.hidden {
  display: none;
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: #2a2a3e;
  border-bottom: 1px solid #333;
  font-size: 11px;
  font-weight: bold;
  color: #aaa;
}

.playlist-actions {
  display: flex;
  gap: 2px;
}

.playlist-action-btn {
  background: #333;
  border: 1px solid #444;
  color: #ccc;
  font-size: 10px;
  padding: 2px 6px;
  cursor: default;
  border-radius: 2px;
}

.playlist-action-btn:hover {
  background: #4a9eff;
  color: #fff;
  border-color: #4a9eff;
}

.playlist-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.playlist-list::-webkit-scrollbar {
  width: 8px;
}

.playlist-list::-webkit-scrollbar-track {
  background: #1a1a2e;
}

.playlist-list::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  cursor: default;
  font-size: 11px;
  border-bottom: 1px solid #252540;
}

.playlist-item:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

.playlist-item:hover {
  background: rgba(74,158,255,0.15);
}

.playlist-item.selected {
  background: rgba(74,158,255,0.25);
}

.playlist-item.playing {
  color: #4a9eff;
  font-weight: bold;
}

.playlist-item .track-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.playlist-item .track-duration {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 10px;
  color: #888;
  flex-shrink: 0;
}

/* ---- Status bar ---- */
.status-bar {
  display: flex;
  align-items: center;
  padding: 2px 8px;
  background: #222236;
  border-top: 1px solid #333;
  font-size: 10px;
  color: #888;
  flex-shrink: 0;
  gap: 16px;
}

.status-bar .status-section {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-bar .status-section:first-child {
  flex: 1;
}

.status-bar .skin-label {
  font-size: 9px;
  color: #666;
}

/* ---- Hidden elements ---- */
.hidden-input {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
}

.hidden {
  display: none !important;
}

/* ---- Winamp compact mode ---- */

/* When compact mode is active with a skin, hide everything except the winamp wrapper */
body.winamp-compact .menu-bar,
body.winamp-compact .main-content,
body.winamp-compact .status-bar {
  display: none !important;
}

body.winamp-compact {
  background: #0a0a14;
}

body.winamp-compact .winamp-wrapper {
  flex: 1;
  border-bottom: none;
  padding: 0;
}

.winamp-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a14;
  flex-shrink: 0;
  padding: 4px;
  border-bottom: 1px solid #333;
}

.winamp-wrapper.hidden {
  display: none;
}

.winamp-skin {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  border: 1px solid #444;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

body.winamp-compact .winamp-skin {
  border: none;
  box-shadow: none;
}

/* ---- Winamp context menu ---- */
.winamp-context-menu {
  position: fixed;
  z-index: 9999;
  background: #2a2a3e;
  border: 1px solid #555;
  border-radius: 3px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.6);
  padding: 4px 0;
  min-width: 160px;
  font-size: 11px;
  color: #e0e0e0;
}

.winamp-ctx-item {
  position: relative;
  padding: 4px 20px 4px 18px;
  cursor: default;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.winamp-ctx-item:hover {
  background: rgba(74, 158, 255, 0.3);
  color: #fff;
}

.winamp-ctx-item.checked::before {
  content: '\2713';
  position: absolute;
  left: 4px;
  font-size: 10px;
}

.winamp-ctx-sep {
  height: 1px;
  background: #444;
  margin: 3px 6px;
}

/* Winamp button active state -- toggle background-position */
.winamp-skin [class*="winamp-btn-"].active {
  background-position: var(--active-pos) !important;
}

/* Use dataset for active states via CSS */
.winamp-skin div.active[data-active-pos] {
  background-position: attr(data-active-pos) !important;
}

/* ---- Skin selector dialog ---- */
.skin-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #444;
  background: #1a1a2e;
  border-radius: 3px;
}

.skin-list::-webkit-scrollbar {
  width: 6px;
}

.skin-list::-webkit-scrollbar-track {
  background: #1a1a2e;
}

.skin-list::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.skin-item {
  padding: 4px 8px;
  cursor: default;
  font-size: 11px;
  border-bottom: 1px solid #252540;
}

.skin-item:hover {
  background: rgba(74,158,255,0.15);
}

.skin-item.selected {
  background: rgba(74,158,255,0.3);
  color: #fff;
}
