/* Persistent player bar - 70s style: warm brown bar with cream controls.
 * Sits above mobile browser bottom bar (notch home indicator).
 */

.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--brown);
  border-top: 4px solid var(--mustard);
  z-index: 60;
  padding-bottom: var(--safe-bot);
  color: var(--cream);
  box-shadow: 0 -4px 0 var(--avocado), 0 -8px 16px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.player-bar-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 2fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  min-height: 68px;
}

/* Now playing block */
.player-now {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.now-cover {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--cream);
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--mustard);
}
.now-meta { min-width: 0; }
.now-title {
  font-size: 14px; font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-artist {
  font-size: 12px; color: var(--mustard);
  font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Controls */
.player-controls {
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
}
.ctrl-btn {
  background: none; border: none;
  color: var(--cream);
  font-size: 18px;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s, transform 0.1s;
}
.ctrl-btn:hover { background: var(--mustard); color: var(--brown); }
.ctrl-play {
  background: var(--accent); color: var(--cream);
  width: 44px; height: 44px;
  font-size: 18px;
  border: 3px solid var(--mustard);
  box-shadow: 2px 2px 0 var(--cream);
}
.ctrl-play:hover {
  background: var(--mustard); color: var(--brown);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--cream);
}
.ctrl-play:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--cream);
}

/* Repeat / Shuffle mode buttons - dim until active */
.ctrl-mode {
  position: relative;
  font-size: 16px;
  color: var(--mustard);
  width: 32px; height: 32px;
  opacity: 0.6;
}
.ctrl-mode:hover { opacity: 1; }
.ctrl-mode.active {
  opacity: 1;
  color: var(--accent);
  background: var(--cream);
}
.ctrl-mode.active::after {
  content: '';
  display: block;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
}

/* Progress */
.player-progress {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.time {
  font-size: 11px; color: var(--mustard);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: center;
  font-family: var(--font-body);
}
.seek {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  background: transparent;
  height: 4px;
}
.seek::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--cream);
  border-radius: 3px;
  border: 1px solid var(--mustard);
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: -5px;
  cursor: pointer;
  border: 2px solid var(--cream);
  box-shadow: 0 0 0 1px var(--brown);
}
.seek::-moz-range-track {
  height: 6px; background: var(--cream); border-radius: 3px;
  border: 1px solid var(--mustard);
}
.seek::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--accent); border: 2px solid var(--cream);
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 0 1px var(--brown);
}

/* Volume */
.player-volume {
  display: flex; align-items: center; gap: 4px;
}
.volume {
  width: 80px;
  -webkit-appearance: none; appearance: none;
  background: transparent; height: 4px;
}
.volume::-webkit-slider-runnable-track {
  height: 4px; background: var(--cream); border-radius: 2px;
}
.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: -4px;
  cursor: pointer;
  border: 2px solid var(--cream);
}
.volume::-moz-range-track {
  height: 4px; background: var(--cream); border-radius: 2px;
}
.volume::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--accent); border: 2px solid var(--cream);
  border-radius: 50%; cursor: pointer;
}

/* Mobile: collapse volume and rearrange controls */
@media (max-width: 768px) {
  .player-bar-inner {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 8px 10px;
  }
  .player-progress {
    grid-column: 1 / -1;
    order: 3;
    padding: 0 4px 4px;
  }
  .now-cover { width: 44px; height: 44px; }
  .now-title { font-size: 13px; }
  .now-artist { font-size: 11px; }
  .player-volume { display: none; }
  .ctrl-mode { display: none; } /* hide on mobile to save space */
}

/* Very small phones: shrink further */
@media (max-width: 380px) {
  .ctrl-btn { width: 34px; height: 34px; font-size: 14px; }
  .ctrl-play { width: 38px; height: 38px; }
}
