/* Importation d'une police similaire à celle de Spotify */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

/* Réinitialisation de base et variables de couleur */
/* Thème 1: Sombre (Défaut) */
:root {
    --bg-black: #000000;
    --bg-dark-gray: #121212;
    --bg-gray: #242424;
    --bg-light-gray: #282828;
    --text-primary: #FFFFFF;
    --text-secondary: #b3b3b3;
    --spotify-green: #1DB954;
}

/* Thème 2: Lumineux */
body.theme-light {
    --bg-black: #FFFFFF;
    --bg-dark-gray: #F5F5F5;
    --bg-gray: #E0E0E0;
    --bg-light-gray: #F0F0F0;
    --text-primary: #000000;
    --text-secondary: #555555;
    --spotify-green: #1DB954; 
}

/* Thème 3: Forêt */
body.theme-forest {
    --bg-black: #1a3a1a;
    --bg-dark-gray: #2a5a2a;
    --bg-gray: #556b2f;
    --bg-light-gray: #6b8e23;
    --text-primary: #F5F5DC;
    --text-secondary: #BDB76B;
    --spotify-green: #9acd32; 
}

/* Thème 4: Océan */
body.theme-ocean {
    --bg-black: #0c1445;
    --bg-dark-gray: #007bff;
    --bg-gray: #17a2b8;
    --bg-light-gray: #5bc0de;
    --text-primary: #FFFFFF;
    --text-secondary: #B0E0E6;
    --spotify-green: #20c997; 
}

/* Thème 5: Crépuscule */
body.theme-sunset {
    --bg-black: #2c1a3b;
    --bg-dark-gray: #4a2f58;
    --bg-gray: #7d4f60;
    --bg-light-gray: #b07173;
    --text-primary: #ffe5d9;
    --text-secondary: #ffbba0;
    --spotify-green: #ffc107; 
}

/* Thème 6: Raisin */
body.theme-grape {
    --bg-black: #301934;
    --bg-dark-gray: #5d3b6d;
    --bg-gray: #7a5980;
    --bg-light-gray: #a48ead;
    --text-primary: #e6e0f0;
    --text-secondary: #bca9c7;
    --spotify-green: #f038ff; 
}

/* Thème 7: Rubis */
body.theme-ruby {
    --bg-black: #2a0000;
    --bg-dark-gray: #4d0000;
    --bg-gray: #7a0000;
    --bg-light-gray: #a02c2c;
    --text-primary: #ffe5e5;
    --text-secondary: #ffb8b8;
    --spotify-green: #ff4d4d; 
}

/* Thème 8: Néon */
body.theme-neon {
    --bg-black: #0a0a0a;
    --bg-dark-gray: #1a2a2a;
    --bg-gray: #004a4a;
    --bg-light-gray: #007a7a;
    --text-primary: #e0ffff;
    --text-secondary: #7fffd4;
    --spotify-green: #00fafa; 
}

/* Thème 9: Or */
body.theme-gold {
    --bg-black: #1a1400;
    --bg-dark-gray: #332900;
    --bg-gray: #4d3d00;
    --bg-light-gray: #806600;
    --text-primary: #fff8e0;
    --text-secondary: #ffd700;
    --spotify-green: #f0c400; 
}

/* Thème 10: Matrix */
body.theme-matrix {
    --bg-black: #000000;
    --bg-dark-gray: #0a0a0a;
    --bg-gray: #003300;
    --bg-light-gray: #004400;
    --text-primary: #00ff00;
    --text-secondary: #008f11;
    --spotify-green: #00ff00; 
}

/* Thème 11: Dracula */
body.theme-dracula {
    --bg-black: #282a36;
    --bg-dark-gray: #44475a;
    --bg-gray: #6272a4;
    --bg-light-gray: #50fa7b;
    --text-primary: #f8f8f2;
    --text-secondary: #bd93f9;
    --spotify-green: #ff79c6; 
}

/* Thème 12: Volcan */
body.theme-volcano {
    --bg-black: #1a0500;
    --bg-dark-gray: #2e0a00;
    --bg-gray: #4a1200;
    --bg-light-gray: #702000;
    --text-primary: #ffaa80;
    --text-secondary: #cc5200;
    --spotify-green: #ff4500; 
}

/* Thème 13: Café */
body.theme-coffee {
    --bg-black: #2b1d16;
    --bg-dark-gray: #3e2b22;
    --bg-gray: #5c4033;
    --bg-light-gray: #6f4e37;
    --text-primary: #f5deb3;
    --text-secondary: #d2b48c;
    --spotify-green: #cd853f; 
}

/* Thème 14: Minuit */
body.theme-midnight {
    --bg-black: #0b1026;
    --bg-dark-gray: #151b3b;
    --bg-gray: #232d5b;
    --bg-light-gray: #3a4680;
    --text-primary: #eef1f5;
    --text-secondary: #aab2d1;
    --spotify-green: #5c87ff; 
}

/* Thème 15: Sakura (Sombre) */
body.theme-sakura {
    --bg-black: #2b0a10;
    --bg-dark-gray: #4a121d;
    --bg-gray: #752b3b;
    --bg-light-gray: #9e475b;
    --text-primary: #ffe6eb;
    --text-secondary: #ffb3c1;
    --spotify-green: #ff69b4; 
}

/* Thème 16: Cyber */
body.theme-cyber {
    --bg-black: #050505;
    --bg-dark-gray: #1a1a1a;
    --bg-gray: #333333;
    --bg-light-gray: #4d4d4d;
    --text-primary: #fcee0a; /* Jaune Cyberpunk */
    --text-secondary: #00f3ff; /* Bleu Cyan */
    --spotify-green: #fcee0a; 
}

/* Thème 17: Menthe */
body.theme-mint {
    --bg-black: #05261e;
    --bg-dark-gray: #0c4034;
    --bg-gray: #1e6656;
    --bg-light-gray: #358a76;
    --text-primary: #e0fffa;
    --text-secondary: #98ffdd;
    --spotify-green: #00ffaa; 
}

/* Thème 18: Ardoise */
body.theme-slate {
    --bg-black: #1f2933;
    --bg-dark-gray: #323f4b;
    --bg-gray: #3e4c59;
    --bg-light-gray: #52606d;
    --text-primary: #f5f7fa;
    --text-secondary: #cbd2d9;
    --spotify-green: #7b8c9e; 
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-black);
    color: var(--text-primary);
    overflow: hidden; 
    transition: background-color 0.3s ease, color 0.3s ease; 
}

a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--text-primary);
}

ul {
    list-style: none;
}

button {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    color: var(--text-primary);
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* ----------------------------- */
/* LAYOUT PRINCIPAL (GRILLE)     */
/* ----------------------------- */

.container {
    display: grid;
    grid-template-areas:
        "sidebar main-content"
        "player-bar player-bar";
    grid-template-columns: 280px 1fr; /* Sidebar légèrement plus large */
    grid-template-rows: 1fr auto; 
    height: 100vh;
}

/* ----------------------------- */
/* 1. BARRE LATÉRALE (REFONTE V2)*/
/* ----------------------------- */

.sidebar {
    grid-area: sidebar;
    background-color: #000000; 
    padding: 8px; 
    display: flex;
    flex-direction: column;
    gap: 8px; 
    overflow: hidden; 
    height: 100vh;
    max-height: calc(100vh - 90px); 
}

.sidebar-panel {
    background-color: #121212;
    border-radius: 8px;
    padding: 8px 12px;
    transition: background-color 0.3s ease;
}

/* --- PANNEAU NAVIGATION --- */
.nav-panel {
    flex-shrink: 0; 
    padding: 20px 24px;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    cursor: pointer;
}

.sidebar .logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -1px;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0;
}

