/* style.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding-bottom: 150px; /* Espace pour le lecteur fixe */
    background-color: #e9ebee;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #56a8ff; /* Vert plus vif */
    color: white;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header h1 {
    margin-top: 0;
    font-size: 2.5em;
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 30px auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 40px 0;
}

h2 {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-top: 30px;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

#search-input {
    width: 60%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

#search-button {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
}

#search-button:hover {
    background-color: #0056b3;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-limit select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

.playlist-controls button {
    padding: 10px 18px;
    background-color: #6c757d; /* Gris pour les contrôles de playlist */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.95em;
}

.playlist-controls button:hover {
    background-color: #5a6268;
}

.table-container {
    overflow-x: auto; /* Permet le défilement horizontal si le tableau est trop large */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.95em;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    cursor: pointer; /* Indique que le tri est possible */
    position: relative;
}

th i {
    margin-left: 5px;
    color: #888;
}

th.sorted-asc i.fa-sort-up { color: #007bff; }
th.sorted-desc i.fa-sort-down { color: #007bff; }

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

.playing-row {
    background-color: #ace4ff !important /* Vert pâle */
    font-weight: bold;
}

td button, button,input[type=file]::file-selector-button  {
    padding: 8px 15px;
    background-color: #56a8ff; /* Vert pour les boutons d'action */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}


td button:hover {
    background-color: #3772a7;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.pagination-controls button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Lecteur audio fixe / déplaçable */
#audio-player-container {
    position: fixed; /* Toujours fixed */
    transition: all 0.3s ease-in-out; /* Pour une transition douce lors du changement de position */
 
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2c3e50; /* Bleu foncé */
    color: white;
    padding: 15px 20px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    cursor: grab; /* Curseur pour indiquer que c'est déplaçable */
    border-top: 5px solid #56a8ff;
	flex-direction: row;
  justify-content: center;
  align-items: center;
}

#audio-player-container.left-fixed {
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px; /* Largeur réduite */
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px 10px;
    border-top: none;
    border-right: 5px solid #56a8ff;
}

#audio-player-container.right-fixed {
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px; /* Largeur réduite */
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 20px 10px;
    border-top: none;
    border-left: 5px solid #56a8ff;
    left: unset; /* Annuler left:0 */
}

#audio-player-container.top-fixed {
    top: 0;
    left: 0;
    right: 0;
    bottom: unset; /* Annuler bottom:0 */
    width: 100%;
    height: auto;
    flex-direction: row; /* Revenir à l'horizontale */
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 5px solid #56a8ff;
    border-top: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
	max-width: none;
}

/* Ajustements pour les modes fixe vertical */
#audio-player-container.left-fixed .player-info,
#audio-player-container.right-fixed .player-info {
    writing-mode: vertical-rl; /* Texte vertical */
    text-orientation: mixed;
    white-space: nowrap;
    margin: 20px 0;
    font-size: 0.9em;
}

#audio-player-container.left-fixed .player-controls,
#audio-player-container.right-fixed .player-controls {
    flex-direction: column; /* Contrôles verticaux */
    gap: 10px;
    width: auto;
}

#audio-player-container.left-fixed #audio-visualizer,
#audio-player-container.right-fixed #audio-visualizer {
    width: 50px;
    height: 50px;
    transform: rotate(90deg); /* Rotation pour le visualiseur */
}



.player-handle {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.2em;
  cursor: grab;
  color: #888;
  z-index: 1001;
}


#audio-player-container.left-fixed #current-time, #audio-player-container.left-fixed #duration, #audio-player-container.right-fixed #current-time, #audio-player-container.right-fixed #duration {
  display: contents;
}
#audio-player-container.left-fixed .player-controls,#audio-player-container.right-fixed .player-controls {
  font-size: 8px;
}


#audio-player-container.left-fixed .player-handle,
#audio-player-container.right-fixed .player-handle {
    top: 5px;
    right: unset;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
}

#audio-player-container.top-fixed .player-handle {
  bottom: 5px;
  top: 15px;
  left: 15px;
}


.player-info {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 900px;
    justify-content: center;
}

