/* Songsaver – Plattenladen trifft Spotify: dunkle Bühne, warmes Vinyl-Gelb, Preisaufkleber. */

/* Songsaver – dunkel, grün, Spotify-nah. */

:root {
  --bg: #121212;
  --surface: #181818;
  --surface-2: #242424;
  --text: #ffffff;
  --muted: #b3b3b3;
  --border: #2e2e2e;
  --accent: #1ed760;
  --accent-hover: #3be477;
  --accent-text: #000000;
  --accent-soft: rgba(255, 255, 255, .07);
  --good: #1ed760;
  --good-soft: rgba(30, 215, 96, .15);
  --warn: #f0c060;
  --warn-soft: rgba(240, 192, 96, .15);
  --bad: #ff8a80;
  --bad-soft: rgba(255, 138, 128, .14);
  --radius: 10px;
  --display: "Circular Std", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #1c4a32 0, #121212 420px) no-repeat, var(--bg);
  color: var(--text);
  font: 15px/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

a { color: var(--text); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 980px; margin: 0 auto; padding-inline: 16px; }

/* ---------- Header ---------- */
.site-header { padding-block: 40px 20px; }
.hero { display: flex; align-items: center; gap: 22px; }
.site-header h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}
.tagline { margin: 8px 0 0; color: var(--muted); max-width: 34rem; }

.logo { flex: none; width: clamp(64px, 12vw, 92px); height: auto; filter: drop-shadow(0 8px 20px rgba(0,0,0,.45)); }
.logo-bg { fill: var(--accent); }
.logo-arrow { fill: none; stroke: #000; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }

main { display: grid; gap: 18px; padding-bottom: 24px; }
main > * { min-width: 0; } /* sonst drückt die breite Tabelle die Karte auf */

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
}
.card h2 { margin: 0 0 10px; font-family: var(--display); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hint { color: var(--muted); margin: 0 0 12px; }

/* ---------- Upload ---------- */
.dropzone {
  display: block;
  border: 1px dashed #6a6a6a;
  border-radius: var(--radius);
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  background: transparent;
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--text); background: var(--surface-2); }
.dropzone.dragover { transform: scale(1.01); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone-text strong { color: var(--text); }

.steps { margin: 0 0 18px; padding-left: 1.4em; display: grid; gap: 8px; }
.steps li::marker { color: var(--accent); font-weight: 700; }
.dropzone-text .sub { margin-top: 2px; }

/* ---------- Formularelemente ---------- */
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; }
.field { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
select, button, input { font: inherit; }
input[type=number] { width: 7rem; }
.sub-price { margin: 12px 0 0; }
#cache-info, #plays-info { margin: 0 0 9px; }
.cache-row { align-items: end; }
select, input[type=number], .picker-tools input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
select:hover, input[type=number]:hover, .picker-tools input:hover { border-color: var(--text); }
input[type=checkbox] { accent-color: var(--accent); }

button.primary {
  padding: 12px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .12s, background .12s;
}
button.primary:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.04); }
button.primary:disabled { opacity: .5; cursor: progress; }
button.primary.secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px #7c7c7c; }

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--text); }

.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 4px solid var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
  white-space: pre-line;
}

.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: .9rem; cursor: pointer; }
.estimate { margin: 0; font-weight: 600; }

/* ---------- Playlist-Auswahl ---------- */
.picker { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.picker h3 { margin: 0; font-size: 1rem; }
.picker-tools { margin-top: 8px; align-items: center; }
.picker-tools input { flex: 1 1 200px; }
.picker-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.picker-list li { border-bottom: 1px solid var(--border); }
.picker-list li:last-child { border-bottom: 0; }
.picker-list label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; }
.picker-list label:hover { background: var(--accent-soft); }
.picker-list .count { margin-left: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.picker-count { margin: 0; }

/* ---------- Fortschritt: Tonarm läuft über die Rille ---------- */
.progress { margin-top: 18px; }
.progress-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: visible; position: relative; }
.progress-fill { height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .3s; position: relative; }
.progress-fill::after { content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; }
.progress-text { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- Kennzahlen ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px; border-radius: 8px; background: var(--surface-2); }
.stat-label { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.highlight { background: var(--good-soft); border-color: transparent; }
.stat.highlight .stat-value { color: var(--good); }

/* ---------- Preisaufkleber + Kaufen ---------- */
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .12s, background .12s;
}
.buy:hover { background: var(--accent-hover); color: var(--accent-text); transform: scale(1.06); }

