.icon-btn {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.icon-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}
.icon-btn:active {
    background: none !important;
    box-shadow: none !important;
}
/* Bouton icône sans cadre pour playlist */
.icon-btn {
    background: none;
    border: none;
    box-shadow: none;
    outline: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:focus {
    outline: none;
    box-shadow: none;
}
.icon-btn:active {
    background: none;
    box-shadow: none;
}
/* Music pages: genres, albums, list_artist, piste, view_artist */

/* Shared cards/lists */
.album-list,
.genre-list,
.artist-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    justify-content: stretch;
}

.album-item,
.genre-item,
.artist-card {
    background-color: transparent;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.2s;
    position: relative;
    text-align: left;
    width: auto;
    height: 100%;
}

.album-item:hover,
.genre-item:hover,
.artist-card:hover {
    transform: translateY(-4px);
}

.album-image-container {
    position: relative;
    margin: 0;
}

.album-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.album-title-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 5px;
    border-radius: 5px;
    text-align: center;
}

.album-item p {
    color: #ccc;
    margin: 5px 0;
}

.genre-item img,
.artist-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.genre-item h5 {
    margin: 0;
}

.artist-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.artist-details {
    background-color: transparent;
    width: 100%;
    height: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
}

.artist-details h4 {
    margin: 0;
    font-size: 1rem;
}

.artist-details a {
    color: inherit;
}

.album-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgb(197, 0, 0);
    color: #fff;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    z-index: 2;
}

.music-library-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.music-library-card > a.genre-card-link,
.music-library-card > a.album-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.music-library-card .ui-entity-card__media {
    aspect-ratio: 1 / 1;
}

.music-album-grid .music-library-card .ui-entity-card__media {
    aspect-ratio: 1 / 1;
}

/* Pagination on music pages */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    color: #007bff;
    padding: 10px 15px;
    text-decoration: none;
    border: 1px solid #007bff;
    margin: 0 5px;
    border-radius: 5px;
}

.pagination a.active {
    background-color: #007bff;
    color: #fff;
}

.pagination a:hover {
    background-color: #0056b3;
    color: #fff;
}

/* Artist view (albums + tracks) */
.album {
    width: 50%;
    margin: 10px auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-box-shadow: 0.2em 0.2em 1em #383737, -0.2em -0.2em 1em #383737;
    box-shadow: 0.2em 0.2em 1em #383737, -0.2em -0.2em 1em #383737;
    display: flex;
    justify-content: center;
    align-items: center;
}

.album-block {
    margin-bottom: 30px;
    padding: 20px;
    border: none;
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0.2em 0.2em 1em #383737, -0.2em -0.2em 1em #383737;
}

.album-content {
    display: flex;
    align-items: flex-start;
}

.album-cover {
    flex: 0 0 150px;
    margin-right: 20px;
}

.album-cover img {
    width: 100%;
    border-radius: 10px;
}

.album-details {
    flex: 1;
}

.track-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.track-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ccc;
}

.track-actions {
    display: flex;
    gap: 10px;
}

.track-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
}
.track-main {
    display: flex;
    align-items: center;
    gap: 0; /* espace entre titre et durée */
}
.track-duration {
    color: #888;
    font-size: 0.95em;
}
.track-playlist-form {
    width: 100%;
}

.track-playlist-form .form-control,
.track-playlist-form .btn {
    font-size: 0.82rem;
}

.track-item-with-menu {
    display: block;
}

.track-item-with-menu .track-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.playlist-menu {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.28);
}

.playlist-menu-tabs {
    display: flex;
    gap: 6px;
}

.playlist-menu-tabs .btn {
    font-size: 0.78rem;
    padding: 3px 8px;
}

.playlist-menu-tabs .btn.is-active {
    background: rgba(40, 167, 69, 0.25);
    border-color: rgba(40, 167, 69, 0.6);
}

.playlist-menu-note {
    margin-top: 8px;
    font-size: 0.8rem;
    opacity: 0.9;
}

.playlist-track-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.playlist-track-cover img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-mode-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.playlist-mode-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.playlist-mode-btn.active {
    background: rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.7);
}

.playlist-mode-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.image-100x100 {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

/* Full-width bottom player on view_artist */
#audio-player.audio-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 5px 15px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

#audio-player .player-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

#audio-player .player-cover img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
}

#audio-player .player-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

#audio-player .player-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 10px;
}

#audio-player .player-progress input[type="range"] {
    width: 100%;
    max-width: 300px;
    cursor: pointer;
}

#audio-player .seek-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex: 0 0 auto;
}

#audio-player #player-current-time,
#audio-player #player-duration {
    min-width: 38px;
    text-align: center;
    font-size: 13px;
}

#audio-player .player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

#audio-player .player-controls button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: var(--text-color);
    position: static;
    transform: none;
    padding: 0;
}

/* Compact player on piste.php */
.card > .audio-player {
    width: 300px;
    margin: 5px auto;
    border: 2px solid rgb(88, 88, 88);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: height 0.3s ease;
    color: var(--text-color);
    background: color-mix(in srgb, var(--background-color) 88%, transparent);
}