/* --- NAVIGATION PRINCIPALE FLUIDE --- */
.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 6px; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-bottom: 4px;
}

.nav-links a i {
    width: 24px;
    margin-right: 20px;
    font-size: 1.4rem;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
    padding-left: 18px;
}

.nav-links a:hover i, 
.nav-links a.active-nav i {
    color: var(--spotify-green);
    transform: scale(1.2);
}

.nav-links a.active-nav {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- PANNEAU BIBLIOTHÈQUE --- */
.library-panel {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    padding: 8px 8px 0 8px; 
    overflow: hidden; 
}

.lib-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 8px 8px 8px; /* Padding réduit en bas car plus de filtres */
    margin-bottom: 4px;
}

.lib-btn-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1rem;
    background: none;
    border: none;
    transition: color 0.2s;
}

.lib-btn-header:hover {
    color: var(--text-primary);
}

.action-btn {
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #2a2a2a;
    color: var(--text-primary);
}

/* Zone Scrollable */
.lib-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.lib-scroll-area::-webkit-scrollbar {
    width: 6px;
}
.lib-scroll-area::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
}

/* Titres de sections */
.lib-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 12px 8px 8px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Styles des éléments de liste */
.lib-row-link, 
#user-playlists-list li a, 
.sidebar-artist-card, 
.sidebar-album-card {
    display: flex !important;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

/* --- ÉLÉMENTS DE LISTE VIVANTS --- */
.lib-row-link, 
#user-playlists-list li a, 
.sidebar-artist-card, 
.sidebar-album-card {
    transition: background-color 0.2s ease, transform 0.2s ease !important;
    border: 1px solid transparent;
}

.lib-row-link:hover, 
#user-playlists-list li a:hover, 
.sidebar-artist-card:hover, 
.sidebar-album-card:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Animation spécifique pour l'image au survol de la ligne */
.lib-row-link:hover img, 
#user-playlists-list li a:hover img, 
.sidebar-artist-card:hover img, 
.sidebar-album-card:hover img {
    transform: scale(1.1) rotate(3deg);
    transition: transform 0.3s ease;
}

/* Images */
.sidebar-artist-card img, 
.sidebar-album-card img,
#user-playlists-list li img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 4px !important; 
    margin-right: 12px !important;
    margin-bottom: 0 !important; 
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.sidebar-artist-card img {
    border-radius: 50% !important;
}

/* Icone Liked */
.icon-box {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0; /* Empêche l'écrasement */
}

.liked-box {
    background: linear-gradient(135deg, #450af5, #c4efd9);
    color: white;
}

/* Textes */
.text-box, 
.sidebar-artist-card p, 
.sidebar-album-card p,
#user-playlists-list li a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.main-text, 
.sidebar-artist-card p, 
.sidebar-album-card p {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 !important;
    text-align: left !important;
}

.sub-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Style spécifique Historique (JS généré) */
#history-link a {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}
#history-link a:hover {
    background-color: #1f1f1f;
    color: var(--text-primary);
}
#history-link i {
    font-size: 1.2rem;
    width: 48px;
    text-align: center;
    margin-right: 12px;
    color: var(--spotify-green);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reset Listes */
#user-playlists-list, 
.lib-list-dynamic {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* --- FOOTER --- */
.footer-panel {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px;
    background-color: #121212;
}

/* --- BOUTONS FOOTER FLOTTANTS --- */
.footer-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Effet élastique */
}

.footer-icon:hover {
    color: var(--spotify-green);
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px) scale(1.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.footer-icon:active {
    transform: translateY(0) scale(0.95);
}


/* ----------------------------- */
/* 2. CONTENU PRINCIPAL (CENTRE) */
/* ----------------------------- */

.main-content {
    grid-area: main-content;
    background-color: var(--bg-dark-gray);
    overflow-y: auto; 
    padding-bottom: 90px;
    transition: background-color 0.3s ease;
    border-radius: 8px; /* Arrondi pour matcher la sidebar */
    margin: 8px 8px 8px 0; /* Marges autour pour l'effet panel */
}

.header {
    background-color: rgba(0, 0, 0, 0.7); 
    padding: 16px 32px;
    display: grid; 
    grid-template-columns: 1fr 2fr 1fr; 
    align-items: center;
    gap: 16px;
    position: sticky; 
    top: 0;
    z-index: 10;
    border-top-left-radius: 8px; /* Arrondi */
    border-top-right-radius: 8px;
}
body.theme-light .header {
    background-color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid var(--bg-gray);
}


.header .nav-arrows button {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin-right: 16px;
}
body.theme-light .header .nav-arrows button {
    background-color: rgba(0, 0, 0, 0.1);
}

.header .nav-arrows button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
    color: var(--text-secondary); 
}

.search-container {
    position: relative; 
    width: 100%;
    max-width: 450px;
    margin: 0 auto; 
}

.search-container input {
    width: 100%;
    padding: 12px 20px 12px 40px; 
    border-radius: 30px;
    border: none;
    background-color: var(--bg-light-gray); 
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
}

.search-container input:focus {
    outline: 2px solid var(--spotify-green);
    background-color: var(--bg-gray);
}

.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* STYLES OVERLAY RECHERCHE */
#search-overlay {
    position: absolute;
    top: calc(100% + 8px); 
    left: 0;
    width: 100%;
    min-width: 450px; 
    max-height: 80vh;
    overflow-y: auto;
    
    background-color: var(--bg-dark-gray); 
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
    z-index: 100; 
    
    transform-origin: top;
    transition: opacity 0.2s ease;
}

#overlay-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#overlay-results-list li {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--bg-gray);
}

#overlay-results-list li:last-child {
    border-bottom: none;
}

#overlay-results-list li:hover {
    background-color: var(--bg-gray);
}

#overlay-results-list li img {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 4px;
    object-fit: cover;
}

#overlay-results-list li.artist-result img {
    border-radius: 50%;
}

.result-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.result-info strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.result-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.result-type {
    font-size: 0.75rem;
    color: var(--spotify-green);
    font-weight: 700;
    margin-left: 10px;
    text-transform: uppercase;
    flex-shrink: 0;
}


.auth-group {
    display: flex;
    justify-content: flex-end; 
}

.header .auth-buttons {
    display: flex;
    gap: 16px; 
}
.header .signup-btn,
.header .login-btn {
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.header .signup-btn {
    background-color: transparent;
    color: var(--text-secondary);
}
.header .signup-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}
.header .login-btn {
    background-color: var(--text-primary);
    color: var(--bg-black);
}
.header .login-btn:hover {
    transform: scale(1.05);
}

.header .user-profile .profile-btn {
    background-color: var(--bg-black);
    padding: 8px; 
    border-radius: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}
