/* Styles généraux */
.mlm-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mlm-container h2 {
    margin-bottom: 10px;
    color: #333;
}

/* Styles des contrôles de recherche */
.mlm-controls {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mlm-search-row, .mlm-date-row {
    margin-bottom: 15px;
}

.mlm-search-row input, .mlm-date-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mlm-date-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.mlm-button-row {
    text-align: center;
}

#mlm-reset-filter {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#mlm-reset-filter:hover {
    background-color: #d32f2f;
}

#mlm-reset-filter .dashicons {
    margin-right: 5px;
    font-size: 16px;
}

/* Styles pour la table */
.mlm-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}
/* Colonne favoris sticky à gauche */
.mlm-table-wrapper { overflow-x: auto; } /* si pas déjà le cas */
.mlm-table th:first-child,
.mlm-table td:first-child {
  position: sticky;
  left: 0;
  background: #fff;         /* ou la couleur de fond de ta table */
  z-index: 2;               /* passe par-dessus les autres cellules */
}
.mlm-table .artist-header td { position: static; } /* évite les effets bizarres sur les entêtes d'artiste */

.fav-cell { width: 44px; text-align: center; }
.fav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;   /* zone tactile confortable */
  border-radius: 18px;
  user-select: none;
  cursor: pointer;
  font-size: 20px;
}
.fav-icon.is-fav { color: #f5b301; }  /* jaune doux quand actif */
.fav-icon:active { transform: scale(0.95); }

/* Styles pour la table */
.mlm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
}

.mlm-table th, .mlm-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.mlm-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.mlm-table tr:hover {
    background-color: #f9f9f9;
}

/* Styles pour les champs d'artistes */
.artiste-input {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.artiste-input input {
    margin-right: 5px;
}

.artiste-input .button {
    min-width: 30px;
    text-align: center;
    cursor: pointer;
}

.remove-artiste {
    background-color: #f44336 !important;
    color: white !important;
    border-color: #d32f2f !important;
}

/* Styles pour la barre de recherche admin */
.mlm-admin-search-container {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mlm-admin-search-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Styles pour les colonnes de la table */
.mlm-table th[data-column="titre"] {
    width: 25%;
}

.mlm-table th[data-column="artiste"] {
    width: 25%;
}

.mlm-table th[data-column="annee"] {
    width: 10%;
}

.mlm-table th[data-column="genre"] {
    width: 15%;
}

.mlm-table th[data-column="date_ajout"] {
    width: 15%;
}

.mlm-table th:last-child {
    width: 10%;
}

/* Styles pour la table d'administration */
.mlm-table.widefat {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

/* Styles pour les colonnes */
.mlm-table th[data-column="titre"] {
    width: 30%;
}

.mlm-table th[data-column="artiste"] {
    width: 25%;
}

.mlm-table th[data-column="annee"] {
    width: 10%;
}

.mlm-table th[data-column="genre"] {
    width: 15%;
}

.mlm-table th[data-column="date_ajout"] {
    width: 15%;
}

/* Styles pour les écrans mobiles */
@media screen and (max-width: 768px) {
    .mlm-table {
        table-layout: auto;
    }
}

.mlm-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    cursor: pointer;
}

.mlm-table th:hover {
    background-color: #e6e6e6;
}

.mlm-table tr:hover {
    background-color: #f9f9f9;
}

.artist-header {
    background-color: #e9f7fe;
    font-weight: bold;
}

/* Styles pour la pagination */
.mlm-pagination {
    margin-top: 20px;
    text-align: center;
}

.mlm-pagination button {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    color: #333;
}

.mlm-pagination button:hover {
    background-color: #e9e9e9;
}

.mlm-pagination button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.mlm-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mlm-results-count {
    margin-bottom: 15px;
    font-weight: bold;
    color: #555;
}

/* Styles pour les appareils mobiles */
@media screen and (max-width: 768px) {
    .mlm-table th, .mlm-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .mlm-container h2 {
        font-size: 20px;
    }
    
    .mlm-container p {
        font-size: 14px;
    }
    
    .mlm-controls {
        padding: 10px;
    }
    
    #mlm-reset-filter {
        width: 100%;
        margin-top: 5px;
    }
    
    .artist-header td {
        font-size: 16px;
        padding: 10px;
    }
    
    .mlm-pagination button {
        padding: 5px 10px;
        margin: 0 2px;
        font-size: 14px;
    }
    
    .mlm-results-count {
        font-size: 14px;
    }
}

/* Style pour le placeholder du champ date */
/* Style pour le champ date */
.mlm-date-row input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
}

