/* BPM 221 — Expérience musicale tout-en-un
   Améliore le lecteur personnel, la file d'attente, l'historique et les playlists
   sans remplacer le design BPM existant. */

.bpm-gp-panel-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr) minmax(260px, .8fr);
  gap: 1rem;
}

.bpm-gp-panel-title {
  min-height: 32px;
}

.bpm-gp-panel-title .bpm221-count {
  margin-left: .35rem;
  min-width: 24px;
  height: 22px;
  padding: 0 .45rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14,165,255,.12);
  color: #bae6fd;
  border: 1px solid rgba(14,165,255,.22);
  font-size: 11px;
  font-weight: 800;
}

.bpm-gp-history {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: .45rem;
  padding-right: .15rem;
}

.bpm221-history-item,
.bpm221-queue-main {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 0;
}

.bpm221-history-item {
  padding: .55rem;
  border: 1px solid var(--bdr);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.bpm221-history-item:hover,
.bpm221-history-item:focus-visible {
  border-color: rgba(14,165,255,.42);
  background: rgba(14,165,255,.07);
  outline: none;
}

.bpm221-history-cover {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.06);
  color: var(--muted);
}

.bpm221-history-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bpm221-history-copy,
.bpm221-queue-copy {
  min-width: 0;
  flex: 1;
}

.bpm221-history-copy strong,
.bpm221-history-copy small,
.bpm221-queue-copy strong,
.bpm221-queue-copy small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bpm221-history-copy strong,
.bpm221-queue-copy strong {
  color: #fff;
  font-size: 13px;
}

.bpm221-history-copy small,
.bpm221-queue-copy small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.bpm-gp-qitem.bpm221-qitem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .4rem;
  align-items: center;
  padding: .5rem;
}

.bpm-gp-qitem.bpm221-qitem.on {
  border-color: rgba(14,165,255,.48);
  background: rgba(14,165,255,.09);
}

.bpm221-queue-main {
  padding: .15rem;
}

.bpm221-queue-actions {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.bpm221-queue-action {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.bpm221-queue-action:hover,
.bpm221-queue-action:focus-visible {
  color: #fff;
  border-color: var(--bdr);
  background: rgba(255,255,255,.06);
  outline: none;
}

.bpm221-queue-action.danger:hover {
  color: #fecaca;
  border-color: rgba(239,68,68,.34);
  background: rgba(239,68,68,.09);
}

.bpm221-player-shortcuts {
  color: var(--muted);
  font-size: 11px;
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.bpm221-player-shortcuts kbd {
  font: inherit;
  color: #dbeafe;
  padding: .12rem .35rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}

/* Page playlist */
.bpm221-playlist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}

.bpm221-playlist-filter {
  flex: 1 1 250px;
  max-width: 420px;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--bdr);
  border-radius: 999px;
  padding: 0 .75rem;
  background: rgba(255,255,255,.035);
}

.bpm221-playlist-filter i {
  color: var(--muted);
}

.bpm221-playlist-filter input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  min-height: 40px;
}

.bpm221-track-shell {
  position: relative;
  min-width: 0;
}

.bpm221-track-shell[draggable="true"] {
  padding-right: 76px;
}

.bpm221-track-shell.is-dragging {
  opacity: .5;
}

.bpm221-track-shell.is-drag-over .bpm188-track-row {
  border-color: rgba(14,165,255,.75);
  box-shadow: 0 0 0 2px rgba(14,165,255,.14);
}

.bpm221-owner-actions {
  position: absolute;
  top: 50%;
  right: .55rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: .25rem;
}

.bpm221-owner-action {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--bdr);
  background: rgba(5,12,25,.88);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.bpm221-owner-action:hover,
.bpm221-owner-action:focus-visible {
  color: #fff;
  border-color: rgba(14,165,255,.45);
  outline: none;
}

.bpm221-owner-action.danger:hover {
  color: #fecaca;
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.08);
}

.bpm221-drag-handle {
  cursor: grab;
}

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

.bpm221-filter-empty {
  display: none;
  padding: 1rem;
  border: 1px dashed var(--bdr);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.bpm221-filter-empty.is-visible {
  display: block;
}

/* Lecteur privé */
.bpm221-private-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin: .75rem 0;
}

.bpm221-private-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}

@media (max-width: 1220px) {
  .bpm-gp-panel-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  }
  .bpm-gp-panel-grid > :last-child {
    grid-column: 1 / -1;
  }
  .bpm-gp-history {
    grid-template-columns: repeat(2, minmax(0,1fr));
    max-height: 220px;
  }
}

@media (max-width: 760px) {
  .bpm-gp-panel-grid {
    grid-template-columns: 1fr;
  }
  .bpm-gp-panel-grid > :last-child {
    grid-column: auto;
  }
  .bpm-gp-history {
    grid-template-columns: 1fr;
    max-height: 25vh;
  }
  .bpm-gp-qitem.bpm221-qitem {
    grid-template-columns: minmax(0,1fr) auto;
  }
  .bpm221-queue-action.move {
    display: none;
  }
  .bpm221-track-shell[draggable="true"] {
    padding-right: 42px;
  }
  .bpm221-owner-actions {
    right: .35rem;
  }
  .bpm221-owner-action.bpm221-drag-handle {
    display: none;
  }
  .bpm221-playlist-toolbar {
    align-items: stretch;
  }
  .bpm221-playlist-filter {
    max-width: none;
  }
}