body.theme-light .header .user-profile .profile-btn {
    background-color: var(--bg-gray);
}
.header .user-profile .profile-btn:hover {
    transform: scale(1.05); 
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}


.content-section {
    padding: 24px 32px;
}
.content-section h2, 
.content-section h3 {
    margin-bottom: 20px;
}
#home-view .content-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}
#home-view .content-section:not(:first-of-type) { 
    padding-top: 40px; 
}

/* En-tête des contrôles (pour Artistes/Albums) */
.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.controls-header .section-title {
    margin-bottom: 0;
}
.controls-header select {
    background-color: var(--bg-gray);
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.card {
    position: relative; 
    background-color: var(--bg-gray);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease; 
    cursor: pointer;
}
.card:hover {
    background-color: var(--bg-light-gray);
    transform: translateY(-5px); 
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4); 
}
.card img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}
.card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.card-details p {
    margin-bottom: 0;
    flex-grow: 1; 
}
.card-duration {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0; 
}


.song-list {
    width: 100%;
    border-collapse: collapse;
}
.song-list th, .song-list td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--bg-gray);
    color: var(--text-secondary);
}
.song-list th {
    font-size: 0.8rem;
    letter-spacing: 1px;
}
#album-view .song-list thead th,
#artist-view .song-list thead th {
    position: sticky;
    top: 0;
    background-color: var(--bg-dark-gray);
    z-index: 5;
    border-bottom: 2px solid var(--text-secondary);
}

.song-list td:first-child {
    width: 40px;
    text-align: center;
}
.song-list td:nth-child(2) {
    color: var(--text-primary);
}
/* MODIFICATION : Animation */
.song-list tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.song-list tr:hover {
    background-color: var(--bg-light-gray);
    cursor: pointer;
    transform: scale(1.005); /* Animation subtile */
}

/* ----------------------------- */
/* 3. BARRE DE LECTURE (BAS)     */
/* ----------------------------- */

.player-bar {
    grid-area: player-bar;
    background-color: var(--bg-black); /* Noir en bas */
    height: 90px;
    /* Pas de bordure, fond noir pur */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    transition: background-color 0.3s ease;
}

.player-left {
    display: flex;
    align-items: center;
    width: 30%;
}
.player-left .now-playing-img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    margin-right: 12px;
}
.player-left h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.player-left p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

#now-playing-title,
#now-playing-artist {
    cursor: pointer;
    transition: color 0.2s ease;
}
#now-playing-title:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
#now-playing-artist:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.player-center {
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.player-controls {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.player-controls button {
    font-size: 1.1rem;
    margin: 0 12px;
}
.player-controls .play-btn {
    background-color: var(--text-primary);
    color: var(--bg-black);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
}
.player-controls .play-btn:hover {
    background-color: var(--text-primary);
    transform: scale(1.05);
    filter: brightness(1); /* Annuler la luminosité pour ce bouton */
}
.progress-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
}
.progress-bar-container span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: var(--bg-gray);
    border-radius: 2px;
    margin: 0 10px;
    cursor: pointer;
}
.progress {
    width: 0%; 
    height: 100%;
    background-color: var(--spotify-green);
    border-radius: 2px;
}
.player-right {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.player-right i {
    font-size: 1rem;
    margin-right: 10px;
    cursor: pointer; 
    color: var(--text-secondary); 
    transition: color 0.2s ease; 
}
.player-right i:hover {
    color: var(--text-primary); 
}
.volume-bar {
    width: 100px;
    height: 4px;
    background-color: var(--bg-gray);
    border-radius: 2px;
    cursor: pointer;
}
.volume-progress {
    width: 100%; 
    height: 100%;
    background-color: var(--spotify-green);
    border-radius: 2px;
}


/* ----------------------------- */
/* STYLES VUE ACCUEIL            */
/* ----------------------------- */

.home-header {
    padding: 32px;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg-gray), var(--bg-dark-gray));
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.home-logo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid var(--text-primary);
}
.home-header h1 {
    font-size: 2.8rem; 
    font-weight: 900;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* ----------------------------- */
/* STYLES VUE ALBUM              */
/* ----------------------------- */

.album-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 32px;
    height: 350px; 
    background: linear-gradient(to bottom, #302040, var(--bg-dark-gray)); 
}

#album-view .album-header #cover-container {
    position: relative;
    width: 230px;
    height: 230px;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}
#album-view .album-header #cover-container:hover #cover-edit-overlay {
    opacity: 1;
    pointer-events: auto; 
}

.album-header img {
    width: 100%; 
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

#cover-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    border-radius: 4px; 
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    opacity: 0; 
    transition: opacity 0.2s ease;
    pointer-events: none; 
}
#cover-edit-overlay i {
    font-size: 2rem;
    margin-bottom: 8px;
}

.album-details p {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.album-details h1 {
    font-size: 3rem; 
    font-weight: 900;
    margin-bottom: 12px;
}
#album-view .album-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 15px; 
    padding-bottom: 15px;
    justify-content: flex-start;
    position: relative;
}
#album-view #playlist-controls-header {
    margin-left: auto; 
    margin-right: 0;
    position: static !important; 
    width: auto; 
}

#album-view .song-list th:first-child,
#album-view .song-list td:first-child {
    width: 40px; 
    text-align: center;
}
#album-view .song-list .col-title {
    width: 30%; 
    color: var(--text-primary);
}
#album-view .song-list .col-artist {
    width: 20%; 
}
#album-view .song-list .col-album { 
    width: 15%; 
}
#album-view .song-list .col-like {
    width: 50px; 
    text-align: center;
}
#album-view .song-list .col-duration {
    width: 70px; 
    text-align: right;
    padding-right: 16px;
}
#album-view .song-list .col-date-added { 
    width: 150px; 
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
#album-view .song-list .col-options {
    width: 70px; 
    text-align: center;
}

.song-info-text strong,
.song-info-text span[data-action] {
    cursor: pointer;
    transition: color 0.15s ease;
}
/* NOUVEAU: Style pour le lien artiste cliquable */
.album-details .artist-link {
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    color: var(--text-primary);
}
.album-details .artist-link:hover {
    text-decoration: underline;
}

#album-view .album-details h1 {
    cursor: pointer; 
    transition: color 0.15s ease;
}
#album-view .album-details h1:hover {
    color: var(--spotify-green); 
}
.song-info-text strong:hover {
    color: var(--spotify-green); 
}
.song-info-text span[data-action]:hover {
    color: var(--text-primary); 
    text-decoration: underline;
}

.save-album-btn {
    font-size: 1.5rem; 
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.save-album-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}
.save-album-btn.saved i {
    color: var(--spotify-green);
    font-weight: 900;
}
#playlist-delete-btn {
    margin-left: 24px;
    font-size: 1.3rem;
}
#playlist-delete-btn:hover i {
    color: #ff4d4d; 
    transform: scale(1.1);
}

/* Styling for new header control buttons (Share, etc.) */
.control-btn {
    font-size: 1.5rem; 
    color: var(--text-secondary);
    transition: color 0.2s ease;
    padding: 10px;
    border-radius: 50%;
}
.control-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ----------------------------- */
/* STYLES VUE ARTISTE            */
/* ----------------------------- */

