/* ============================================================
   BH Songs Library — Card Grid Redesign v2
   Scope: .bh-hub-v5.bh-songlib-v2
   Design: amber accent, 1:1 cover cards, genre filter strip
   ============================================================ */

.bh-hub-v5.bh-songlib-v2 {
  --accent:        #C8FF00;
  --accent-dim:    rgba(200,255,0,.12);
  --accent-border: rgba(200,255,0,.25);
  --accent-glow:   rgba(200,255,0,.30);
}

/* ── Section header ── */
.bhsl-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 0 10px;
}
.bhsl-section-head h2 {
  margin: 0;
  font: 700 15px/1 'Syne', system-ui, sans-serif !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85) !important;
}
#main .bhsl-section-head h2 {
  font: 700 15px/1 'Syne', system-ui, sans-serif !important;
  color: rgba(255,255,255,.85) !important;
}
.bhsl-count-badge {
  font: 600 9px/1 'DM Mono', monospace;
  letter-spacing: .14em;
  color: rgba(200,255,0,.8);
  background: rgba(200,255,0,.1);
  border: 1px solid rgba(200,255,0,.2);
  border-radius: 999px;
  padding: 3px 8px;
}

/* ── Genre pill strip ── */
.bhsl-genre-strip {
  display: flex;
  gap: 6px;
  padding: 10px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
  align-items: center;
}
.bhsl-genre-strip::-webkit-scrollbar { display: none; }

.bhsl-genre-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.45);
  font: 600 9px/1 'DM Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  user-select: none;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}
.bhsl-genre-pill:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.7);
  border-color: rgba(255,255,255,.12);
}
.bhsl-genre-pill.is-active {
  background: rgba(200,255,0,.12);
  border-color: rgba(200,255,0,.3);
  color: #F5B84A;
}

/* ── Card grid ── */
.bh-hub-v5.bh-songlib-v2 .bh-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 10px !important;
}

/* ── Song card: cover-first layout ── */
.bh-hub-v5.bh-songlib-v2 .bh-card {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  cursor: pointer;
  gap: 0 !important;
  transition:
    border-color 180ms cubic-bezier(0.19,1,0.22,1),
    background   180ms cubic-bezier(0.19,1,0.22,1),
    box-shadow   180ms cubic-bezier(0.19,1,0.22,1) !important;
}

/* 1:1 cover art */
.bhsl-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(255,255,255,.04);
  flex-shrink: 0;
}
.bhsl-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 380ms cubic-bezier(0.19,1,0.22,1);
}
.bh-hub-v5.bh-songlib-v2 .bh-card:hover .bhsl-cover-wrap img {
  transform: scale(1.04);
}

.bhsl-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.12);
}
.bhsl-cover-placeholder svg { width: 32px; height: 32px; }

.bhsl-cover-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,5,10,.45);
  opacity: 0;
  transition: opacity 200ms ease;
}
.bhsl-cover-play svg {
  width: 36px;
  height: 36px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
.bh-hub-v5.bh-songlib-v2 .bh-card:hover .bhsl-cover-play,
.bh-hub-v5.bh-songlib-v2 .bh-card.is-playing .bhsl-cover-play { opacity: 1; }

/* ── Card info below cover ── */
.bhsl-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px 8px;
  flex: 1;
}

.bhsl-song-title {
  font: 600 12px/1.2 'Syne', system-ui, sans-serif !important;
  color: rgba(255,255,255,.88) !important;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
#main .bhsl-song-title {
  font: 600 12px/1.2 'Syne', system-ui, sans-serif !important;
  color: rgba(255,255,255,.88) !important;
}

.bhsl-artist-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bhsl-artist-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(200,255,0,.2);
}
.bhsl-artist-name {
  font: 500 9px/1 'DM Mono', monospace;
  letter-spacing: .04em;
  color: rgba(255,255,255,.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bhsl-chip-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.bhsl-chip {
  font: 600 7px/1 'DM Mono', monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 0;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.bhsl-chip--genre {
  color: rgba(200,255,0,.7);
  background: rgba(200,255,0,.07);
  border-color: rgba(200,255,0,.15);
}
.bhsl-price {
  font: 700 10px/1 'DM Mono', monospace;
  letter-spacing: .04em;
  color: rgba(255,255,255,.55);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Active/playing state ── */
.bh-hub-v5.bh-songlib-v2 .bh-card.is-playing {
  border-color: rgba(200,255,0,.45) !important;
  background: rgba(200,255,0,.04) !important;
  box-shadow:
    0 0 0 1px rgba(200,255,0,.15),
    0 0 20px rgba(200,255,0,.12),
    inset 0 1px 0 rgba(255,255,255,.06) !important;
}

/* ── Hide elements not needed in card-grid mode ── */
.bh-hub-v5.bh-songlib-v2 .bh-waveform-container,
.bh-hub-v5.bh-songlib-v2 .bh-master-panel,
.bh-hub-v5.bh-songlib-v2 .bh-downloads,
.bh-hub-v5.bh-songlib-v2 .bh-edit,
.bh-hub-v5.bh-songlib-v2 .bh-links,
.bh-hub-v5.bh-songlib-v2 .bh-title-row,
.bh-hub-v5.bh-songlib-v2 .bh-kv,
.bh-hub-v5.bh-songlib-v2 .bh-card-footer { display: none !important; }

/* ── Hide v2-only elements in non-v2 mode ── */
.bh-hub-v5:not(.bh-songlib-v2) .bhsl-cover-wrap,
.bh-hub-v5:not(.bh-songlib-v2) .bhsl-card-info,
.bh-hub-v5:not(.bh-songlib-v2) .bhsl-section-head,
.bh-hub-v5:not(.bh-songlib-v2) .bhsl-genre-strip { display: none !important; }

/* ── GSAP initial state ── */
.bh-songlib-card--gsap-ready {
  opacity: 0;
  transform: translateY(16px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .bh-hub-v5.bh-songlib-v2 .bh-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 8px !important;
  }
}
@media (max-width: 480px) {
  .bh-hub-v5.bh-songlib-v2 .bh-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .bhsl-song-title { font-size: 11px !important; }
}
