/* ===============================
   MP3-Player – seitenweite Leiste
   =============================== */
.tm-mp3-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.25);
}

.tm-mp3-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  min-height: 64px;
  background: linear-gradient(135deg, var(--header-bg-start, #2c3e50), var(--header-bg-end, #34495e));
  color: var(--text-light, #fff);
}

.tm-mp3-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-light, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tm-mp3-btn:hover {
  background: var(--primary, #3498db);
}

.tm-mp3-btn:active {
  transform: scale(0.92);
}

.tm-mp3-play {
  width: 44px;
  height: 44px;
  background: var(--primary, #3498db);
  font-size: 1.15rem;
}

.tm-mp3-play:hover {
  background: var(--primary-hover, #2980b9);
}

.tm-mp3-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tm-mp3-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-mp3-title .tm-mp3-artist {
  font-weight: 400;
  opacity: 0.75;
}

.tm-mp3-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-mp3-time {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  flex: 0 0 auto;
  width: 38px;
  text-align: center;
}

.tm-mp3-seek,
.tm-mp3-vol {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  outline: none;
  cursor: pointer;
}

.tm-mp3-seek {
  flex: 1 1 auto;
}

.tm-mp3-seek::-webkit-slider-thumb,
.tm-mp3-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary, #3498db);
  cursor: pointer;
}

.tm-mp3-seek::-moz-range-thumb,
.tm-mp3-vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--primary, #3498db);
  cursor: pointer;
}

.tm-mp3-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.tm-mp3-vol {
  width: 80px;
}

.tm-mp3-playlist {
  list-style: none;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--card-bg, #fff);
  color: var(--text-main, #333);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tm-mp3-playlist li {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tm-mp3-playlist li:hover {
  background: rgba(52, 152, 219, 0.12);
}

.tm-mp3-playlist li.is-active {
  background: rgba(52, 152, 219, 0.2);
  font-weight: 600;
}

.tm-mp3-playlist .tm-mp3-pl-artist {
  opacity: 0.65;
  flex: 0 0 auto;
}

.tm-mp3-empty {
  padding: 10px 16px;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Platz am Seitenende, damit der Player nichts verdeckt */
body.tm-mp3-active {
  padding-bottom: 72px;
}

/* Dark Mode */
body.dark-mode .tm-mp3-bar {
  background: linear-gradient(135deg, #1e1e2f, #14141f);
}

body.dark-mode .tm-mp3-playlist {
  background: #1e1e2f;
  color: #f5f5f5;
  border-top-color: #333;
}

body.dark-mode .tm-mp3-playlist li {
  border-bottom-color: #333;
}

body.dark-mode .tm-mp3-playlist li:hover,
body.dark-mode .tm-mp3-playlist li.is-active {
  background: rgba(130, 170, 255, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
  .tm-mp3-volume {
    display: none;
  }

  .tm-mp3-bar {
    gap: 8px;
    padding: 6px 10px;
  }

  .tm-mp3-time {
    width: 32px;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .tm-mp3-btn:not(.tm-mp3-play):not(.tm-mp3-list-toggle) {
    display: none;
  }
}