.artist-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(to bottom, var(--bg-gray), var(--bg-dark-gray));
}
.artist-header img {
    width: 230px;
    height: 230px;
    object-fit: cover;
    border-radius: 50%; 
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
}
.artist-details p {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.artist-details h1 {
    font-size: 3rem; 
    font-weight: 900;
    margin-bottom: 12px;
}

.artist-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 24px;
}
.artist-controls .playlist-search-container {
    margin-left: auto; 
    max-width: 350px;
    flex-grow: 1;
}

.large-play-btn {
    width: 60px;
    height: 60px;
    background-color: var(--spotify-green);
    color: var(--text-primary);
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.large-play-btn:hover {
    transform: scale(1.05) !important;
    background-color: var(--spotify-green);
    color: var(--text-primary);
}
.follow-btn {
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.follow-btn:hover {
    transform: scale(1.05) !important;
    border-color: var(--text-primary);
}
.follow-btn.active {
    background-color: var(--spotify-green);
    color: var(--text-primary);
    border-color: var(--spotify-green);
}


#artist-view .song-list th:nth-child(1) { /* # */
    width: 40px;
}
#artist-view .song-list th:nth-child(2) { /* Titre */
    width: 60%;
}
#artist-view .song-list th:nth-child(3) { /* Écoutes */
    width: 20%;
}
#artist-view .song-list th:nth-child(4) { /* Durée */
    width: 10%;
    text-align: right;
    padding-right: 16px;
}

#artist-view .song-list td {
    padding-top: 8px;
    padding-bottom: 8px;
}
#artist-view .song-list td:nth-child(4) { /* Durée */
    text-align: right;
    padding-right: 16px;
}

#artist-view .song-list .song-info {
    display: flex;
    align-items: center;
}
#artist-view .song-list img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
    object-fit: cover;
}
#artist-view .song-list .song-info-text {
    display: flex;
    flex-direction: column;
}
#artist-view .song-list .song-info-text strong {
    color: var(--text-primary);
    font-weight: 500;
}
#artist-view .song-list .song-info-text span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}


/* ----------------------------- */
/* STYLES MODALE AUTH / UPLOAD   */
/* ----------------------------- */

/* MODIFICATION : Animation d'apparition */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.2s ease, visibility 0.2s;
}
.modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

body.theme-light .modal-overlay {
    background-color: rgba(255, 255, 255, 0.7);
}
.modal-content {
    background-color: var(--bg-gray);
    padding: 32px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
    /* MODIFICATION : Animation */
    transform: scale(0.95);
    transition: transform 0.2s ease;
}
.modal-overlay[style*="display: flex"] .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-modal:hover {
    color: var(--text-primary);
}
#login-form h2,
#signup-form h2,
#forgot-password-form h2,
#image-upload-modal h2,
#create-playlist-modal h2,
#donation-overlay h2,
#confirm-delete-modal h2,
#queue-modal h2,
#context-playlist-modal h2,
#album-info-modal h2,
#edit-playlist-modal h2 { 
    font-size: 1.8rem;
    margin-bottom: 24px;
}
.modal-content form {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.modal-content label {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
    margin-top: 16px;
}
.modal-content input {
    background-color: var(--bg-light-gray);
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    padding: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%; 
}
.forgot-password-link {
    font-size: 0.85rem;
    text-align: right;
    margin-top: 8px;
    margin-bottom: 16px;
    text-decoration: underline;
}
.forgot-password-link:hover {
    color: var(--spotify-green);
}
.forgot-instructions {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    text-align: center;
}
.login-btn-modal {
    background-color: var(--spotify-green);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 30px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.login-btn-modal:hover {
    transform: scale(1.03);
}
.modal-content hr {
    border: none;
    border-top: 1px solid var(--bg-light-gray);
    margin: 32px 0;
}
.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.switch-form-btn {
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 30px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
}
.switch-form-btn:hover {
    transform: scale(1.03);
    border-color: var(--text-primary);
}
.password-container {
    position: relative;
    width: 100%;
}
.password-container input {
    padding-right: 45px; 
}
.toggle-password {
    position: absolute;
    top: 50%; 
    right: 15px; 
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
}
.toggle-password:hover {
    color: var(--text-primary);
}


/* ----------------------------- */
/* STYLES VUE PROFIL (MIS À JOUR) */
/* ----------------------------- */

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(to bottom, var(--bg-gray), var(--bg-dark-gray));
}

.profile-avatar-container {
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden; 
    width: 150px; 
    height: 150px; 
}
.profile-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid var(--text-primary);
    border-radius: 50%; 
    display: block; 
}
.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    border-radius: 50%; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0; 
    transition: opacity 0.2s ease;
}
.profile-avatar-container:hover .avatar-edit-overlay {
    opacity: 1;
}
.avatar-edit-overlay i {
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.avatar-edit-overlay p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary) !important; 
}

.profile-details h2 {
    font-size: 2.5rem;
    font-weight: 900;
}
.profile-details p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* --- NAVIGATION PROFILS --- */
.profile-nav {
    display: flex;
    gap: 16px;
    padding: 0 32px; 
    border-bottom: 1px solid var(--bg-gray);
    margin-top: 24px;
}
.profile-nav-link {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 16px 4px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.profile-nav-link:hover {
    color: var(--text-primary);
}
.profile-nav-link.active {
    color: var(--spotify-green);
    border-bottom-color: var(--spotify-green);
}

.profile-form {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profile-form label {
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 8px;
}
.profile-form input {
    background-color: var(--bg-light-gray);
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    padding: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
}
.save-btn {
    background-color: var(--spotify-green);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 30px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 20px;
    cursor: pointer;
    width: 250px;
    align-self: flex-start; 
}
.save-btn:hover {
    transform: scale(1.03);
}
.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.theme-swatch {
    cursor: pointer;
    padding: 12px;
    background-color: var(--bg-gray);
    border-radius: 8px;
    text-align: center;
    transition: background-color 0.2s ease;
    border: 2px solid transparent; 
}
.theme-swatch:hover {
    background-color: var(--bg-light-gray);
}
.theme-swatch.active-theme {
    border-color: var(--spotify-green);
}
.theme-swatch .swatch-color {
    width: 100%;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.theme-swatch p {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* --- NOUVEAUX STYLES : PAGE STATISTIQUES (Remplacement) --- */

/* 1. Sélecteur de période */
.stats-timeframe-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.timeframe-btn {
    background-color: var(--bg-gray);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    transition: all 0.2s ease;
}
.timeframe-btn:hover {
    background-color: var(--bg-light-gray);
    color: var(--text-primary);
    transform: scale(1.05);
}
.timeframe-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-black);
}

/* 2. Grille d'aperçu */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.stat-card {
    background-color: var(--bg-gray);
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: background-color 0.3s ease;
}
.stat-card:hover {
    background-color: var(--bg-light-gray);
}
.stat-card i {
    font-size: 2.5rem;
    color: var(--spotify-green);
    flex-shrink: 0;
}
.stat-info span {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    color: var(--text-primary);
}
.stat-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 3. Grille des Top Listes */
.stats-top-lists-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.stats-list-container h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--bg-gray);
    padding-bottom: 10px;
}
.stats-top-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stats-top-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-gray);
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}
.stats-top-list li:hover {
    background-color: var(--bg-light-gray);
}
.stat-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 25px;
    text-align: center;
    flex-shrink: 0;
}
.stats-top-list img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.stats-top-list img.artist-cover {
    border-radius: 50%;
}
.stat-list-info {
    flex-grow: 1;
    overflow: hidden; 
}
.stat-list-info strong {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-list-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-list-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--spotify-green);
    margin-left: auto;
    padding-left: 10px;
    flex-shrink: 0;
}
.stats-top-list .stats-placeholder {
    display: block;
    color: var(--text-secondary);
    font-style: italic;
    background: none;
}