/* Supprimer les styles qui causent des problèmes */
input[type="date"]:not(:valid):before {
    content: none;
}

/* Améliorer l'apparence du sélecteur de date */
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
    color: #555;
}

input[type="date"]::-webkit-datetime-edit {
    color: #757575;
}

input[type="date"]:focus::-webkit-datetime-edit {
    color: #000;
}

input[type="date"]:not(:valid):before {
    content: "Sélectionner une date de début";
    color: #757575;
    position: absolute;
    padding: 8px;
}

/* Style pour les boutons de pagination */
.mlm-pagination button.first-page,
.mlm-pagination button.last-page {
    font-weight: bold;
}

/* Ajustement pour les appareils mobiles */
@media screen and (max-width: 768px) {
    .mlm-pagination button {
        padding: 5px 8px;
        margin: 0 1px;
        font-size: 12px;
    }
}

/* Styles pour que les cases prennent tout l'écran */
.card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.mlm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.mlm-table th, 
.mlm-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.mlm-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

/* Styles pour les colonnes triables */
.mlm-table th.sortable {
    cursor: pointer;
    position: relative;
}

.mlm-table th.sortable:hover {
    background-color: #f0f0f0;
}

.mlm-table th.sortable .sort-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 5px;
}

.mlm-table th.sortable.asc .sort-icon:after {
    content: "▲";
    font-size: 10px;
}

.mlm-table th.sortable.desc .sort-icon:after {
    content: "▼";
    font-size: 10px;
}

/* Styles pour la pagination admin */
.mlm-admin-pagination {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.mlm-admin-pagination button {
    margin: 0 3px;
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    cursor: pointer;
}

.mlm-admin-pagination button.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.mlm-admin-pagination button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Amélioration de la barre de recherche admin */
.mlm-admin-search-container {
    width: 100%;
    background: #fff;
    padding: 15px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 15px;
    border-radius: 3px;
    box-sizing: border-box;
}

#mlm-admin-search-input-table {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#mlm-admin-reset-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#mlm-admin-reset-filter .dashicons {
    margin-right: 5px;
}

/* Styles pour le compteur de résultats */
#mlm-admin-results-count {
    font-style: italic;
    color: #666;
}

/* Styles pour le formulaire d'édition */
#edit-form-overlay {
    z-index: 9999;
}

#edit-form-overlay .form-table th {
    width: 120px;
}

/* Styles pour les formulaires */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-table th,
.form-table td {
    padding: 15px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0;
}

.form-table th {
    width: 200px;
    font-weight: 600;
}

.form-table input[type="text"],
.form-table input[type="number"],
.form-table input[type="date"] {
    width: 100%;
    max-width: 400px;
}

/* Styles pour les conteneurs d'artistes */
#artistes-container {
    width: 100%;
}

.artiste-input {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.artiste-input input {
    flex: 1;
    margin-right: 5px;
}

/* Responsive design pour les petits écrans */
@media screen and (max-width: 782px) {
    .form-table th {
        width: 100%;
        display: block;
        padding-bottom: 0;
    }
    
    .form-table td {
        width: 100%;
        display: block;
        padding-top: 0;
    }
    
    .mlm-table {
        display: block;
        overflow-x: auto;
    }
}

/* Styles pour le modal d'édition */
.mlm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.mlm-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mlm-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.mlm-close:hover,
.mlm-close:focus {
    color: black;
    text-decoration: none;
}

.mlm-form-group {
    margin-bottom: 15px;
}

.mlm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.mlm-form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.mlm-form-group button {
    margin-top: 10px;
}

/* Styles pour les formulaires */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-table th,
.form-table td {
    padding: 15px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0;
}

.form-table th {
    width: 200px;
    font-weight: 600;
}

.form-table input[type="text"],
.form-table input[type="number"],
.form-table input[type="date"] {
    width: 100%;
    max-width: 400px;
}

/* Styles pour les conteneurs d'artistes */
#artistes-container {
    width: 100%;
}

