/* --- Player Section --- */
#audioPlayerSection {
  position: fixed;
  top: 50px; /* ajustement */
  left: 0;
  right: 0;
  background-color: #3a3a3a;
  padding: 10px 8px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#playerHeader {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 0 10px;
}

.current-track {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#playInfo {
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* --- Waveform & Spinner --- */
.waveform-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 80px;
  margin-bottom: 5px;
}

#waveform {
  min-width: 100%;
  transition: opacity 0.3s ease-in-out;
}

#waveform.loading {
  opacity: 0;
}

.spinner {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid white;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Controls --- */
#controlsContainer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px 0;
  gap: 10px;
}

#playerControls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#playerControls button {
  padding: 12px 16px;
  background-color: #444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.2s, background-color 0.2s;
}

#playerControls button:hover {
  background-color: #666;
  transform: scale(1.05);
}

#playerControls button i {
  margin: 0;
}

/* --- Playlist Table --- */
.table-container {
  overflow: visible;
  position: relative;
  z-index: 1;
}

#setsTable {
  width: 100%;
  border-collapse: collapse;
  background-color: transparent;
  color: #000;
  margin-top: 250px; /* plus de marge sous le lecteur */

}

th, td {
  border: 0;
  font-size: 14px;
  padding: 4px 6px;
  text-align: left;
}

th {
  background: lightgray;
  cursor: pointer;
}

.sort-icon {
  margin-left: 10px;
  font-size: 12px;
}

#setsTable tbody tr.mainRow {
  cursor: pointer;
}

#setsTable tbody tr.mainRow:hover {
  background-color: #d3d3d3;
}

.playing, .unfolded {
  background-color: #b8860b !important;
  border: 2px solid #b8860b;
  color: white !important;
}

#setsTable th.nameCol,
#setsTable td[data-label="Name"] {
  width: auto;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#setsTable td[data-label="Download"],
#setsTable th.download-header {
  width: 120px; /* plus large pour tenir le bouton */
  text-align: center;
}

/* --- Styled Download Button --- */
#setsTable td[data-label="Download"] a {
  display: inline-block;
  background-color: #444;
  color: white;
  padding: 6px 12px; /* plus d'espace */
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s;
  font-size: 14px;
  white-space: nowrap; /* empêche le retour à la ligne */
}

#setsTable td[data-label="Download"] a:hover {
  background-color: #666;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 6px;
  border: none;
  font-size: 16px;
  background: #ffffff;
  color: #000000;
}

.search-clear {
  flex-shrink: 0;
  padding: 12px 16px;
  border-radius: 6px;
  border: none;
  background: #444;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.search-clear:hover {
  background: #666;
}