/* Rendre les listes responsives sur mobile */
@media (max-width: 1200px) {
    .stats-top-lists-container {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    .stats-top-lists-container {
        grid-template-columns: 1fr;
    }
    .header {
        grid-template-columns: 1fr 1fr;
    }
    .search-container {
        grid-column: 1 / -1; 
        grid-row: 2;
        max-width: none;
    }
}


/* Styles de la Modale d'Upload (Avatar Uniquement) */
#upload-area {
    width: 100%;
    text-align: center;
    transition: border-color 0.2s;
    user-select: none;
    background-color: transparent;
    border: none; 
}
#cropper-container {
    width: 100%;
    height: 300px;
    margin: 20px 0;
    overflow: hidden; 
    background-color: var(--bg-black);
    border: 1px solid var(--bg-gray);
    position: relative;
    display: flex; 
    justify-content: center;
    align-items: center;
}
#cropper-container #upload-area {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--text-secondary);
    transition: all 0.2s;
}
#cropper-container #upload-area:hover {
    border-color: var(--spotify-green);
    background-color: rgba(0, 0, 0, 0.1);
}
#cropper-container #upload-area i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
#cropper-container #upload-area p {
    color: var(--text-secondary);
    font-weight: 500;
}


/* ----------------------------- */
/* STYLES NOUVEAUX BOUTONS       */
/* ----------------------------- */

.player-left .like-btn {
    font-size: 1rem;
    margin-left: 16px;
    margin-right: 8px;
    padding: 8px;
}
.player-left .add-to-playlist-btn {
    font-size: 1rem;
    padding: 8px;
}
.player-left button:hover {
    transform: none; 
    color: var(--text-primary);
    filter: brightness(1.2); /* MODIFICATION : Animation */
}

.player-left .like-btn.active .fa-heart {
    color: var(--spotify-green);
}
.player-controls #shuffle-btn,
.player-controls #repeat-btn {
    font-size: 0.9rem;
}
.player-controls button.active {
    color: var(--spotify-green);
}

/* ----------------------------- */
/* STYLES NOTIFICATION           */
/* ----------------------------- */

#notification {
    position: fixed;
    bottom: 100px; 
    left: 50%;
    color: var(--text-primary); 
    padding: 14px 24px; 
    border-radius: 30px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 
    z-index: 1001; 
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px); 
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
}
#notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0); 
}

/* ----------------------------- */
/* STYLES VUE RECHERCHE          */
/* ----------------------------- */

#search-view .song-list td {
    padding-top: 8px;
    padding-bottom: 8px;
}
#search-view .song-list .song-info {
    display: flex;
    align-items: center;
}
#search-view .song-list img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
    object-fit: cover;
}
#search-view .song-list .song-info-text {
    display: flex;
    flex-direction: column;
}
#search-view .song-list .song-info-text strong {
    color: var(--text-primary);
    font-weight: 500;
}
#search-view .song-list .song-info-text span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.artist-card {
    background-color: var(--bg-gray);
    border-radius: 8px;
    padding: 16px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    text-align: center; 
}
.artist-card:hover {
    background-color: var(--bg-light-gray);
}
.artist-card img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    border-radius: 50%; 
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.artist-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artist-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ----------------------------- */
/* BOUTON PLAY SUR CARTE         */
/* ----------------------------- */

.card {
    position: relative; 
}

.card .card-play-btn {
    position: absolute;
    bottom: 95px; /* Ajusté */
    right: 20px;
    
    width: 50px;
    height: 50px;
    background-color: var(--spotify-green);
    color: var(--text-primary);
    border-radius: 50%;
    border: none;
    
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    
    z-index: 2;
}
.card:hover .card-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.card .card-play-btn:hover {
    transform: scale(1.1) !important; 
    filter: brightness(1.1);
}

/* ----------------------------- */
/* STYLES POPUP PLAYLIST (Bas-Gauche) */
/* ----------------------------- */

#add-to-playlist-popup {
    position: fixed;
    bottom: 100px; 
    left: 28px; 
    right: auto; 
    z-index: 1000;
    width: 250px; 
    
    background-color: var(--bg-dark-gray);
    border: 1px solid var(--bg-gray);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7); 
    padding: 8px; 
    
    opacity: 0; 
    visibility: hidden;
    transform: translateY(10px) scale(0.98); 
    transform-origin: bottom left; 
    transition: all 0.2s ease-out;
}

#add-to-playlist-popup[style*="display: block"] { 
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1); 
}

.popup-content h3 {
    font-size: 0.9rem; 
    font-weight: 700;
    margin: 8px 0; 
    color: var(--text-secondary); 
    text-align: left;
    padding: 0 8px 4px 8px;
    border-bottom: 1px solid var(--bg-gray); 
}

#add-to-playlist-popup .close-popup {
    display: none; 
}

#playlist-options-container {
    display: flex;
    flex-direction: column;
    gap: 0px; 
}

#playlist-options-container .switch-form-btn {
    background-color: transparent;
    border: none;
    color: var(--text-primary); 
    font-weight: 500;
    padding: 10px 8px; 
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}

#playlist-options-container .switch-form-btn:hover {
    background-color: var(--bg-gray); 
    color: var(--text-primary);
    transform: none; 
}

/* --- MODIFICATION : Amélioration Bouton Retirer (X) --- */
#album-view .song-list .remove-fav-btn {
    color: var(--text-secondary); 
    font-size: 1rem;
    margin-right: 12px;
    padding: 0;
    min-width: 20px;
    opacity: 0; 
    transition: all 0.2s ease;
}

.song-list tr:hover .remove-fav-btn {
    opacity: 1; 
}

#album-view .song-list .remove-fav-btn:hover {
    color: #ff4d4d; 
    transform: scale(1.15);
}

#album-view .song-list .remove-fav-btn.is-favorite-list {
    color: var(--spotify-green);
    opacity: 1; 
}
#album-view .song-list .remove-fav-btn.is-favorite-list:hover {
    color: var(--text-primary); 
}
/* --- FIN MODIFICATION --- */


/* --- MODIFICATION : Amélioration Bouton Cœur (Like) --- */
.song-list .song-like-btn {
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 8px;
    opacity: 1; 
    transition: color 0.2s, transform 0.2s;
    transform: none;
}

.song-list .song-like-btn:hover {
    color: var(--text-primary);
    transform: scale(1.15);
}

.song-list .song-like-btn.active {
    color: var(--spotify-green);
}

.song-list .song-like-btn.active:hover {
     color: var(--spotify-green); 
     filter: brightness(1.2);
}

.song-list .song-like-btn.active .fa-heart {
    font-weight: 900; 
}
/* --- FIN MODIFICATION --- */


