/* ============================================================
   Songs page — CheerSounds new site
   ============================================================ */

/* ---------- Hero ---------- */
.songs-hero {
  padding: calc(var(--header-offset, 66px) + 48px) 0 32px;
  text-align: center;
}
.songs-hero h1 {
  margin: 8px 0 12px;
  font-family: "Oxanium", "Segoe UI", sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

/* ---------- Toolbar ---------- */
.songs-toolbar-section {
  padding: 8px 0;
  position: sticky;
  top: var(--header-offset, 66px);
  z-index: 90;
  background: transparent;
}
.songs-toolbar-section.is-stuck {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.songs-toolbar-section {
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.songs-toolbar-section.is-released {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}
.songs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Search */
.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--muted); opacity: 0.7; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-dropdown { position: relative; }
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-btn svg { width: 10px; height: 10px; transition: transform 0.2s; }
.filter-dropdown.open .filter-btn svg { transform: rotate(180deg); }
.filter-dropdown.open .filter-btn { border-color: var(--accent); background: var(--accent-soft); }

.filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 0;
  box-shadow: var(--shadow-md);
  z-index: 100;
}
.filter-dropdown.open .filter-menu { display: block; }
.filter-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.filter-menu label:hover { background: var(--accent-soft); }
.filter-menu input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Rating badges */
.rating-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rating-g { background: #2e7d32; color: #fff; }
.rating-pg { background: #f9a825; color: #1a1b1f; }
.rating-pg13 { background: #e65100; color: #fff; }

/* Clear all */
.clear-filters-btn {
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.clear-filters-btn:hover { background: var(--accent-soft); }

/* Active filter pills */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}
.active-filters:empty { margin-top: 0; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}
.filter-pill button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

/* ---------- Table controls ---------- */
.songs-table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.results-info {
  color: var(--muted);
  font-size: 0.86rem;
}
.page-size-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}
.page-size-select select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
}

/* ---------- Table ---------- */
.songs-table-wrap {
  position: relative;
  min-height: 300px;
  overflow-x: auto;
}
.songs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.songs-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}
.songs-table thead th.sortable { cursor: pointer; }
.songs-table thead th.sortable:hover { color: var(--accent); }
.songs-table thead th.sort-asc::after { content: " ▲"; font-size: 0.6rem; }
.songs-table thead th.sort-desc::after { content: " ▼"; font-size: 0.6rem; }

.songs-table tbody tr {
  border-bottom: 1px solid rgba(58, 62, 71, 0.45);
  transition: background 0.15s;
}
.songs-table tbody tr:hover { background: var(--accent-soft); }
.songs-table tbody td {
  padding: 10px 12px;
  font-size: 0.9rem;
  vertical-align: middle;
}

/* Column widths */
.col-play { width: 42px; text-align: center; }
.col-title { min-width: 180px; }
.col-artist { min-width: 140px; }
.col-section { min-width: 110px; }
.col-genre { min-width: 90px; }
.col-attitude { min-width: 100px; }
.col-rating { width: 60px; text-align: center; }
.col-lyrics { width: 50px; text-align: center; }
.col-fav { width: 44px; text-align: center; }

/* Play button in row */
.row-play {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.row-play:hover { transform: scale(1.12); }
.row-play svg { width: 14px; height: 14px; }
.row-play.playing { background: var(--accent-strong); }

/* Favorite heart */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.15rem;
  transition: color 0.2s, transform 0.2s;
  padding: 0;
}
.fav-btn:hover { color: var(--accent); transform: scale(1.2); }
.fav-btn.active { color: var(--accent); }

/* Lyrics button */
.lyrics-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.2s;
  padding: 0;
}
.lyrics-btn:hover { color: var(--accent); }

/* Rating in table */
.song-rating {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Loading overlay */
.songs-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(26, 27, 31, 0.85);
  z-index: 10;
  border-radius: var(--radius-md);
}
.songs-loading.hidden { display: none; }
.songs-loading p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.loader-ring {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pagination ---------- */
.songs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 20px 0 40px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0 10px;
}
.page-btn:hover { border-color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-ellipsis {
  min-width: 30px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- Lyrics modal ---------- */
.lyrics-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lyrics-overlay.open { display: flex; }
.lyrics-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.lyrics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--line);
}
.lyrics-header h3 {
  margin: 0;
  font-family: "Oxanium", "Segoe UI", sans-serif;
  font-size: 1.2rem;
}
.lyrics-header p { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.lyrics-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}
.lyrics-close:hover { color: var(--accent); }
.lyrics-body {
  padding: 16px 24px 24px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

/* ---------- Audio bar ---------- */
.audio-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}
.audio-bar.visible { transform: translateY(0); }
.audio-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.ab-play {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ab-play svg { width: 16px; height: 16px; }
.ab-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-shrink: 0;
  max-width: 220px;
}
.ab-title {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-artist {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-progress-wrap {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.ab-progress {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0;
  transition: width 0.1s linear;
}
.ab-time {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
  .songs-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .audio-bar-inner { gap: 8px; }
  .ab-info { max-width: 120px; }
}

/* Adjust body padding when audio bar is visible */
body.has-audio-bar { padding-bottom: 60px; }
body.has-audio-bar .site-footer { margin-bottom: 56px; }
