/* ═══════════════════════════════════════════════════════════════
   QUEUE PANEL — DIGR
   Steve Jobs: "Design is not just what it looks like.
   Design is how it works."
   
   The queue slides up from the player bar like a drawer.
   Current track glows. Everything else recedes.
   ═══════════════════════════════════════════════════════════════ */

/* ===== Trigger Button ===== */
.queue-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s;
  position: relative;
}
.queue-toggle:hover { color: rgba(255,255,255,0.8); }
.queue-toggle.has-queue { color: rgba(255,255,255,0.6); }
.queue-toggle.is-open { color: var(--accent, #00d2ff); }

.queue-badge {
  position: absolute;
  top: 0;
  right: -2px;
  background: var(--accent, #00d2ff);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}
.queue-toggle.has-queue .queue-badge {
  opacity: 1;
  transform: scale(1);
}

/* ===== Panel Container ===== */
.queue-panel {
  position: fixed;
  bottom: 64px; /* above bottom bar */
  right: 16px;
  width: 340px;
  max-height: 420px;
  background: rgba(12, 12, 18, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  
  /* Entrance animation */
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.queue-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ===== Header ===== */
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.queue-header-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.5);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
}

.queue-header-actions {
  display: flex;
  gap: 4px;
}

.queue-header-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.queue-header-btn:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05);
}
.queue-header-btn--danger:hover {
  color: #ff6b6b;
  background: rgba(255,100,100,0.08);
}

/* ===== Track List ===== */
.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.queue-list::-webkit-scrollbar { width: 4px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ===== Queue Item ===== */
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.queue-item:hover {
  background: rgba(255,255,255,0.03);
}

/* Current track highlight */
.queue-item.is-current {
  background: rgba(0, 210, 255, 0.04);
}
.queue-item.is-current::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--accent, #00d2ff);
  border-radius: 1px;
}

/* Played tracks (above current) */
.queue-item.is-played {
  opacity: 0.4;
}

/* ===== Item Art ===== */
.queue-item-art {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.queue-item-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Playing indicator on current track art */
.queue-item.is-current.is-playing .queue-item-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-item-bars {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(0,0,0,0.4);
}
.queue-item.is-current.is-playing .queue-item-bars {
  display: flex;
}
.queue-item-bar {
  width: 2px;
  background: var(--accent, #00d2ff);
  border-radius: 1px;
  animation: queueBarPulse 0.8s ease-in-out infinite;
}
.queue-item-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.queue-item-bar:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.queue-item-bar:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.queue-item-bar:nth-child(4) { height: 6px; animation-delay: 0.45s; }

@keyframes queueBarPulse {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* ===== Item Info ===== */
.queue-item-info {
  flex: 1;
  min-width: 0;
}
.queue-item-title {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-item.is-current .queue-item-title {
  color: var(--accent, #00d2ff);
}
.queue-item-artist {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Item Duration ===== */
.queue-item-duration {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ===== Remove Button ===== */
.queue-item-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.15);
  cursor: pointer;
  padding: 4px;
  font-size: 11px;
  line-height: 1;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}
.queue-item:hover .queue-item-remove {
  opacity: 1;
}
.queue-item-remove:hover {
  color: #ff6b6b;
  background: rgba(255,100,100,0.1);
}

/* ===== Empty State ===== */
.queue-empty {
  padding: 32px 16px;
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
}
.queue-empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.3;
}

/* ===== Footer ===== */
.queue-footer {
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  text-align: center;
}