/* Styles pour la zone d'upload de la modale de création de playlist */
.upload-area-creation {
    width: 100%;
    height: 150px; 
    padding: 10px;
    margin: 10px 0 20px 0;
    border: 2px dashed var(--text-secondary);
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.upload-area-creation:hover {
    border-color: var(--spotify-green);
    background-color: rgba(0, 0, 0, 0.1);
}
.upload-area-creation i {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    transition: color 0.2s;
}
.upload-area-creation:hover i {
    color: var(--spotify-green);
}
.upload-area-creation p {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    margin: 0;
}
.upload-area-creation.has-image i,
.upload-area-creation.has-image p {
    display: none;
}
#preview-image-creation {
    position: absolute;
    top: 0;
    left: 0;
}

/* Style pour la Modale de Don */
.small-modal {
    max-width: 380px;
}
#donation-overlay .modal-content {
    padding: 30px;
    text-align: center;
}
#donation-overlay h2 {
    color: var(--spotify-green);
}
#donation-overlay p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}
.donate-link {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

/* Style pour la Modale de Confirmation de Suppression (NEW) */
.confirmation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
}
.confirmation-buttons .switch-form-btn,
.confirmation-buttons .login-btn-modal {
    width: 100%;
    margin-top: 0;
}
.confirmation-buttons .delete-confirm {
    background-color: #d93025;
    color: white;
}
.confirmation-buttons .delete-confirm:hover {
    background-color: #c02a20;
    transform: scale(1.03);
}

/* --- STYLES RECHERCHE PLAYLIST --- */
.playlist-search-container {
    max-width: 300px; 
    margin: 0;
    margin-right: 24px; 
    flex-grow: 0; 
}
.playlist-search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}
.playlist-search-container input {
    background-color: var(--bg-dark-gray);
    border: 1px solid var(--bg-gray);
    padding-left: 40px;
    font-size: 0.9rem;
}
.playlist-search-container input:focus {
    outline: 1px solid var(--spotify-green);
    background-color: var(--bg-gray);
}
#playlist-controls-header {
    margin-left: auto; 
    margin-right: 0;
    position: static !important; 
}

/* --- STYLES MODALE DE FILE D'ATTENTE (Queue) --- */
.queue-content {
    max-width: 600px; 
    min-height: 400px;
    text-align: left;
}
.queue-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--bg-gray);
    padding-bottom: 10px;
}
#queue-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px; 
    list-style-type: none; 
}
#queue-list li {
    cursor: grab;
}
#queue-list li.current-playing {
    background-color: var(--spotify-green);
    color: var(--bg-black);
    font-weight: 700;
}
#queue-list li.current-playing span, #queue-list li.current-playing strong {
    color: var(--bg-black) !important;
}
#queue-list li.dragging {
    opacity: 0.5;
}

/* ---------------------------------- */
/* STYLES MENU CONTEXTUEL (SONG)      */
/* ---------------------------------- */

.song-list .song-options-btn {
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 8px;
    opacity: 0; 
    transition: opacity 0.2s, color 0.2s;
    transform: none; 
}

.song-list tr:hover .song-options-btn {
    opacity: 1; 
}

.song-list .song-options-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1); 
}

#context-menu-popup {
    position: fixed; 
    z-index: 1001;
    width: 280px;
    
    background-color: var(--bg-dark-gray);
    border: 1px solid var(--bg-gray);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    padding: 8px; 
    
    transform-origin: top left;
    transition: opacity 0.1s ease-out;
}

#context-menu-popup .popup-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 8px 8px 8px;
    padding-bottom: 8px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--bg-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#context-menu-options {
    display: flex;
    flex-direction: column;
    gap: 0px;
    list-style: none;
}

#context-menu-options li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 10px 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}

#context-menu-options li i {
    margin-right: 12px;
    width: 16px; 
    text-align: center;
}

#context-menu-options li:hover {
    background-color: var(--bg-gray);
}

#context-menu-options .menu-separator {
    height: 1px;
    background-color: var(--bg-gray);
    margin: 4px 8px;
    padding: 0;
}

#context-menu-options .menu-separator:hover {
    background-color: var(--bg-gray); 
}

/* ---------------------------------- */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* --- NOUVELLES ANIMATIONS (À AJOUTER À LA FIN DE STYLE.CSS) --- */

/* 1. Animation d'apparition des pages (Fade In + Slide Up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > div {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 2. Animation en cascade pour les listes de chansons */
.song-list tr {
    opacity: 0;
    animation: fadeInUp 0.3s ease-out forwards;
}
/* Décalage pour l'effet cascade (jusqu'à 20 éléments) */
.song-list tr:nth-child(1) { animation-delay: 0.05s; }
.song-list tr:nth-child(2) { animation-delay: 0.1s; }
.song-list tr:nth-child(3) { animation-delay: 0.15s; }
.song-list tr:nth-child(4) { animation-delay: 0.2s; }
.song-list tr:nth-child(5) { animation-delay: 0.25s; }
/* ... le reste s'animera naturellement */

/* 3. Effet "Pulsation" sur le bouton Play en lecture */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.player-controls .play-btn:hover {
    animation: pulse-green 1.5s infinite;
}

/* 4. Animation Barre de Lecture (Spectre audio simulé) */
@keyframes sound-wave {
    0%, 100% { height: 10%; }
    50% { height: 100%; }
}

/* Ajoute une classe .playing-wave aux images quand la musique joue */
.now-playing-img.playing {
    animation: pulse-green 2s infinite;
}

/* 5. Effet de clic (Ripple) sur les boutons */
button:active {
    transform: scale(0.95) !important;
}

/* --- NOUVELLES ANIMATIONS VIVANTES --- */

/* Animation Logo Sidebar (Rebond au survol) */
.sidebar .logo:hover h2 {
    transform: scale(1.05);
    text-shadow: 0 0 10px var(--spotify-green);
    transition: all 0.3s ease;
}

/* Animation Titre Accueil (Dégradé animé) */
.main-title-animated {
    background: linear-gradient(to right, var(--text-primary), var(--spotify-green), var(--text-primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Animation Pulsation pour le Logo Accueil */
.animated-logo {
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Effet de lueur sur les cartes au survol */
.card:hover {
    box-shadow: 0 0 20px rgba(var(--spotify-green), 0.4);
}

/* Effet "presse" sur tous les boutons de la sidebar */
.sidebar-footer button:active, .sidebar-footer a:active {
    transform: scale(0.9);
}
/* --- NOUVEAUX STYLES : MENU DE TRI PERSONNALISÉ --- */

.custom-sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-trigger-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sort-trigger-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
}

.sort-trigger-btn span {
    margin-right: 4px;
}

/* Menu déroulant (Overlay) */
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    z-index: 1000;
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

/* Classe ajoutée par JS pour afficher le menu */
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sort-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary); /* Gris par défaut */
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, color 0.1s;
}

.sort-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Style pour l'option active */
.sort-option.active {
    color: var(--spotify-green); /* Vert quand actif */
}

.sort-icon {
    font-size: 0.8rem;
    opacity: 0; /* Caché par défaut */
    transition: transform 0.2s ease;
}

/* L'icône apparaît uniquement sur l'élément actif */
.sort-option.active .sort-icon {
    opacity: 1;
}

/* Rotation de l'icône pour l'ordre décroissant */
.sort-option.descending .sort-icon {
    transform: rotate(180deg);
}

/* Style spécifique pour "Personnalisé" s'il n'a pas d'icône de tri */
.sort-option[data-sort="custom"].active .sort-icon {
    display: none;
}
/* --- STYLES BOUTON QUEUE & DRAG-DROP --- */

/* Le bouton dans la barre de droite */
#queue-btn {
    margin-right: 15px; /* Espace entre le bouton et le volume */
    font-size: 1rem;
    color: var(--text-secondary);
}

