/* =============================================
   RAWFIND QUEUE PANEL
   Slides up from player bar, full-width,
   styled like SoundCloud's "Next up"
   ============================================= */

#rf-queue-drawer {
  position: fixed;
  /* Anchored just above the player bar */
  bottom: 72px;
  /* Full width, aligned to player */
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  /* Fixed height with inner scroll */
  height: auto;
  max-height: calc(100vh - 160px);
  min-height: 0;
  background: #111118;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  /* Hidden state — sits below player bar */
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
  z-index: 998;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 48px rgba(0,0,0,0.7);
}

#rf-queue-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header row */
.rf-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.rf-queue-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.rf-queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rf-queue-clear {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.rf-queue-clear:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

/* Scrollable list */
.rf-queue-list {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  max-height: 420px;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.rf-queue-list::-webkit-scrollbar { width: 4px; }
.rf-queue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* Queue item */
.rf-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  border-left: 3px solid transparent;
}
.rf-queue-item:hover { background: rgba(255,255,255,0.04); }

.rf-queue-item.rf-queue-current {
  background: rgba(255,255,255,0.05);
  border-left-color: var(--accent-hot);
}

/* Playing animation bars (replaces rank number when current) */
.rf-queue-item.rf-queue-current .rf-queue-num {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  width: 18px;
}

.rf-eq-bar {
  width: 3px;
  background: var(--accent-hot);
  border-radius: 1px;
  animation: rf-eq 0.8s ease-in-out infinite;
  flex-shrink: 0;
}
.rf-eq-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.rf-eq-bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.rf-eq-bar:nth-child(3) { height: 70%; animation-delay: 0.4s; }
@keyframes rf-eq {
  0%, 100% { transform: scaleY(0.5); }
  50%       { transform: scaleY(1); }
}

.rf-queue-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
  justify-content: flex-end;
}

.rf-queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg-raised);
  flex-shrink: 0;
}

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

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

.rf-queue-item-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.rf-queue-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rf-queue-duration {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.rf-queue-platform-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: 3px;
}
.rf-queue-platform-badge.yt  { background: rgba(255,0,0,0.15);   color: #ff4444; }
.rf-queue-platform-badge.sc  { background: rgba(255,85,0,0.15);  color: #ff7733; }
.rf-queue-platform-badge.sp  { background: rgba(29,185,84,0.15); color: #1db954; }

/* Empty state */
.rf-queue-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.rf-queue-empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.4; }

/* Autoplay toggle row */
.rf-queue-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.rf-autoplay-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.rf-autoplay-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.rf-toggle {
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.rf-toggle.on { background: var(--accent-hot); }
.rf-toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.rf-toggle.on::after { transform: translateX(18px); }

/* Mobile */
@media (max-width: 640px) {
  #rf-queue-drawer { max-width: 100%; border-radius: 12px 12px 0 0; }
}
