/* REPLACE FILE COMPLETELY */

/* Container */
.library-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.page-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-brand, #f0a5a5);
}
.results-info { opacity: 0.8; }

/* Search row */
.search-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.library-search-container {
  position: relative;
  flex: 1 1 auto;
  max-width: 640px;
}

.library-search-box {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border: 2px solid var(--border-secondary, #2b2f3a);
  border-radius: 20px;
  background: rgba(0,0,0,0.25);
  color: var(--text-primary, #e9edf3);
  outline: none;
}
.library-search-box::placeholder { opacity: 0.7; }
.library-search-box:focus {
  border-color: var(--accent, #32a6ff);
  box-shadow: 0 0 0 3px rgba(50,166,255,0.15);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.clear-search-btn {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 6px;
  height: 28px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-primary, #e9edf3);
  cursor: pointer;
  display: none;
}
.clear-search-btn.visible { display: inline-block; }

.library-search-type {
  min-width: 160px;
  padding: 10px 12px;
  border: 2px solid var(--border-secondary, #2b2f3a);
  background: var(--bg-elev-2, #171a22);
  color: var(--text-primary, #e9edf3);
  border-radius: 10px;
  outline: none;
}
.library-search-type:focus {
  border-color: var(--accent, #32a6ff);
  box-shadow: 0 0 0 3px rgba(50,166,255,0.15);
}

/* Quick filters */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.filter-pill {
  padding: 8px 14px;
  border: 1px solid var(--border-secondary, #2b2f3a);
  border-radius: 18px;
  background: transparent;
  color: var(--text-primary, #e9edf3);
  cursor: pointer;
}
.filter-pill:hover { border-color: var(--accent, #32a6ff); }
.filter-pill.active {
  background: rgba(50,166,255,0.12);
  border-color: var(--accent, #32a6ff);
}

/* Grid */
.songs-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  min-height: 160px;
}

/* Card */
.song-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-elev-2, #171a22);
  border: 1px solid var(--border-secondary, #2b2f3a);
  border-radius: 14px;
  padding: 12px;
}
.song-title { font-weight: 700; }
.song-meta { opacity: 0.8; font-size: 0.9rem; }

/* States */
.states { margin: 16px 0; }
.loading, .empty { display: none; text-align: left; }
#libraryLoading { display: block; }

.songs-container.empty + .states #libraryLoading { display: none; }
.songs-container.empty + .states #noResults { display: block; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 24px;
}
.pagination-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-secondary, #2b2f3a);
  background: transparent;
  color: var(--text-primary, #e9edf3);
  cursor: pointer;
}
/* === Card layout with art + actions (ADD) ================================= */
.song-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 14px;
  background: var(--bg-elev-2, #171a22);
  border: 1px solid var(--border-secondary, #2b2f3a);
  border-radius: 14px;
  padding: 14px;
}

.card-art {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.art-placeholder { opacity: 0.7; font-size: 24px; }

.card-info .song-title { font-weight: 800; font-size: 1.1rem; }
.card-info .song-meta { opacity: 0.85; margin-top: 4px; }

.card-actions { display: flex; gap: 8px; }
.card-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-secondary, #2b2f3a);
  background: transparent;
  color: var(--text-primary, #e9edf3);
  cursor: pointer;
}
/* === Compact card tweaks (override) ===================================== */
.song-card {
  grid-template-columns: 60px 1fr auto;  /* art smaller */
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
}

/* let the middle column actually shrink so text can ellipsize */
.card-info { min-width: 0; }

.card-art {
  width: 60px;
  height: 60px;
  border-radius: 8px;
}

/* tighter, smaller type */
.card-info .song-title {
  font-weight: 300;
  font-size: 0.75rem;         /* was ~1.1rem */
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-info .song-meta {
  opacity: 0.8;
  margin-top: 2px;
  font-size: 0.55rem;      /* was ~0.9rem */
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* smaller buttons */
.card-actions { gap: 6px; }
.card-btn {
  width: 12px;
  height: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.25rem;
}
/* ======================================================================= */

.card-btn.play { border-color: var(--accent, #32a6ff); }
.card-btn[disabled] { opacity: .5; cursor: not-allowed; }
/* ======================================================================== */

.pagination-btn:disabled { opacity: 0.4; cursor: default; }
.page-info { opacity: 0.8; }
