/* ========== Variables CSS ========== */
:root {
  --mp3up-primary: #4a6fa5;
  --mp3up-secondary: #6e9cd2;
  --mp3up-dark: #2c3e50;
  --mp3up-light: #ecf0f1;
  --mp3up-success: #2ecc71;
  --mp3up-warning: #f39c12;
  --mp3up-danger: #e74c3c;
  --mp3up-white: #ffffff;
  --mp3up-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ========== Base du lecteur ========== */
.mp3up-player {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: var(--mp3up-white);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  overflow: hidden;
}

/* ========== Skins ========== */
.mp3up-skin-dark {
  background: linear-gradient(135deg, #2c3e50, #34495e);
}

.mp3up-skin-light {
  background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
  color: var(--mp3up-dark);
}

.mp3up-skin-minimal {
  background: var(--mp3up-white);
  color: var(--mp3up-dark);
  border: 1px solid #ddd;
  box-shadow: var(--mp3up-shadow);
}

/* ========== Section Now Playing ========== */
.mp3up-nowplaying {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mp3up-cover {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp3up-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp3up-meta {
  flex: 1;
  min-width: 0;
}

.mp3up-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp3up-artist {
  font-size: 1rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== Élément Audio ========== */
.mp3up-audio {
  width: 100%;
  margin-bottom: 20px;
  border-radius: 8px;
  outline: none;
}

/* Masquer les contrôles par défaut si on veut des contrôles custom */
.mp3up-audio::-webkit-media-controls-panel {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ========== Playlist ========== */
.mp3up-playlist {
  margin-top: 20px;
  max-height: 250px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 15px;
}

.mp3up-playlist ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mp3up-playlist li {
  margin-bottom: 2px;
}

.mp3up-playlist li.is-active {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.mp3up-track {
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

.mp3up-track:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mp3up-track:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.mp3up-track-title {
  font-weight: 500;
  margin-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.mp3up-track-artist {
  opacity: 0.8;
  font-style: italic;
  margin-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp3up-track-duration {
  opacity: 0.7;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ========== Scrollbar personnalisée ========== */
.mp3up-playlist::-webkit-scrollbar {
  width: 6px;
}

.mp3up-playlist::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.mp3up-playlist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.mp3up-playlist::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ========== États vides ========== */
.mp3up-player p {
  text-align: center;
  margin: 0;
  padding: 20px;
  opacity: 0.8;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .mp3up-player {
    margin: 10px;
    padding: 20px;
    border-radius: 10px;
  }

  .mp3up-nowplaying {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .mp3up-cover {
    width: 120px;
    height: 120px;
    margin: 0 auto;
  }

  .mp3up-meta {
    text-align: center;
  }

  .mp3up-title {
    font-size: 1.2rem;
    white-space: normal;
    line-height: 1.3;
  }

  .mp3up-artist {
    font-size: 0.95rem;
    white-space: normal;
  }

  .mp3up-track {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 5px;
  }

  .mp3up-track-title,
  .mp3up-track-artist {
    white-space: normal;
    margin-right: 0;
  }

  .mp3up-track-duration {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .mp3up-player {
    margin: 5px;
    padding: 15px;
  }

  .mp3up-cover {
    width: 100px;
    height: 100px;
  }

  .mp3up-title {
    font-size: 1.1rem;
  }

  .mp3up-artist {
    font-size: 0.9rem;
  }

  .mp3up-playlist {
    max-height: 200px;
  }
}

/* ========== Animations ========== */
@keyframes mp3up-fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mp3up-player {
  animation: mp3up-fadeIn 0.5s ease-out;
}

.mp3up-track {
  animation: mp3up-fadeIn 0.3s ease-out;
}

/* ========== Accessibilité ========== */
.mp3up-track:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .mp3up-player,
  .mp3up-track {
    animation: none;
  }

  .mp3up-track {
    transition: none;
  }
}

/* ========== Personnalisation thème sombre ========== */
.mp3up-skin-dark .mp3up-nowplaying {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.mp3up-skin-dark .mp3up-playlist {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* ========== Personnalisation thème clair ========== */
.mp3up-skin-light .mp3up-nowplaying {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.mp3up-skin-light .mp3up-playlist {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.mp3up-skin-light .mp3up-track:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mp3up-skin-light .mp3up-playlist li.is-active {
  background: rgba(0, 0, 0, 0.1);
}

/* ========== Personnalisation thème minimal ========== */
.mp3up-skin-minimal .mp3up-nowplaying {
  border-bottom-color: #e0e0e0;
}

.mp3up-skin-minimal .mp3up-playlist {
  border-top-color: #e0e0e0;
}

.mp3up-skin-minimal .mp3up-track:hover {
  background: #f5f5f5;
}

.mp3up-skin-minimal .mp3up-playlist li.is-active {
  background: #e3f2fd;
}