#queue-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

#queue-btn.active {
    color: var(--spotify-green); /* Devient vert quand la modale est ouverte */
}

/* Styles pour le déplacement dans la liste (Queue) */
#queue-list li {
    cursor: grab; /* Curseur main ouverte */
    border-bottom: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

#queue-list li:active {
    cursor: grabbing; /* Curseur main fermée quand on attrape */
    background-color: var(--bg-light-gray);
}

/* Indicateur visuel quand on survole une zone de dépôt */
#queue-list li.drag-over {
    border-bottom: 2px solid var(--spotify-green);
}

/* Bouton supprimer dans la file d'attente */
.remove-from-queue-btn {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-from-queue-btn:hover {
    opacity: 1;
    color: #ff4d4d; /* Rouge au survol */
}

/* CORRECTION : Forcer la confirmation au premier plan */
#confirm-delete-modal {
    z-index: 9999 !important; /* Très haute priorité */
}

/* S'assurer que la file d'attente est en dessous */
#queue-modal {
    z-index: 1001 !important; /* Priorité standard */
}

/* ------------------------------------------------ */
/* LOGIQUE D'AFFICHAGE DES COLONNES   */
/* ---------------------------------- */

#playlist-song-list .col-artist,
#playlist-song-list .col-album,
#playlist-song-list .col-date-added {
    display: table-cell;
}

/* AFFICHER TOUJOURS LA COLONNE OPTIONS */
#playlist-song-list .col-options {
    display: table-cell !important;
    width: 50px;
    text-align: center;
}

#album-view.album-mode .song-list .col-artist,
#album-view.album-mode .song-list .col-album,
#album-view.album-mode .song-list .col-date-added {
    display: none; 
}

#album-view.album-mode .song-list .col-options {
    display: table-cell; 
}

#album-view.album-mode .song-list .col-title {
    width: 60%;
}


/* --- NOUVEAU: Styles pour le Drag-and-Drop de playlist --- */
.song-list tr[draggable="true"] {
    cursor: grab;
}
.song-list tr[draggable="true"]:active {
    cursor: grabbing;
}
.song-list tr.dragging {
    opacity: 0.5;
    background-color: var(--bg-light-gray);
}

/* --- NOUVEAU: Styles pour la modale d'ajout à la playlist --- */
#context-playlist-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 40vh; 
    overflow-y: auto;
    padding-right: 5px; 
}

.playlist-option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light-gray);
    border: 1px solid var(--bg-light-gray);
    color: var(--text-primary); 
    font-weight: 500;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
}
.playlist-option-btn:hover {
    background-color: var(--bg-gray);
    transform: none; 
}

.playlist-option-btn i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.playlist-option-btn.in-playlist i {
    color: var(--spotify-green); 
}

/* --- NOUVEAU: Styles pour la modale info album --- */
.album-info-content {
    max-width: 400px;
    padding-bottom: 32px;
}
.album-info-content img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.album-info-content h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.album-info-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.album-info-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.album-info-stats span {
    display: inline-block;
}
.album-info-content .login-btn-modal {
    margin-top: 0;
}

/* --- NOUVEAU: Styles pour la modale Edit Playlist --- */
.edit-playlist-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.edit-cover-container {
    flex-basis: 150px;
    flex-shrink: 0;
}
.edit-cover-container label {
    margin-top: 0;
}
.edit-name-container {
    flex-grow: 1;
    text-align: left;
}
.edit-name-container label {
    margin-top: 0;
}
#edit-playlist-modal .login-btn-modal {
    margin-top: 0; /* Annuler la marge du bouton submit */
}
/* Réutiliser le style de la zone d'upload de création */
#upload-area-edit {
    width: 150px;
    height: 150px;
}

/* ------------------------------------------------ */
/* RESPONSIVE DESIGN (VUES MOBILES & TABLETTES)     */
/* ------------------------------------------------ */

/* Afficher le bouton Menu Hamburger */
#mobile-menu-btn {
    display: none; /* MODIFICATION ICI : Caché par défaut sur PC */
    grid-area: menu-btn;
    background-color: transparent;
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 0;
    margin: 0;
    width: 32px;
    height: 32px;
    justify-content: center;
    align-items: center;
}
#mobile-menu-btn:hover {
    transform: none;
}

/* --- Styles à ajouter/vérifier dans la section générale de style.css --- */

/* Assure que le conteneur principal des flèches est visible sur PC */
.nav-arrows.desktop-only {
    display: flex;
    align-items: center;
    gap: 16px; /* Espace entre les boutons */
}

/* Assure que le groupe de contrôle principal s'affiche correctement dans le header */
.nav-controls-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

