/* =========================================================
   Track List Rows, Audio Player, Empty States
   ========================================================= */

/* Slim horizontal row list — replaces the old card grid. One item per
   row, thumbnail on the left doubles as the play/pause button, title in
   the middle, Download (dark) + Cart (white) buttons on the right. Capped
   width keeps it readable on wide screens without going full-bleed. */
.track-list {
  display: flex;
  flex-direction: column;
  max-width: 760px;
}

/* Tablet and up: 2 columns, using the page's full available width instead
   of the narrow single-column cap. Each row becomes a self-contained
   bordered card (rather than a divider-separated line) since side-by-side
   items can't share one flowing border the way a single column can. */
@media (min-width: 640px) {
  .track-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem 1.5rem;
    max-width: 100%;
  }

  .track-row {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.85rem;
  }
}

.track-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.track-list .track-row:first-child {
  border-top: 1px solid var(--color-border);
}
.track-row:hover {
  background-color: var(--color-surface-hover);
}

.track-row-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--color-surface);
}
.track-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.row-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.28);
  transition: background-color 0.15s ease;
}
.track-row-thumb:hover .row-play-icon {
  background-color: rgba(0, 0, 0, 0.5);
}
.row-play-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.track-row-info {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}
.track-row:hover .row-title {
  color: var(--color-accent);
}

.row-download-btn,
.row-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.row-download-btn svg,
.row-cart-btn svg {
  width: 17px;
  height: 17px;
}

/* Download: dark themed, always "active" looking — tapping it either
   downloads (if owned) or opens the purchase prompt (if not). */
.row-download-btn {
  background-color: var(--color-surface-hover);
  color: var(--color-fg);
}
.row-download-btn:hover {
  background-color: #262626;
}

/* Cart: white, per client spec. */
.row-cart-btn {
  background-color: #f5f5f5;
  color: var(--color-bg);
}
.row-cart-btn:hover {
  background-color: #fff;
}
.row-cart-btn:disabled {
  background-color: var(--color-surface-hover);
  color: var(--color-muted);
  cursor: not-allowed;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.audio-player.full { width: 100%; }

.audio-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  color: #fff;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}
.audio-play-btn svg { width: 14px; height: 14px; }
.audio-play-btn:hover { background-color: var(--color-accent-hover); }
.audio-play-btn:disabled {
  background-color: var(--color-muted-dark);
  cursor: not-allowed;
}

.audio-time {
  font-size: 0.72rem;
  color: var(--color-muted-dark);
  width: 34px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.audio-time.end { text-align: right; }

.audio-seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  outline: none;
  cursor: pointer;
}
.audio-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.audio-seek::-webkit-slider-thumb:hover { transform: scale(1.2); }
.audio-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
}

.empty-state {
  text-align: center;
  padding: 6rem 1.5rem;
}
.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  margin: 0 auto 1.5rem;
  color: var(--color-muted-dark);
}
.empty-state-icon svg { width: 24px; height: 24px; }
.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--color-muted);
  margin-bottom: 2rem;
}