.player-header {
    text-align: center;
    margin-bottom: 10px;
}

.player-header p {
    font-size: 14px;
    margin: 5px 0;
    color: var(--text-color);
}

.player-header a {
    color: var(--icon-accent-strong-color);
    text-decoration: underline;
}

.player-header a:hover {
    color: #90ee90;
}

.player-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.card > .audio-player .player-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
}

.audio-player .play-btn,
.audio-player .prev-btn,
.audio-player .next-btn {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    font-size: 14px;
    position: static;
    transform: none;
    padding: 0;
}

.audio-player .play-btn:hover,
.audio-player .prev-btn:hover,
.audio-player .next-btn:hover {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.audio-player .play-btn:focus,
.audio-player .prev-btn:focus,
.audio-player .next-btn:focus {
    background: none;
    border: none;
    outline: none;
}

.seek-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.seek-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--text-color);
    font-weight: 600;
}

.seek-separator {
    opacity: 0.9;
}

#current-time,
#duration {
    color: var(--text-color);
}

#track-title {
    margin-top: 10px;
    text-align: center;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

#seek-bar {
    width: 65%;
    flex: 1;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, green 70%, yellow 85%, red 100%);
    height: 10px;
    border-radius: 5px;
    outline: none;
    overflow: hidden;
}

#seek-bar::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    cursor: pointer;
    background: linear-gradient(to right, green 70%, yellow 85%, red 100%);
    border-radius: 5px;
}

#seek-bar::-moz-range-track {
    width: 100%;
    height: 10px;
    cursor: pointer;
    background: linear-gradient(to right, green 70%, yellow 85%, red 100%);
    border-radius: 5px;
}

#seek-bar::-ms-track {
    width: 100%;
    height: 10px;
    cursor: pointer;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

#seek-bar::-ms-fill-lower {
    background: linear-gradient(to right, green 70%, yellow 85%, red 100%);
    border-radius: 5px;
}

#seek-bar::-ms-fill-upper {
    background: linear-gradient(to right, green 70%, yellow 85%, red 100%);
    border-radius: 5px;
}

#seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: gold;
    border-radius: 50%;
    cursor: pointer;
    margin-top: 0;
}

#seek-bar::-moz-range-thumb,
#seek-bar::-ms-thumb {
    width: 10px;
    height: 10px;
    background: gold;
    border-radius: 50%;
    cursor: pointer;
}

#current-time,
#duration {
    min-width: 38px;
    font-size: 13px;
    color: var(--text-color);
    text-align: center;
}

#track-title {
    font-size: 14px;
    color: var(--text-color);
    text-align: center;
    margin-top: 10px;
}

/* Legacy view selectors (kept for compatibility) */
.view-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background-color: #1c1c1c;
    border: 2px solid green;
    border-radius: 10px;
    padding: 20px;
    position: relative;
}

.view-poster {
    flex: 0 0 200px;
    text-align: center;
}

.view-poster img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.view-info {
    flex: 1;
    color: #fff;
}

.view-info p {
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .album-item,
    .genre-item,
    .artist-card {
        width: 180px;
    }
}

@media (max-width: 992px) {
    .album-item,
    .genre-item,
    .artist-card {
        width: 160px;
    }
}

@media (max-width: 768px) {
    .album-item,
    .genre-item,
    .artist-card {
        width: 140px;
    }
}

@media (max-width: 576px) {
    .album-item,
    .genre-item,
    .artist-card {
        width: 120px;
    }
}

/* Modal personnalisé playlist */
.playlist-modal {
    display: flex;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}
.playlist-modal-content {
    background: #222;
    color: #fff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
    min-width: 280px;
    max-width: 90vw;
    text-align: center;
    position: relative;
}
.playlist-modal-close {
    position: absolute;
    top: 10px;
    right: 18px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.playlist-modal-close:hover {
    opacity: 1;
}

/* Upload music: modal ajout artiste adapte au theme courant */
#addArtistModal .modal-content {
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--app-form-field-border, rgba(255, 255, 255, 0.16));
}

#addArtistModal .modal-header,
#addArtistModal .modal-footer {
    border-color: var(--hr-color);
}

#addArtistModal .close {
    color: var(--text-color);
    text-shadow: none;
    opacity: 0.8;
}

#addArtistModal .close:hover,
#addArtistModal .close:focus {
    color: var(--text-color);
    opacity: 1;
}

#addArtistModal .form-control {
    background: var(--app-form-field-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--app-form-field-border, rgba(255, 255, 255, 0.16));
    color: var(--text-color);
}

#addArtistModal .form-control:focus {
    border-color: var(--app-form-field-border-focus, var(--icon-accent-color));
    box-shadow: var(--app-form-field-shadow-focus, 0 0 0 3px rgba(88, 214, 179, 0.18));
}

#addArtistModal small {
    color: var(--app-form-help-color, rgba(255, 255, 255, 0.66));
}

