/* The YouTube Party's queue (`components/party/queue_panel.rs`), a tab of
   the side column: its rows, the host's buttons, the edit form, and the
   song recognition line. */

.queue-panel {
  display: grid;
  gap: var(--space-2);
}

.queue-panel__empty {
  font-size: var(--text-sm);
}

/* The host's song recognition, while it downloads or starts, or failed. */
.queue-panel__model {
  margin: 0;
  font-size: var(--text-xs);
}

.queue {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-height: var(--size-queue-row);
  padding: var(--space-2);
  border-radius: var(--radius-small);
  transition: background-color var(--duration-fast);
}

.queue-item .party-thumb {
  width: var(--size-queue-thumb);
}

.queue-item--current {
  background: var(--color-primary-soft);
}

.queue-item--played .queue-item__text {
  color: var(--color-muted);
}

.queue-item__text {
  min-width: 0;
}

.queue-item__title,
.queue-item__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--line-height-tight);
}

.queue-item__meta {
  display: flex;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.queue-item__now {
  color: var(--color-primary-text);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.queue-item__actions {
  display: flex;
  align-items: center;
}

.queue-item__actions .button--icon {
  width: var(--size-control-small);
  min-height: var(--size-control-small);
}

/* A pointer that can hover: the buttons lie over the row's end and show on
   hover or when one has focus, so the title keeps the width. Hidden only by
   opacity, so they stay in the tab order with their names. */
@media (hover: hover) {
  .queue-item__actions {
    position: absolute;
    top: 0;
    right: 0;
    height: var(--size-queue-row);
    padding: 0 var(--space-1) 0 var(--space-4);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
    background: linear-gradient(to right, transparent, var(--color-queue-row) var(--space-4));
    opacity: 0;
    transition: opacity var(--duration-fast);
  }

  /* The highlight under the overlay too: the soft tint, made opaque. */
  .queue-item--current .queue-item__actions {
    background: linear-gradient(
      to right,
      transparent,
      color-mix(in srgb, var(--color-primary) 14%, var(--color-queue-row)) var(--space-4)
    );
  }

  .queue-item:hover .queue-item__actions,
  .queue-item:focus-within .queue-item__actions {
    opacity: 1;
  }
}

.queue-edit {
  display: grid;
  grid-column: 1 / -1;
  gap: var(--space-2);
}

.queue-edit__field {
  display: grid;
  gap: var(--space-1);
}

.queue-edit__label {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.queue-edit__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