#play-pause-button {
    font-size: 1.8em;
    padding: 8px 15px;
    background-color: #56a8ff;border: 0;
  border-radius: 50px;
}

#play-pause-button i {
    margin: 0; /* Pas d'espace pour l'icône */
}

#progress-bar {
    flex-grow: 1;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: #555;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
	width: 70%;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #56a8ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

#progress-bar::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #56a8ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

#volume-control {
   width: 70%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #555;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

#volume-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #56a8ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

#volume-control::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #56a8ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

#volume-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
}

#audio-visualizer {
  width: 20%;
    height: 60px;
    background-color: #333;
    border-radius: 5px;
    margin-top: 10px;
}


#audio-visualizer.top-fixed   #audio-visualizer, #audio-visualizer.bottom-fixed   #audio-visualizer {
  width: 20%;
}
/* Modale de notation */
.modal {
    display: none; /* Caché par défaut */
    position: fixed; /* Reste en place */
    z-index: 2000; /* Par-dessus tout */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Active le défilement si nécessaire */
    background-color: rgba(0,0,0,0.6); /* Fond semi-transparent */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.stars-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.stars-container img.star {
    width: 30px;
    height: 30px;
    margin: 0 3px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.stars-container img.star:hover {
    transform: scale(1.2);
}

#submit-rating-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
}

#rating-message {
    margin-top: 15px;
    font-weight: bold;
    color: #d9534f; /* Rouge pour les messages d'erreur/avertissement */
}

/* Médias Queries pour le responsive design du lecteur */
@media (max-width: 768px) {
    #audio-player-container {
        flex-direction: column;
        padding: 10px;
    }
#audio-visualizer{display:none;}
    .player-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    #progress-bar {
       width: 70%;
    }

   
    #audio-player-container.top-fixed {
        /* Simplifier les transitions pour les petits écrans */
        position: fixed;
        width: 100%;
        height: auto;
        top: unset;
        left: unset;
        right: unset;
        bottom: 0;
        flex-direction: column;
        border: none;
        border-top: 5px solid #56a8ff;
    }
}


/* Modifiez ces règles pour utiliser transform */
#audio-player-container .bottom-fixed {
  bottom: 0;
  left: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 10px 10px 0 0;
}

.top-fixed {
    top: 0;
    left: 50%;
    transform: translateX(-50%); /* Centrer horizontalement */
    width: 90%;
    max-width: 800px;
    height: auto;
    border-radius: 0 0 10px 10px; /* Coins arrondis en bas */
}

.left-fixed {
    top: 50%;
    left: 0;
    transform: translateY(-50%); /* Centrer verticalement */
    width: auto; /* Laisser le contenu définir la largeur */
    height: 90%;
    border-radius: 0 10px 10px 0; /* Coins arrondis à droite */
    display: flex; /* Pour organiser le contenu verticalement */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Ajustez le padding si nécessaire */
}

.right-fixed {
    top: 50%;
    right: 0;
    transform: translateY(-50%); /* Centrer verticalement */
    width: auto;
    height: 90%;
    border-radius: 10px 0 0 10px; /* Coins arrondis à gauche */
    display: flex; /* Pour organiser le contenu verticalement */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px; /* Ajustez le padding si nécessaire */
}


.fa-solid, .fas {
  color: #fff;
}

#prev-song-button, #next-song-button {
  background: #000;
  border: 0;
  border-radius: 20px;
  padding: 10px;
  width: 35px;
}
/* Styles spécifiques pour le mode flottant (quand on drag) */
.floating-player {
    position: fixed; /* Reste fixe pour le drag */
    /* Pas de transform: translate ici, les positions sont absolues */
    /* La transition est désactivée pendant le drag */
    transition: none !important;}
	
	
	#songFormDiv label { display: block; margin-bottom: 5px; font-weight: bold; }
        #songFormDiv input[type="text"], input[type="email"], input[type="file"],input[type="tel"] {
            width: calc(100% - 22px);
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
      
        #songFormDiv button:hover { background-color: #45a049; }
        .message { margin-top: 20px; padding: 10px; border-radius: 4px; }
        .message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
        .message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
   