.artiste-input {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.artiste-input input {
    flex: 1;
    margin-right: 5px;
}

/* Responsive design pour les petits écrans */
@media screen and (max-width: 782px) {
    .form-table th {
        width: 100%;
        display: block;
        padding-bottom: 0;
    }
    
    .form-table td {
        width: 100%;
        display: block;
        padding-top: 0;
    }
    
    .mlm-table {
        display: block;
        overflow-x: auto;
    }
}
.mlm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mlm-items-per-page select {
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
}

.mlm-items-per-page label {
    color: #666;
}
.badge-new{
  display:inline-block;
  margin-left:.4rem;
  padding:.08rem .35rem;
  font-size:.72rem;
  font-weight:600;
  color:#0a5;
  background:#e9fff2;
  border:1px solid #bdf5d4;
  border-radius:.35rem;
  vertical-align:middle;
}
/* Affichage épuré permanent : on garde ⭐, Titre, Artiste */
.mlm-table th:nth-child(4),
.mlm-table td:nth-child(4), /* Année (si 1=⭐,2=Titre,3=Artiste) */
.mlm-table th:nth-child(5),
.mlm-table td:nth-child(5), /* Genre */
.mlm-table th:nth-child(6),
.mlm-table td:nth-child(6)  /* Date d'ajout */
{ display:none; }

/* Modal */
.song-modal { position:fixed; inset:0; display:none; z-index:9999; }
.song-modal.is-open { display:block; }
.song-modal__backdrop { position:absolute; inset:0; background:rgba(0,0,0,.45); }
.song-modal__card {
  position:relative; margin:6vh auto 0; max-width:520px; background:#fff;
  border-radius:14px; padding:18px 16px 14px; box-shadow:0 10px 30px rgba(0,0,0,.2);
}
.song-modal__close {
  position:absolute; right:10px; top:8px; font-size:22px; line-height:1; background:none; border:0; cursor:pointer;
}
.song-modal__artist { margin:.25rem 0 1rem; color:#444; }
.song-modal__meta { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; margin-bottom:12px; }
.song-modal__actions { display:flex; flex-wrap:wrap; gap:8px; }
.song-modal__actions button {
  padding:8px 10px; border-radius:10px; border:1px solid #ddd; background:#f8f8f8; cursor:pointer;
}
#modal-fav-btn.is-fav { color:#b88600; border-color:#f1d27a; background:#fff8da; }

/* Style des boutons du modal */
.song-modal__actions button {
  background: #0073e6;         /* bleu lisible */
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  margin: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  opacity: 1 !important;       /* forcer la lisibilité */
}

/* Hover/Focus */
.song-modal__actions button:hover,
.song-modal__actions button:focus {
  background: #005bb5;
  outline: none;
}

/* Variante favoris actif */
#modal-fav-btn.is-fav {
  background: #f0c419;
  color: #000;
}
/* Mieux répartir les colonnes sur mobile */
@media (max-width: 768px){
  .mlm-table { table-layout: fixed; }        /* pour que les largeurs soient respectées */
  .mlm-table th, .mlm-table td { word-break: break-word; }

  /* 1 = ⭐, 2 = Titre, 3 = Artiste (4/5/6 masquées) */
  .mlm-table th:nth-child(1),
  .mlm-table td:nth-child(1){ width: 44px; min-width:44px; text-align:center; }

  .mlm-table th:nth-child(2),
  .mlm-table td:nth-child(2){ width: 62%; }   /* Titre plus large */

  .mlm-table th:nth-child(3),
  .mlm-table td:nth-child(3){ width: 38%; }   /* Artiste un peu plus étroit */
}

/* --- Desktop : mieux équilibrer --- */
@media (min-width: 769px){
  .mlm-table { table-layout: auto; width: 100%; }

  .mlm-table th:nth-child(1),
  .mlm-table td:nth-child(1){ width: 60px; text-align: center; } /* ⭐ étroit mais visible */

  .mlm-table th:nth-child(2),
  .mlm-table td:nth-child(2){ width: 45%; }  /* Titre large */

  .mlm-table th:nth-child(3),
  .mlm-table td:nth-child(3){ width: 30%; }  /* Artiste */

  .mlm-table th:nth-child(4),
  .mlm-table td:nth-child(4){ width: 8%; text-align: center; }  /* Année */

  .mlm-table th:nth-child(5),
  .mlm-table td:nth-child(5){ width: 12%; text-align: center; } /* Genre */

  .mlm-table th:nth-child(6),
  .mlm-table td:nth-child(6){ width: 12%; text-align: center; } /* Date ajout */
}
/* Option : réduire légèrement le padding pour gagner de la place */
@media (max-width: 768px){
  .mlm-table th, .mlm-table td { padding: 10px 8px; }
}