@media (max-width: 1000px) {
    
    /* 1. LAYOUT PRINCIPAL */
    .container {
        display: block; /* Plus simple sur mobile que le grid complexe */
    }
    
    /* 2. SIDEBAR (Menu Latéral) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        z-index: 1002; /* Au-dessus de tout */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Fond sombre quand le menu est ouvert */
    .sidebar-overlay {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar.mobile-open + .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Bouton Hamburger (Header) */
    #mobile-menu-btn {
        display: flex !important;
    }
    
    /* Bouton Fermeture (Dans la Sidebar) */
    #sidebar-toggle-btn {
        display: block !important;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        margin-right: 15px;
        padding: 0;
    }
    
    .sidebar .logo {
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    /* 3. HEADER */
    .header {
        grid-template-columns: 40px 1fr 1fr;
        gap: 8px;
        padding: 12px 16px;
    }
    .header .desktop-only {
        display: none !important;
    }
    .nav-arrows {
        grid-area: menu-btn; 
    }
    .search-container {
        grid-column: 2 / 3;
        max-width: 100%;
    }
    
    /* 4. MAIN CONTENT */
    .main-content {
        margin: 0;
        border-radius: 0;
        padding-bottom: 220px; /* Marge augmentée pour que le contenu ne soit pas caché par le lecteur fixe */
        height: 100vh; /* Prend tout l'écran */
        overflow-y: auto; /* Scroll interne */
    }
    .content-section {
        padding: 16px;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    
    /* Ajustements Vue Album/Artiste */
    .album-header {
        height: auto;
        min-height: 250px;
        padding: 20px 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    #album-view .album-header #cover-container {
        width: 150px;
        height: 150px;
        margin-bottom: 15px;
    }
    .album-details h1 {
        font-size: 1.8rem;
    }
    .album-controls, .artist-controls {
        flex-wrap: wrap;
        padding: 16px;
        justify-content: center;
        gap: 16px;
    }
    .artist-controls .playlist-search-container {
        order: 10;
        width: 100%;
        margin-left: 0;
    }
    .large-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* 5. PLAYER BAR (FIXE EN BAS) */
    .player-bar {
        position: fixed; /* Reste toujours en bas de l'écran */
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 12px 16px;
        height: auto;
        min-height: 140px; /* Assez grand pour tout afficher */
        background-color: var(--bg-black); /* Fond opaque pour cacher le contenu qui défile */
        border-top: 1px solid var(--bg-gray);
        z-index: 1000;
        
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    }
    
    /* Infos Titre + Bouton Like (Haut du player) */
    .player-left {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        order: 1;
    }
    
    /* Contrôles + Barre de progression (Bas du player) */
    .player-center {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 2;
        margin-bottom: 0;
    }

    .player-controls {
        margin-bottom: 5px;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .player-controls button {
        font-size: 1.5rem;
        margin: 0 15px;
    }
    .player-controls .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Barre de progression agrandie pour le tactile */
    .progress-bar-container {
        width: 100%;
        height: 20px; /* Zone tactile plus grande */
        display: flex;
        align-items: center;
        margin-top: 5px;
    }
    .progress-bar {
        height: 6px; /* Barre plus visible */
    }

    .player-right {
        display: none; /* Masquer le volume sur mobile */
    }
    
    /* Masquer les colonnes inutiles dans les listes */
    #playlist-song-list .col-artist,
    #playlist-song-list .col-album,
    #playlist-song-list .col-date-added {
        display: none !important;
    }
    #playlist-song-list .col-title {
        width: 70% !important;
    }
    
    /* Garder le bouton options visible */
    #playlist-song-list .col-options {
        display: table-cell !important;
        width: 50px !important;
    }
}
    
    /* --- BOUTON FERMETURE SIDEBAR (Mobile) --- */
    #sidebar-toggle-btn {
        display: block !important; /* Force l'affichage sur mobile */
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        margin-right: 15px; /* Espace entre le bouton et "Be Natio" */
        cursor: pointer;
        padding: 0;
    }

    #sidebar-toggle-btn:hover {
        transform: scale(1.1);
        color: var(--spotify-green);
    }

    /* Ajustement du conteneur logo pour aligner le bouton et le texte */
    .sidebar .logo {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Aligner à gauche */
    }

/* --- Style du bouton Déconnexion --- */
.logout-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background-color: transparent;
    border: 1px solid var(--text-secondary);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    border-color: #ff4d4d; /* Rouge */
    color: #ff4d4d;
    transform: scale(1.05);
}
/* --- STYLE BALANCE AUDIO --- */
.balance-container {
    max-width: 500px;
    margin-bottom: 20px;
}

.balance-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.balance-label {
    font-weight: 700;
    color: var(--text-secondary);
}

/* Style du Slider (Range Input) */
#balance-slider {
    -webkit-appearance: none; /* Pour Chrome, Safari, Edge */
    appearance: none;         /* La version standard (Pour Firefox et le futur) */
    width: 100%;
    height: 4px;
    background: var(--bg-light-gray);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#balance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

#balance-slider::-webkit-slider-thumb:hover {
    background: var(--spotify-green);
    transform: scale(1.2);
}

/* --- STYLES DU MINI-LECTEUR (PICTURE IN PICTURE) --- */
.pip-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-black);
    color: var(--text-primary);
    padding: 15px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
}

.pip-header {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin-bottom: 15px;
}

.pip-cover {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-bottom: 15px;
}

.pip-info {
    text-align: center;
    width: 100%;
}

.pip-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pip-artist {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pip-controls-area {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pip-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pip-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 35px;
}

.pip-progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: var(--bg-gray);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.pip-progress-fill {
    height: 100%;
    background-color: var(--spotify-green);
    border-radius: 2px;
    width: 0%;
}

.pip-buttons-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.pip-main-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pip-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

.pip-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.pip-play-btn {
    background-color: var(--text-primary);
    color: var(--bg-black);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.pip-play-btn:hover {
    transform: scale(1.05);
    color: var(--bg-black);
}

.pip-btn.active {
    color: var(--spotify-green);
}

/* --- STYLE COMMANDE VOCALE (Mise à jour) --- */

/* Ajustement pour faire de la place au micro */
.search-container input {
    /* On augmente l'espace pour que le texte n'aille pas sous le micro */
    padding-right: 55px; /* Était à 45px */
}

#voice-search-btn {
    position: absolute;
    /* On le décale plus vers la gauche pour qu'il ne soit pas coupé par le bord */
    right: 33px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 5;
    outline: none; /* Enlève le carré bleu au clic sur certains navigateurs */
}

/* ... le reste (hover, listening, keyframes) ne change pas ... */
#voice-search-btn:hover {
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

#voice-search-btn.listening {
    color: #ff4d4d;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: translateY(-50%) scale(1); text-shadow: 0 0 0 rgba(255, 77, 77, 0.7); }
    50% { transform: translateY(-50%) scale(1.2); text-shadow: 0 0 10px rgba(255, 77, 77, 0); }
    100% { transform: translateY(-50%) scale(1); text-shadow: 0 0 0 rgba(255, 77, 77, 0); }
}

/* --- STYLE NOTIFICATIONS (Nouveautés) --- */

.notification-container {
    position: relative;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

#notif-btn {
    background-color: transparent; /* Fond transparent par défaut */
    color: var(--text-secondary);
    font-size: 1.2rem;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
}

#notif-btn:hover, #notif-btn.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1); /* Petit rond gris au survol */
    transform: scale(1.05);
}

/* La pastille rouge (Badge) */
#notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background-color: #2e77d0; /* Bleu Spotify (ou #1db954 vert) */
    border-radius: 50%;
    border: 2px solid var(--bg-black); /* Bordure pour détacher du fond */
}

/* Le menu déroulant */
.notif-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 320px;
    background-color: var(--bg-gray);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    padding: 0;
    z-index: 1000;
    display: none; /* Caché par défaut */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
    overflow: hidden;
}

.notif-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.notif-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.notif-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

#notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.notif-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.notif-item img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 12px;
}

.notif-info {
    flex-grow: 1;
}

.notif-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.notif-info span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.notif-new-label {
    color: #2e77d0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
}

#notif-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: none;
}

img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: auto; /* Assure que le clic passe bien */
}

/* --- CORRECTIF MOBILE POUR LES NOTIFICATIONS --- */

@media (max-width: 768px) {
    .notif-dropdown {
        /* On détache le menu du bouton pour le fixer à l'écran */
        position: fixed; 
        top: 70px; /* Juste en dessous de la barre noire du haut */
        left: 50%; /* On le centre horizontalement */
        right: auto; /* On annule l'alignement à droite */
        
        /* On utilise transform pour le centrer parfaitement et gérer l'animation */
        transform: translateX(-50%) translateY(-10px); 
        
        /* On ajuste la taille pour les petits écrans */
        width: 90%; /* Prend 90% de la largeur du téléphone */
        max-width: 350px; /* Mais pas plus large que 350px */
        max-height: 60vh; /* Hauteur max pour ne pas tout cacher */
        
        /* On s'assure qu'il est au-dessus de tout (z-index très haut) */
        z-index: 9999; 
    }

    /* Animation d'ouverture centrée */
    .notif-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
}