.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--surface-2); color: var(--text); }

/* ---------- Titeltabelle (wie eine Trackliste) ---------- */
.table-scroll { overflow-x: auto; }
table.tracks { width: 100%; border-collapse: collapse; min-width: 720px; }
.tracks th, .tracks td { padding: 10px 8px; border-bottom: 1px solid transparent; text-align: left; vertical-align: top; }
.tracks thead th { border-bottom-color: var(--border); }
.tracks th { font-size: .72rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; }
.tracks tbody tr:hover td { background: var(--accent-soft); }
.tracks td:first-child { border-radius: 6px 0 0 6px; }
.tracks td:last-child { border-radius: 0 6px 6px 0; }
.tracks .col-num { text-align: right; white-space: nowrap; }
.tracks .col-owned { width: 60px; text-align: center; }
.tracks td.col-owned input { width: 18px; height: 18px; }
.tracks tr.owned td:not(.col-owned) { opacity: .4; }
.tracks .col-buy { min-width: 170px; }
.tracks td.col-buy .buy { margin-left: 10px; }
.sub { display: block; color: var(--muted); font-size: .85rem; }
.shop-links { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .85rem; }
.list-hint { margin-top: 16px; }

tr.group th {
  text-align: left;
  background: var(--surface-2);
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 10px;
}
tr.group .count { color: var(--muted); font-weight: 400; }

/* ---------- Alben: Plattencover ---------- */
.albums { margin-top: 22px; }
.albums h3, .table-title { margin: 0 0 4px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.table-title { margin-top: 26px; }
.album-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.album {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  transition: background .15s;
}
.album:hover { background: #2e2e2e; }
.album img {
  width: 64px; height: 64px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--border);
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
}
.album > * { min-width: 0; }
.album-title { font-weight: 700; overflow-wrap: anywhere; }
.album-meta { color: var(--muted); font-size: .85rem; }
.album-side { display: grid; gap: 6px; justify-items: end; }
.album-owned { margin-top: 4px; font-size: .85rem; }
.album.owned > :not(.album-side) { opacity: .45; }
.album-shops { display: grid; gap: 2px; margin-top: 6px; }
.shop-group { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: .85rem; }
.shop-group-label { color: var(--muted); }

@media (max-width: 560px) {
  .hero { gap: 14px; }
  .card { padding: 16px; }
  .album { grid-template-columns: 48px 1fr; }
  .album img { width: 48px; height: 48px; }
  .album-side { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px 12px; }
}

.site-footer { color: var(--muted); font-size: .8rem; padding-block: 12px 36px; }

.history-info { margin: 12px 0 0; color: var(--accent); }
.history-info:empty { display: none; }

.qobuz-cart { margin: 16px 0; padding: 16px; border-radius: 8px; background: var(--surface-2); }
.qobuz-cart h3 { margin-top: 0; }
.qobuz-cart ol { padding-left: 20px; }
.bookmarklet { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--good-soft); color: var(--good); font-weight: 700; cursor: grab; }
.qobuz-cart .steps { padding-left: 20px; line-height: 1.5; }
.qobuz-cart .steps li { margin-bottom: 8px; }

.library { margin: 12px 0; padding: 12px 16px; border-radius: 8px; background: var(--surface-2); }
.library summary { cursor: pointer; font-weight: 700; }
.library .nextcloud-row { align-items: flex-end; flex-wrap: wrap; }
.library .nextcloud-row input { min-width: 200px; }
