/* 🌙 Theme Variablen */
:root {
  --bg: #111;
  --text: #eee;
  --accent: #0a9;
  --secondary: #444;
  --border: #333;
}

body.light {
  --bg: #f5f5f5;
  --text: #111;
  --accent: #0a9;
  --secondary: #ddd;
  --border: #ccc;
}

body.black {
  --bg: #000;
  --text: #fff;
  --accent: #0f0;
  --secondary: #222;
  --border: #1a1a1a;
}

/* 🧩 Grundlayout */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background 0.3s, color 0.3s;
  line-height: 1.5;
}

.playerContainer {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 🎯 Projekt-Tabs */
.projectTabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

.projectTab {
  background: none;
  border: none;
  color: var(--text);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  opacity: 0.6;
}

.projectTab:hover {
  opacity: 1;
}

.projectTab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  opacity: 1;
}

/* 📀 Header */
.playerHeader {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--secondary);
  padding: 1.5rem;
  border-radius: 12px;
}

.coverWrapper {
  flex: 0 0 120px;
}

.coverWrapper img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.trackInfo {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trackInfo h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
}

.projectLabel {
  margin: 0.5rem 0 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* 🎶 Playlist */
.playlistSection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.playlistSection h3 {
  margin: 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* Kein gap - border-bottom reicht als Trenner */
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--secondary);
  overflow: hidden;
}

.trackItem {
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}

/* Kompakt-Modus */
.playlist.compact .trackItem {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.playlist.compact .trackRating {
  font-size: 0.75rem;
}

.trackItem:last-child {
  border-bottom: none;
}

.trackItem:hover {
  background: rgba(0,170,153,0.1);
}

.trackItem.active {
  background: var(--accent);
  color: #000;
  font-weight: bold;
}

.trackName {
  flex: 1;
}

.trackRating {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Kompakt-Button */
.compactBtn {
  background: var(--secondary);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.compactBtn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.compactBtn.active {
  background: var(--accent);
  color: #000;
}

/* 🎛️ Steuerung */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--secondary);
  padding: 1.5rem;
  border-radius: 12px;
}

button {
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.2s;
}

button:hover {
  transform: scale(1.1);
  color: var(--accent);
}

#prevBtn, #playPauseBtn, #nextBtn {
  font-size: 2rem;
}

#playPauseBtn {
  width: 60px;
  height: 60px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

#playPauseBtn:hover {
  transform: scale(1.15);
}

.formatToggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.formatBtn {
  background: var(--secondary); /* ← Theme-Variable statt fest */
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1rem;
  border: 1px solid var(--border); /* ← Theme-Border */
  transition: all 0.2s;
}

.formatBtn:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Aktiver Zustand (wenn WAV ausgewählt) */
.formatBtn.active-format {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* 📊 Fortschritt */
.progressWrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#progressSlider {
  width: 100%;
  height: 6px;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  cursor: pointer;
}

#progressSlider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

#progressSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

#timeDisplay {
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.7;
}

/* 🔊 Lautstärke */
.volumeWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--secondary);
  padding: 1rem;
  border-radius: 8px;
}

#volumeSlider {
  width: 120px;
  height: 4px;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
}

#volumeDisplay {
  font-size: 0.85rem;
  min-width: 45px;
  text-align: right;
}

.autoNextLabel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.8;
}

.autoNextLabel input {
  cursor: pointer;
  transform: scale(1.3);
}

/* 👍 Bewertung */
.ratingSection {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  background: var(--secondary);
  padding: 1.5rem;
  border-radius: 12px;
  flex-wrap: wrap;
}

.ratingSection p {
  margin: 0;
  font-size: 0.95rem;
}

.rateBtn {
  font-size: 2rem;
  padding: 0.5rem;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  transition: all 0.2s;
}

.rateBtn:hover {
  transform: scale(1.2);
  background: var(--accent);
}

.ratingDisplay {
  font-weight: bold;
  min-width: 120px;
  text-align: center;
  background: var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

/* 🦶 Footer */
.footer {
  text-align: center;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  opacity: 0.7;
}

.footer p {
  margin: 0.25rem 0;
}

.adminLink {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--secondary);
  display: inline-block;
  transition: all 0.2s;
}

.adminLink:hover {
  background: var(--accent);
  color: #000;
}

.footerLink {
  color: var(--accent); /* ← Nutzt jetzt Theme-Variable statt festes #0a9 */
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--secondary); /* ← Passt sich Theme an */
  display: inline-block;
  transition: all 0.2s;
}

.footerLink:hover {
  background: var(--accent); /* ← Theme-Farbe statt fest */
  color: #000;
}

/* 📱 Responsive */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .playerHeader {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .trackInfo h1 {
    font-size: 1.4rem;
  }

  .controls {
    gap: 0.5rem;
  }

  .volumeWrapper {
    gap: 0.5rem;
  }

  .formatToggle {
    order: -1;
    width: 100%;
  }
}