/* ═══════════════════════════════════════════
   CONTENT LIBRARY — Search, Sort, Filter, Grid/List views
   Used by both music and video libraries
   ═══════════════════════════════════════════ */

.lib-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  padding: 12px 0;
}

.lib-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lib-search {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.lib-search:focus {
  border-color: var(--accent);
}
.lib-search-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lib-tag {
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-transform: capitalize;
}
.lib-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lib-tag-active {
  background: var(--accent-fire);
  border-color: var(--accent-fire);
  color: #000;
  font-weight: 700;
}
.lib-tag-clear {
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.lib-tag-clear:hover {
  background: var(--accent-red);
  color: #000;
}

.lib-sort-view {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lib-sort {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
}

.lib-view-btns {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.lib-view-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.lib-view-btn:hover, .lib-view-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── GRID VIEW ─── */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ─── LIST VIEW ─── */
.lib-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lib-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── ALBUM CARD (Grid) ─── */
.album-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}
.album-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.album-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
}

.album-card-info {
  padding: 10px 12px;
}

.album-card-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}

.album-card-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}

.album-card-genre {
  padding: 1px 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* ─── ALBUM CARD (List) ─── */
.album-card-list {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.album-card-list:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.album-card-list-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.album-card-list-info {
  flex: 1;
  min-width: 0;
}

.album-card-list-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card-list-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}

.album-card-list-tracks {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── ALBUM DETAIL (expanded) ─── */
.album-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.album-detail-header {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.album-detail-art {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.album-detail-info {
  flex: 1;
}

.album-detail-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.album-detail-artist {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-fire);
  margin-bottom: 8px;
}

.album-detail-stats {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.album-detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.album-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.album-detail-link {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent-electric);
  font-family: var(--font-mono);
  font-size: 10px;
  text-decoration: none;
  transition: all 0.2s;
}
.album-detail-link:hover {
  border-color: var(--accent-electric);
  background: rgba(77, 166, 255, 0.1);
}

/* ─── TRACK LIST ─── */
.track-list {
  margin-top: 16px;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s;
  cursor: pointer;
}
.track-row:hover {
  background: var(--bg-secondary);
}

.track-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.track-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.track-play-btn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.track-title {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-plays {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ─── SLIDESHOW VIEW ─── */
.lib-slideshow {
  max-width: 800px;
  margin: 0 auto;
}
.lib-slide-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.lib-slide-prev, .lib-slide-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.lib-slide-prev:hover, .lib-slide-next:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-fire-rgb, 240,133,45), 0.1);
}
.lib-slide-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.lib-slide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.lib-slide-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
}
.lib-slide-info {
  padding: 20px 24px;
}
.lib-slide-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.lib-slide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.lib-slide-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.lib-slide-play {
  padding: 8px 20px;
  background: var(--accent-fire);
  color: #000;
  border: none;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.lib-slide-play:hover {
  background: #ff9940;
  transform: translateY(-1px);
}
.lib-slide-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── DETAIL FEED VIEW ─── */
.lib-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.lib-detail-header {
  margin-bottom: 12px;
}
.lib-detail-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.lib-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.lib-detail-embed {
  margin-bottom: 12px;
}
.lib-detail-thumb {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}
.lib-detail-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.lib-detail-tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.lib-detail-track {
  padding: 3px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.lib-detail-track:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .album-detail-header { flex-direction: column; }
  .album-detail-art { width: 100%; height: auto; max-width: 300px; }
  .lib-controls { position: relative; }
  .lib-slide-img { max-height: 250px; }
  .lib-slide-info { padding: 14px 16px; }
}
