/* =====================================================
   QUEUE SIDEBAR STYLES
   Matches existing sidebar nav-item aesthetics
   ===================================================== */

/* Queue Section — sits naturally in sidebar */
.queue-section {
  margin-top: 2px;
}

/* Queue Header — styled like a nav-item */
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  background: none;
  border: none;
  border-radius: 8px;
  transition: background 0.15s;
  color: var(--text-secondary);
  font-size: 14px;
}

.queue-header:hover {
  background: var(--bg-hover);
}

.queue-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.queue-header-icon svg {
  color: white;
}

.queue-header-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

#queue-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.queue-header .chevron {
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.queue-header.collapsed .chevron {
  transform: rotate(-90deg);
}

/* Next-Up Preview — shows beneath header even when collapsed */
.queue-next-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 8px 56px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.queue-next-preview:hover {
  opacity: 0.8;
}

.queue-next-preview-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 16px 2px 56px;
}

.queue-next-preview-cover {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.queue-next-preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-next-preview-info {
  flex: 1;
  min-width: 0;
}

.queue-next-preview-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.queue-next-preview-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Queue Content — scrollable expanded list */
.queue-content {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.queue-content.collapsed {
  display: none;
}

.queue-content::-webkit-scrollbar {
  width: 4px;
}

.queue-content::-webkit-scrollbar-track {
  background: transparent;
}

.queue-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* Section Labels */
.queue-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 10px 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-clear-btn {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.queue-clear-btn:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

/* Queue Items */
.queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 16px;
  transition: background 0.15s;
  position: relative;
  border-radius: 6px;
  margin: 0 4px;
}

.queue-item:hover {
  background: var(--bg-hover);
}

.queue-item.now-playing {
  background: var(--bg-hover);
}

.queue-item.now-playing .queue-item-title {
  color: var(--accent);
}

/* Drag Handle */
.queue-drag-handle {
  width: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  cursor: grab;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.queue-item.draggable:hover .queue-drag-handle {
  opacity: 0.5;
}

.queue-drag-handle:active {
  cursor: grabbing;
}

/* Queue Item Cover */
.queue-item-cover {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  background: var(--bg-tertiary);
}

.queue-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Now Playing Animation Bars */
.queue-now-playing-indicator {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.queue-now-playing-indicator span {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: queueBounce 1.2s ease-in-out infinite;
}

.queue-now-playing-indicator span:nth-child(1) {
  animation-delay: 0s;
  height: 5px;
}

.queue-now-playing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
  height: 9px;
}

.queue-now-playing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
  height: 4px;
}

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

/* Queue Item Info */
.queue-item-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.queue-item-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.queue-item-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Remove Button */
.queue-item-remove {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}

.queue-item:hover .queue-item-remove {
  opacity: 0.5;
}

.queue-item-remove:hover {
  opacity: 1 !important;
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Drag States */
.queue-item.dragging {
  opacity: 0.4;
}

.queue-item.drag-over {
  border-top: 2px solid var(--accent);
  padding-top: 3px;
}

/* More Indicator */
.queue-more-indicator {
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Empty State */
.queue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  text-align: center;
}

.queue-empty p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.queue-empty-sub {
  font-size: 11px !important;
  margin-top: 2px !important;
  opacity: 0.5;
}

/* =====================================================
   QUEUE BUTTONS (Play Next / Add to Queue)
   Player bar + track rows
   ===================================================== */

.queue-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.queue-action-btn:hover {
  color: var(--text-primary);
}

/* Track row queue buttons */
.track-queue-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.track-row:hover .track-queue-actions,
.track-item:hover .track-queue-actions {
  opacity: 1;
}

.track-queue-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.track-queue-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.track-queue-btn svg {
  width: 16px;
  height: 16px;
}

/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 768px) {
  .queue-content {
    max-height: 280px;
  }

  .queue-drag-handle {
    opacity: 0.4;
  }

  .queue-item-remove {
    opacity: 0.5;
  }

  .track-queue-actions {
    opacity: 1;
  }

  .queue-next-preview {
    padding-left: 44px;
  }

  .queue-next-preview-label {
    padding-left: 44px;
  }
}
