/* ==============================================================================
   NEKKETSU RETRO AUDIO DECK & SEAMLESS ROUTER STYLING
   ============================================================================== */

:root {
  --audio-bar-height: 52px;
  --audio-bg: #090d16;
  --audio-border: #ffd166;
  --audio-cyan: #06d6a0;
}

body {
  padding-bottom: var(--audio-bar-height) !important;
}

#nekketsu-audio-deck {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--audio-bar-height);
  background: var(--audio-bg);
  border-top: 2px solid var(--audio-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: 'JetBrains Mono', monospace;
  user-select: none;
}

/* Left: Controls & Equalizer */
.deck-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-btn {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  box-shadow: 2px 2px 0 #000;
}

.deck-btn:hover {
  background: #334155;
  border-color: var(--audio-cyan);
  color: var(--audio-cyan);
  transform: translate(-1px, -1px);
}

.deck-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 #000;
}

.deck-btn-play {
  background: #065f46;
  border-color: var(--audio-cyan);
  color: #a7f3d0;
  min-width: 44px;
}

.deck-btn-play.playing {
  background: #991b1b;
  border-color: #ef4444;
  color: #fecaca;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(6, 214, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0); }
}

/* Animated 8-bit Equalizer */
.deck-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  padding: 0 4px;
}

.eq-bar {
  width: 3px;
  height: 4px;
  background: #64748b;
  border-radius: 1px;
  transition: height 0.1s ease;
}

.deck-equalizer.active .eq-bar:nth-child(1) { animation: eq-anim 0.8s ease-in-out infinite alternate; background: var(--audio-cyan); }
.deck-equalizer.active .eq-bar:nth-child(2) { animation: eq-anim 0.5s ease-in-out infinite alternate 0.2s; background: var(--audio-border); }
.deck-equalizer.active .eq-bar:nth-child(3) { animation: eq-anim 0.7s ease-in-out infinite alternate 0.4s; background: var(--audio-cyan); }
.deck-equalizer.active .eq-bar:nth-child(4) { animation: eq-anim 0.6s ease-in-out infinite alternate 0.1s; background: var(--audio-border); }

@keyframes eq-anim {
  0% { height: 4px; }
  100% { height: 18px; }
}

/* Middle: Track Ticker */
.deck-track-info {
  flex: 1;
  max-width: 450px;
  margin: 0 16px;
  overflow: hidden;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-track-badge {
  font-size: 10px;
  background: rgba(255, 209, 102, 0.2);
  color: var(--audio-border);
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.deck-track-title {
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}

/* Right: Volume & Playlist Drawer Toggle */
.deck-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deck-vol-slider {
  width: 80px;
  accent-color: var(--audio-border);
  cursor: pointer;
}

/* Playlist Popover Modal */
#deck-playlist-modal {
  display: none;
  position: fixed;
  bottom: calc(var(--audio-bar-height) + 8px);
  right: 16px;
  width: 340px;
  max-height: 380px;
  background: #0f172a;
  border: 2px solid var(--audio-border);
  box-shadow: 4px 4px 0 #000;
  border-radius: 6px;
  z-index: 100000;
  overflow-y: auto;
  font-family: 'Rubik', sans-serif;
}

#deck-playlist-modal.open {
  display: block;
}

.playlist-header {
  background: #1e293b;
  padding: 10px 14px;
  font-family: 'Russo One', sans-serif;
  font-size: 13px;
  color: var(--audio-border);
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playlist-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.playlist-item.active {
  background: rgba(6, 214, 160, 0.15);
  color: var(--audio-cyan);
  font-weight: 800;
  border-left: 3px solid var(--audio-cyan);
}

/* Mobile responsiveness */
@media (max-width: 680px) {
  .deck-vol-slider, .deck-vol-label {
    display: none;
  }
  .deck-track-info {
    margin: 0 8px;
    max-width: 220px;
  }
}

#nekketsu-audio-deck.deck-collapsed { width: 52px; left: auto; right: 0; }
#nekketsu-audio-deck.deck-collapsed > :not(#deckCollapse) { display: none; }
