/* ==========================================================================
   MP3 Library — themed to match sotonccf.co.uk (style.css)
   Scoped under .mp3-app / #player / #toast so it sits safely alongside
   the site's main stylesheet without needing !important anywhere.
   ========================================================================== */

.mp3-app {
  --mp3-border: #e5e5e5;
  --mp3-muted: #a59e95;
  --mp3-text: #544531;
  --mp3-accent: #8f7655;
  --mp3-panel: #faf7f3;
  --mp3-panel-2: #f3ece2;
  --mp3-gold-top: #e2caae;
  --mp3-gold-bottom: #c39f70;
  --mp3-gold-border: #a68861;
  --mp3-gold-text: #715b3e;
  --mp3-sec-top: #e3dfda;
  --mp3-sec-bottom: #d0cbc4;
  --mp3-sec-border: #b1aea8;
  --mp3-sec-text: #7c7975;
  --mp3-heading-font: "Novecento Sans", "Raleway", "Noto Sans", "Open Sans", sans-serif;
  margin-bottom: 20px;
}

/* Reserve room at the bottom of the page for the fixed player bar */
body { padding-bottom: 100px; }

.mp3-app-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.mp3-app-toolbar #search {
  flex: 1 1 240px;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 1em;
  color: var(--mp3-text);
  background: #fff;
  margin: 0;
}
.mp3-app-toolbar #search:focus {
  outline: none;
  border-color: var(--mp3-accent);
}
.mp3-app-toolbar #refreshBtn {
  background: var(--mp3-sec-top);
  background: linear-gradient(var(--mp3-sec-top), var(--mp3-sec-bottom));
  border: none;
  border-bottom: 1px solid var(--mp3-sec-border);
  color: var(--mp3-sec-text);
  padding: 10px 18px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--mp3-heading-font);
  text-transform: uppercase;
  font-weight: 400;
  font-size: 0.85em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}
.mp3-app-toolbar #refreshBtn:hover { opacity: .85; }
.mp3-app-toolbar #refreshBtn i { margin-right: 6px; }

.mp3-app-status {
  font-size: 0.85em;
  color: var(--mp3-muted);
  margin-bottom: 16px;
}

.mp3-app-progress {
  display: none;
  height: 4px;
  background: var(--mp3-panel-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.mp3-app-progress #progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mp3-gold-top), var(--mp3-gold-bottom));
  transition: width .2s ease;
}

.mp3-app-table { width: 100%; }
.mp3-app-table thead th {
  text-align: left;
  font-family: var(--mp3-heading-font);
  text-transform: uppercase;
  font-size: 0.75em;
  font-weight: 500;
  color: var(--mp3-text);
  padding: 8px 10px;
  border-bottom: 2px solid var(--mp3-border);
}
.mp3-app-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--mp3-border);
}
.mp3-app-table tbody tr:hover { background: var(--mp3-panel); }
.mp3-app-table tbody tr.playing { background: var(--mp3-panel-2); }
.mp3-app-table tbody td {
  padding: 10px;
  font-size: 0.95em;
  vertical-align: middle;
  color: #6b6259;
}
.mp3-app-table td.title { font-weight: 600; color: var(--mp3-text); }
.mp3-app-table td.size,
.mp3-app-table td.duration {
  color: var(--mp3-muted);
  white-space: nowrap;
  width: 1%;
  font-variant-numeric: tabular-nums;
}
.mp3-app-table .icon-cell { width: 46px; text-align: center; }
.mp3-app-table td.filename {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp3-app-table td.filename a.dl-link {
  color: var(--mp3-muted);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}
.mp3-app-table td.size a.dl-link {
  color: var(--mp3-muted);
  text-decoration: none;
}
.mp3-app-table td.filename a.dl-link:hover,
.mp3-app-table td.size a.dl-link:hover { color: var(--mp3-accent); text-decoration: underline; }

.mp3-app .row-play-icon { color: var(--mp3-muted); font-size: 1.05em; }
.mp3-app tr.playing .row-play-icon { color: var(--mp3-accent); }

.mp3-app a.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--mp3-gold-top);
  background: linear-gradient(var(--mp3-gold-top), var(--mp3-gold-bottom));
  border-bottom: 1px solid var(--mp3-gold-border);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
  color: var(--mp3-gold-text);
  text-decoration: none;
  font-size: 0.85em;
  transition: transform .15s ease, opacity .15s ease;
}
.mp3-app a.dl-btn:hover { opacity: .85; transform: scale(1.08); }
.mp3-app a.dl-btn:active { transform: scale(0.95); }

.mp3-app-empty {
  display: none;
  text-align: center;
  color: var(--mp3-muted);
  padding: 50px 20px;
  font-size: 0.95em;
}

.mp3-app-pagination {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}
.mp3-app-pagination button {
  background: var(--mp3-sec-top);
  background: linear-gradient(var(--mp3-sec-top), var(--mp3-sec-bottom));
  border: none;
  border-bottom: 1px solid var(--mp3-sec-border);
  color: var(--mp3-sec-text);
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--mp3-heading-font);
  text-transform: uppercase;
  font-weight: 400;
  font-size: 0.8em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
.mp3-app-pagination button:disabled { opacity: .4; cursor: default; box-shadow: none; }
.mp3-app-pagination button:hover:not(:disabled) { opacity: .85; }
.mp3-app-pagination #pageInfo {
  font-size: 0.8em;
  color: var(--mp3-muted);
  font-family: var(--mp3-heading-font);
  text-transform: uppercase;
}

#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #faf7f3;
  border: 1px solid #e5e5e5;
  color: #544531;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.85em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 10px 20px 14px;
  display: none;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  z-index: 998;
}
#player.active { display: block; }
#playerInner {
  max-width: 1170px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
#playerMeta { min-width: 160px; max-width: 280px; overflow: hidden; }
#playerTitle {
  font-size: 0.95em;
  font-weight: 600;
  color: #544531;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
#playerArtist {
  font-size: 0.8em;
  color: #a59e95;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #a59e95;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-size: 1em;
}
.ctrl-btn:hover { color: #8f7655; }
#playBtn {
  background: linear-gradient(#e2caae, #c39f70);
  border: none;
  border-bottom: 1px solid #a68861;
  color: #715b3e;
  border-radius: 50%;
  width: 40px; height: 40px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
#playBtn:hover { opacity: .85; color: #715b3e; }

#seekRow { flex: 1; display: flex; align-items: center; gap: 8px; }
#curTime, #durTime {
  font-size: 0.75em;
  color: #a59e95;
  width: 54px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#seek {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #e5e5e5;
  outline: none;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #8f7655;
  cursor: pointer;
}
#volume {
  width: 80px;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #e5e5e5;
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #c39f70;
  cursor: pointer;
}

@media (max-width: 640px) {
  #playerMeta { display: none; }
  #volume { display: none; }
  .mp3-app-table th.col-filename, .mp3-app-table td.filename { display: none; }
}
