:root { 
    --accent-color: #1db954; /* Fallback par défaut, écrasé par le JS à la connexion */
}

/* --- Empêcher la sélection, l'appui long et FIXER le lecteur sur mobile --- */
body {
    background-color: #0d0d0d !important; 
    color: #b3b3b3; 
    
    /* LA MAGIE EST ICI : Verrouillage total de l'écran */
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    position: fixed;
    top: 0; left: 0;
    
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    font-size: 0.9rem; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overscroll-behavior-y: none;
}
input, textarea { -webkit-user-select: auto; -moz-user-select: auto; -ms-user-select: auto; user-select: auto; }
/* Le hack ultime pour écraser le fond forcé par l'autofill de Chrome/Edge/Safari */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #272727 inset !important;    
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}
input.form-control { background-color: #272727; border-color: #3b3b3b; }
input.form-control:focus { border-color: var(--accent-color); box-shadow: 0 0 8px var(--accent-color) !important; }

/* =========================================
   DESIGN DES SWITCHS ET CHECKBOX
   ========================================= */

/* --- 1. POUR LES SWITCHS OVALES (Interrupteurs) --- */
.form-switch .form-check-input {
    cursor: pointer;
    /* On écrase le fond clair de Bootstrap quand c'est désactivé */
    background-color: #3a3a3a !important; 
    border-color: #555 !important;
    /* (On ne met pas de width/height ici pour garder la forme ovale native de Bootstrap) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23aaaaaa'/%3e%3c/svg%3e") !important;
}

/* Quand le switch est activé */
.form-switch .form-check-input:checked {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 10px var(--accent-color) !important; /* Le halo lumineux */
}

/* Quand le switch a le focus (clic ou navigation clavier) */
.form-switch .form-check-input:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 8px var(--accent-color) !important;
}


/* --- 2. POUR LES CASES À COCHER CLASSIQUES (Carrées) --- */
/* (Applique tes dimensions 18x18 uniquement aux vraies cases à cocher) */
input.form-check-input:not(.form-switch .form-check-input) {
    width: 18px !important; 
    height: 18px !important; 
    cursor: pointer; 
    margin: 0;
    background-color: #3a3a3a !important; /* Fond sombre par défaut */
    border-color: #555 !important;
}

/* Quand la case est cochée */
input.form-check-input:not(.form-switch .form-check-input):checked {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 8px var(--accent-color) !important;
}

/* Focus sur la case */
input.form-check-input:not(.form-switch .form-check-input):focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 8px var(--accent-color) !important;
}

/* =========================================
   COULEUR DU ROND (THUMB) DU SWITCH BOOTSTRAP
   ========================================= */

/* 1. Couleur du rond quand le switch est sur ON (Allumé) */
.form-switch .form-check-input:checked {
    /* On force le rond en blanc pur quand c'est activé (#ffffff) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
}

/* 2. Si un jour on bloque complètement un switch (attribut 'disabled' dans le HTML) */
.form-switch .form-check-input:disabled {
    filter: grayscale(100%);
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

html { overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
.controls, #main-container { max-width: 100vw; overflow-x: hidden; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #5a5a5a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b3b3b3; }

/* Loader Pull-to-refresh */
@keyframes ptr-spin {
    100% { transform: rotate(360deg); }
}
.ptr-spinning {
    animation: ptr-spin 1s linear infinite;
}

/* =========================================
   LOADER DESIGN (Ondes sonores)
   ========================================= */
.music-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.music-loader .bar {
    width: 2px;
    height: 16px;
    background-color: var(--accent-color);
    border-radius: 1px;
    animation: music-wave 1s ease-in-out infinite;
    transform-origin: center;
    box-shadow: 0 0 4px rgba(255, 77, 77, 0.4); /* Petit effet néon */
}

.persistent-loader-text {
    font-weight: 600;
    text-wrap-mode: nowrap;
}

/* On décale l'animation de chaque barre pour l'effet de vague */
.music-loader .bar:nth-child(1) { animation-delay: 0.1s; }
.music-loader .bar:nth-child(2) { animation-delay: 0.3s; }
.music-loader .bar:nth-child(3) { animation-delay: 0.0s; }
.music-loader .bar:nth-child(4) { animation-delay: 0.2s; }
.music-loader .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes music-wave {
    0%, 100% { transform: scaleY(0.3); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

#cover-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 4000; justify-content: center; align-items: center; cursor: zoom-out; backdrop-filter: blur(5px); }
#cover-modal img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.8); }
.zoomable-cover { cursor: zoom-in; transition: transform 0.2s; }
.zoomable-cover:hover { transform: scale(1.02); }

/* --- NAVBAR MODERNE --- */
.navbar { background-color: #000 !important; padding: 0 !important; border-bottom: 1px solid #262626; display: flex !important; flex-direction: column !important; flex-wrap: nowrap !important; position: relative; z-index: 10; }
.navbar-inner { display: flex; align-items: center; gap: 16px; padding: 10px 20px; min-height: 56px; width: 100%; }

.nav-logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.5px; cursor: pointer; flex: 1; justify-content: flex-end; transition: opacity 0.2s; }
.nav-logo:hover { opacity: 0.85; }
.nav-logo-text { white-space: nowrap; }

/* L'icône gérée en pur CSS */
.nav-logo-icon {
    width: 26px;
    height: 26px;
    background-image: url(/favicon.ico);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.nav-right-actions { display: flex; align-items: center; gap: 20px; flex: 1; justify-content: flex-start; }
.nav-right-actions-right { display: flex; align-items: center; gap: 5px; flex: 1; justify-content: flex-start; }
.nav-action-btn { background: none; border: none; color: #b3b3b3; cursor: pointer; padding: 6px; border-radius: 50%; transition: color 0.2s, background 0.2s; display: flex; align-items: center; justify-content: center; }
.nav-action-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* --- SEARCH PILL --- */
.search-pill { flex: 0 1 auto; display: flex; align-items: center; gap: 10px; background: #1a1a1a; border-radius: 500px; padding: 0 20px; height: 44px; width: 480px; max-width: 480px; transition: background 0.2s, box-shadow 0.25s; border: 1px solid transparent; }
.search-pill:focus-within { background: #242424; border-color: rgba(255,255,255,0.15); box-shadow: 0 0 0 3px rgba(255,255,255,0.04); }
.search-pill-icon { color: #808080; flex-shrink: 0; transition: color 0.2s; width: 18px; height: 18px; }
.search-pill:focus-within .search-pill-icon { color: #fff; }
.search-pill-input { flex: 1; background: transparent; border: none; color: #fff; font-size: 0.92rem; outline: none; min-width: 0; width: 100%; max-width: none; -webkit-appearance: none; }
.search-pill-input::placeholder { color: #555; }

/* --- FULLSCREEN NOW PLAYING (MOBILE) --- */
#np-fullscreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 6000; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); will-change: transform; overflow: hidden; display: none; background: #000; }
#np-fullscreen.open { transform: translateY(0); }
#np-fullscreen.ready { display: flex; }
#npf-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(60px) saturate(1.8) brightness(0.45); transform: scale(1.4); }
#npf-bg-gradient { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.6) 100%); }
#npf-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; padding: 12px 24px; padding-bottom: env(safe-area-inset-bottom, 12px); overflow: hidden; }
#npf-header { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: auto; flex-shrink: 0; }
#npf-header-close { background: none; border: none; color: white; }
#npf-close { background: none; border: none; color: #fff; cursor: pointer; padding: 8px; border-radius: 50%; transition: background 0.2s; }
#npf-close:hover { background: rgba(255,255,255,0.1); }
#npf-cast-icon { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; }
#npf-subtitle { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #b3b3b3; }
#npf-cover-wrapper { width: clamp(160px, 48vh, 340px); aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.7); flex-shrink: 0; }
#npf-cover { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-select: none; user-select: none; }
#npf-info { width: 100%; max-width: 340px; text-align: center; margin-top: clamp(10px, 2vh, 24px); flex-shrink: 0; }
#npf-title { font-size: clamp(1rem, 3vh, 1.3rem); font-weight: 800; color: #fff; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#npf-artist { font-size: clamp(0.8rem, 2vh, 0.95rem); color: rgba(255,255,255,0.7); margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#npf-album { font-size: clamp(0.7rem, 1.5vh, 0.82rem); color: rgba(255,255,255,0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#npf-progress { width: 100%; max-width: 340px; flex-shrink: 0; margin-top: clamp(8px, 2vh, 20px); }
#npf-progress input[type=range] { width: 100%; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin: 0; }
#npf-progress input[type=range]::-webkit-slider-thumb { opacity: 1; width: 14px; height: 14px; }
#npf-times { display: flex; justify-content: space-between; font-size: 0.68rem; color: rgba(255,255,255,0.5); margin-top: 4px; }
#npf-buttons { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 24px); width: 100%; max-width: 340px; margin-top: clamp(10px, 2vh, 24px); flex-shrink: 0; }
.npf-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 6px; border-radius: 50%; transition: transform 0.15s, color 0.2s; display: flex; align-items: center; justify-content: center; }
.npf-btn:active { transform: scale(0.92); }
.npf-btn.active { color: var(--accent-color); }
.npf-btn svg { width: clamp(18px, 3.5vh, 22px); height: clamp(18px, 3.5vh, 22px); }
.npf-btn:nth-child(2) svg, .npf-btn:nth-child(4) svg { width: clamp(26px, 4.5vh, 32px); height: clamp(26px, 4.5vh, 32px); }
.npf-play { width: clamp(50px, 9vh, 64px); height: clamp(50px, 9vh, 64px); background: #fff !important; color: #000 !important; border-radius: 50%; }
.npf-play svg { width: clamp(28px, 5vh, 36px) !important; height: clamp(28px, 5vh, 36px) !important; }
.npf-play:active { transform: scale(0.95); }
#npf-footer { display: flex; align-items: center; justify-content: center; gap: 40px; width: 100%; max-width: 340px; margin-top: auto; padding-bottom: 4px; flex-shrink: 0; }
.npf-footer-btn { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; padding: 8px; border-radius: 50%; transition: color 0.2s; }
.npf-footer-btn:hover { color: #fff; }
.npf-footer-btn.active { color: var(--accent-color); }
.autodj-chip { display: flex; align-items: center; background: var(--accent-color); color: #fff; padding: 4px 10px; border-radius: 16px; font-size: 0.85rem; font-weight: 500; }
.autodj-chip-close { margin-left: 6px; cursor: pointer; opacity: 0.7; font-weight: bold; padding: 0 2px; }
.autodj-chip-close:hover { opacity: 1; }
.btn-close-mini {
    margin-left: auto; 
    background: transparent;
    border: none;
    color: #666;    
    cursor: pointer;
    padding: 2px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-close-mini:hover {
    color: #fff;     
    background: rgba(255, 255, 255, 0.1); 
}

@media (min-width: 768px) {
    #np-fullscreen { display: none !important; }
}

@media (min-width: 1200px) {
    .navbar-inner { padding: 10px 24px; gap: 18px; }
    .search-pill { height: 48px !important; padding: 0 22px; gap: 12px; width: 560px; max-width: 560px; }
    .search-pill-input { font-size: 1rem; }
    .search-pill-icon { width: 20px; height: 20px; }
    .nav-logo { font-size: 1.2rem; }
}
@media (min-width: 1600px) {
    .navbar-inner { padding: 10px 28px; gap: 20px; }
    .search-pill { height: 50px !important; padding: 0 24px; gap: 14px; width: 680px; max-width: 680px; }
    .search-pill-input { font-size: 1.05rem; }
    .search-pill-icon { width: 22px; height: 22px; }
    .nav-logo { font-size: 1.25rem; }
}

/* --- TABS ROW --- */
.nav-tabs-row { padding: 0 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav-tabs-row::-webkit-scrollbar { display: none; }
.top-nav-tabs { margin: 0; display: flex; flex-wrap: nowrap !important; list-style: none; padding-left: 0; align-items: center; height: 100%; white-space: nowrap; }
.top-nav-tabs .nav-link { color: #808080; border: none; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.8px; transition: color 0.2s; background: transparent; white-space: nowrap; position: relative; }
@media (hover: hover) {
    .top-nav-tabs .nav-link:hover { color: #fff; }
    .top-nav-tabs .nav-link-fav:hover { color: #e6b84d !important; }
}
.top-nav-tabs .nav-link.active { color: #fff; }
.top-nav-tabs .nav-link-fav { color: #b08d57 !important; }
.top-nav-tabs .nav-link-fav.active { color: #e6b84d !important; }

/* --- BREADCRUMBS --- */
#breadcrumbs { padding: 15px 20px 5px 20px; font-size: 0.85rem; color: #b3b3b3; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; -webkit-overflow-scrolling: touch; }
#breadcrumbs::-webkit-scrollbar { display: none; }
.bc-link, .link-hover { color: #b3b3b3; text-decoration: none; transition: color 0.2s; cursor: pointer; flex-shrink: 0; }
.bc-link:hover, .link-hover:hover { color: #fff !important; text-decoration: underline; }
.bc-separator { color: #5a5a5a; font-weight: bold; flex-shrink: 0; }
#breadcrumbs > span { flex-shrink: 0; }

/* --- MAIN LAYOUT --- */
#main-container { flex: 1; display: flex; overflow: hidden; padding: 0 15px 15px 15px; background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%); position: relative; }
.view-container { flex: 1; overflow-y: auto; overflow-x: hidden; display: none; padding: 0 10px; min-width: 0; }
.view-container.active { display: block; }

/* =======================================================
   CARTES DE GENRES (Dégradés Dynamiques)
   ======================================================= */
.grid-card.genre-card .grid-cover {
    display: none !important; /* On cache l'image par défaut */
}

.genre-gradient-box {
    display: flex;
    width: 100%;
    aspect-ratio: 16 / 10; /* Format rectangulaire (paysage) */
    box-sizing: border-box; /* Force le dégradé à prendre 100% de la carte */
    border-radius: 8px; /* Coins légèrement arrondis, plus chic */
    padding: 12px 14px; /* Espace intérieur pour que le texte ne touche pas les bords */
    
    /* Position du texte : En bas à gauche */
    align-items: flex-end; 
    justify-content: flex-start; 
    
    /* Style du texte */
    color: white;
    font-size: 1rem; /* Texte beaucoup plus discret */
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: capitalize; /* Juste la première lettre en majuscule */
    
    /* Esthétique (Ombres douces) */
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    text-shadow: 0 2px 6px rgba(0,0,0,0.6); /* Rend le texte lisible sur les couleurs claires */
}

/* On cache le gros titre en dessous (puisqu'il est dans la boîte) */
.grid-card.genre-card .grid-title {
    display: none; 
}

/* On garde les petites infos (titres/albums) bien alignées en dessous */
.grid-card.genre-card .grid-sub {
    margin-top: 8px;
    font-size: 0.85rem;
    text-align: left; /* Aligné avec le texte de la boîte */
}

/* =======================================================
   ANIMATION DU TEXTE DES GENRES (Glissement + Réduction)
   ======================================================= */

/* 1. On prépare la transition fluide pour la position ET la taille du texte */
.genre-gradient-box {
    transition: padding-bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                font-size 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 2. Au survol (PC) : Le texte remonte ET rétrécit */
.grid-card.genre-card:hover .genre-gradient-box {
    padding-bottom: 50px !important; /* Laisse la place aux boutons en bas */
    font-size: 0.80rem !important;   /* Le texte devient plus discret */
}

/* 3. Sur Mobile (< 767.98px) : État fixe permanent */
@media (max-width: 767.98px) {
    .grid-card.genre-card .genre-gradient-box {
        padding-bottom: 50px !important; /* Fixé en hauteur pour ne pas toucher les boutons */
        font-size: 0.70rem !important;   /* Fixé en petite taille */
    }
}

/* =======================================================
   VUE ARTISTE DÉTAILLÉE
   ======================================================= */
#view-artist-detail { position: relative; }
#view-artist-detail > * { position: relative; z-index: 1; } /* Laisse le fond flouté en dessous */
#view-artist-detail .grid-card { background-color: rgba(0,0,0, 0.2); }

#artist-header { 
    display: flex; align-items: flex-end; gap: 24px; margin-bottom: 24px; padding: 20px 0; position: relative; z-index: 1; 
    animation: detailFade 0.4s ease-out;
}
#artist-header > div:last-child { min-width: 0; flex: 1; }

/* =======================================================
   COVER ARTISTE & ÉDITION ADMIN
   ======================================================= */
.artist-cover-container {
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4); /* Ombre douce et profonde */
}

#artist-cover { 
    width: 240px; 
    height: 240px;
    object-fit: cover; 
    object-position: center 20%; /* LA MAGIE : On centre à 20% du haut, pour garder les têtes ! */
    border-radius: 24px; 
}

/* L'overlay d'édition (Caché par défaut) */
.artist-edit-overlay {
    position: absolute; 
    inset: 0;
    background: rgba(0,0,0,0.6);
    border-radius: 24px; /* L'overlay épouse la même forme */
    display: flex; 
    align-items: center; 
    justify-content: center;
    opacity: 0; 
    transition: opacity 0.2s ease;
    cursor: pointer; 
    color: white;
}

/* La magie : l'overlay n'apparaît au survol QUE si on est Admin */
.artist-cover-container:hover .artist-edit-overlay {
    opacity: 1;
}
/* Si le body n'a pas la classe 'is-admin', on cache TOUS les éléments .admin-only */
body:not(.is-admin) .admin-only {
    display: none !important;
}

#artist-title { 
    font-size: 3rem; font-weight: 900; color: #fff; margin: 0 0 8px 0; 
    letter-spacing: -1px; line-height: 1.05; overflow-wrap: break-word; word-break: break-word; 
}

#view-artist-detail .track-list-header {
    background-color: transparent;
}

/* Adaptation pour Mobile */
@media (max-width: 767.98px) {
    #artist-cover, .artist-edit-overlay { border-radius: 16px; }
    #artist-header { flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 10px 0; margin-bottom: 5px; }
    #artist-header > div:last-child { width: 100%; }
    #artist-cover { width: 200px; height: 200px; }
    #artist-title { font-size: 1.6rem; }
    #artist-meta { text-align: center; }
}

@media (max-width: 374.98px) {
    #artist-cover { width: 160px; height: 160px; }
    #artist-title { font-size: 1.3rem; }
}

.queue-overlay { display:none; position: fixed; z-index: 20; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
@media (max-width: 1199.98px) {
    .queue-overlay.active { display:block; visibility: visible; opacity: 1; pointer-events: all; }
}
.border-secondary { border-color: rgba(255,255,255,.1) !important;}
.app-modal-content .border-secondary { border-color: rgba(255,255,255,.3) !important;}

/* =================================================================
   ANIMATIONS DES PANNEAUX 
   ================================================================= */

/* 1. Le Panneau Central */
#library-panel { 
    flex: 3; display: flex; flex-direction: column; overflow: hidden; 
    border-radius: 8px; min-width: 0; position: relative; z-index: 1; 
    /* La transition écoute le changement de taille (flex) sur PC et le glissement (transform) sur Mobile */
    transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: flex, transform;
}

/* 2. Le Panneau Playlist (État Ouvert par défaut) */
#playlist-panel { 
    flex: 0 0 320px; min-width: 320px; display: flex; flex-direction: column; 
    overflow: hidden; border-radius: 8px; border: 1px solid #262626; 
    background-color: #000; margin-top: 15px; padding: 15px; 
    transform-origin: right center; z-index: 100; 
    /* La transition anime toutes les dimensions pour un écrasement parfait */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                flex 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s ease-out,
                border-width 0.2s ease-out;
    will-change: flex, transform, min-width;
    overscroll-behavior-y: contain !important;
}

body.queue-visible #main-container {
    gap: 15px;
}

@media (min-width: 1199.98px) {
    #playlist-panel.collapsed { 
        display: flex; 
        flex: 0 0 0px; 
        min-width: 0; 
        padding-left: 0; 
        padding-right: 0; 
        margin-left: 0; 
        margin-right: 0; 
        border-width: 0; 
        opacity: 0; 
        transform: translateX(30px); 
        pointer-events: none; 
    }
}

@media (max-width: 1199.98px) {
    #playlist-panel { position: fixed !important; will-change: transform; top: 0; right: 0; bottom: 111px; width: 320px; min-width: 320px; flex: none; z-index: 100; border-right: none; border-radius: 10px 0 0 10px; box-shadow: -8px 0 30px rgba(0,0,0,0.5); transform: translateX(0); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, visibility 0.3s; visibility: visible; }
    #playlist-panel.collapsed { transform: translateX(110%); opacity: 0; pointer-events: none; overflow: hidden; visibility: hidden; padding: 15px; min-width: 320px; margin-left: 0; }
}

/* =================================================================
   ⚡ PROTECTION ANTI-ACCROCHE MOBILE (Swipe & Gap)
   ================================================================= */

@media (max-width: 1199.98px) {
    /* 1. Interdit au navigateur de faire glisser le fond de gauche à droite à tout moment */
    #library-panel, #main-container, .az-index {
        touch-action: pan-y !important; /* Autorise le scroll de haut en bas UNIQUEMENT */
        overscroll-behavior-x: none !important;
    }

    /* 2. Quand la file est ouverte, on fige totalement le fond pour qu'il n'accroche plus le doigt */
    body.queue-visible #library-panel,
    body.queue-visible .nav-tabs-row,
    body.queue-visible .az-index  {
        pointer-events: none !important;
    }

    /* 3. On force l'overlay sombre à agir comme un mur qui absorbe les gestes errants (dont le gap de 15px) */
    .queue-overlay.active {
        pointer-events: all !important;
        touch-action: none !important; /* Bloque tout swipe système sur l'ombre */
    }
    
    /* 4. On supprime les marges fantômes qui pourraient traîner sur le panneau mobile */
    #playlist-panel {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

#tracks-body, 
#view-grid {
    width: calc(100% - 10px); 
}

.az-index {
    position: fixed; 
    right: 2px;
    top: 150px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 80;
    font-size: 11px; 
    font-weight: bold;
    font-family: sans-serif;
    user-select: none;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: right; 
}

.az-index span {
    padding: 3px 5px;
    color: #888;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, color 0.2s ease; 
}

.az-index span:active {
    color: var(--accent-color); 
    transform: scale(1.3);
}

@media (hover: hover) {
    .az-index span:hover {
        color: var(--accent-color); 
        transform: scale(1.3);
    }
}

.az-index.mt-track { top: 240px;  }

body.queue-visible .az-index {
    right: 338px;     
}

@media (max-width: 1199.98px) {
    .az-index { top: 144px;  }
    .az-index.mt-track { top: 235px;  }
    body.queue-visible .az-index {
        right: 2px; 
        transition: none;
        will-change: none;
    }
}

@media (max-width: 899.98px) {  
    .az-index { top: 144px;  }
    .az-index.mt-track { top: 235px;  }
}

@media (max-width: 767.98px) {
    .az-index { right: 1px; top: 124px; bottom: 70px; }
    .az-index.mt-track { top: 215px; }
    #tracks-body, 
    #view-grid {
        width: calc(100% - 16px); 
    }
}

@media (max-width: 374.98px) {
    .az-index { right: 1px; top: 117px;  }
    .az-index.mt-track { top: 203px; }
    #tracks-body, 
    #view-grid {
        width: calc(100% - 18px); 
    }
}

/* Animation de fondu pour les mises à jour de vues */
#view-favorites {
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
}

/* Quand cette classe est ajoutée, la vue devient invisible mais garde sa taille */
#view-grid.is-updating, #view-favorites.is-updating {
    opacity: 0;
}

/* --- CONTEXT MENUS --- */
.custom-context-menu { position: absolute; z-index: 3000; background-color: #1e1e1e; border-radius: 10px; padding: 6px; min-width: 210px; box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06); opacity: 0; visibility: hidden; }
.custom-context-menu.active { opacity: 1; visibility: visible; }
.custom-context-menu a { cursor: pointer; color: #b3b3b3 !important; gap: 8px; padding: 10px 14px; text-decoration: none; display: flex; align-items: center; font-size: 0.85rem; border-radius: 6px; transition: background 0.15s; }
.custom-context-menu a svg { fill: currentColor; }
.custom-context-menu a:hover { background-color: rgba(255,255,255,0.08); color: #fff !important; }
.custom-context-menu a.logout { gap: 8px; color: #ff4d4d !important; }
.custom-context-menu a.logout:hover { background: rgba(255,77,77,0.1); }

/* --- TRACK ROWS --- */
.track-list-header { display: flex; align-items: center; padding: 8px 8px 10px 8px; position: sticky; top: 0; background-color: rgba(22, 22, 22, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 5; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1.2px; color: #808080; }
#view-detail .track-list-header { background-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.track-list-header .th-num { width: 40px; text-align: center; flex-shrink: 0; }
.track-list-header .th-cover { width: 50px; flex-shrink: 0; }
.track-list-header .th-title { flex: 1; min-width: 0; }
.track-list-header .th-album { width: 25%; flex-shrink: 0; }
.track-list-header .th-year { width: 60px; flex-shrink: 0; }
.track-list-header .th-duration { width: 60px; text-align: right; flex-shrink: 0; }
.track-list-header .th-actions { width: 60px; flex-shrink: 0; }

.tracks-body { flex: 1; overflow-y: auto; padding-bottom: 20px; }

.track-row { display: flex; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; transition: background 0.15s; animation: fadeIn 0.25s ease-out backwards; content-visibility: auto; contain-intrinsic-size: 52.8px; }
.track-row:hover { background-color: rgba(255,255,255,0.06); }
.track-row .tr-num { width: 40px; text-align: center; flex-shrink: 0; color: #808080; }
.track-row .tr-cover { width: 50px; flex-shrink: 0; padding-right: 8px; }
.track-row .tr-info { flex: 1; min-width: 0; overflow: hidden; }
.track-row .tr-album { width: 25%; flex-shrink: 0; min-width: 0; overflow: hidden; }
.track-row .tr-year { width: 60px; flex-shrink: 0; color: #808080; font-size: 0.85rem; }
.track-row .tr-duration { width: 60px; text-align: right; flex-shrink: 0; color: #808080; font-size: 0.85rem; }
.track-row .tr-actions { display: flex; justify-content: end; width: 40px; text-align: center; flex-shrink: 0; }

@media (hover: hover) {
    .track-row:hover .track-num { display: none; }
    .track-row:hover .track-play-icon { display: block; }
    .track-row.playing:hover .track-eq-icon { display: none; }
    .track-row.playing:hover .track-play-icon { display: block; color: var(--accent-color); }
}
.track-row.playing .track-num { display: none; }
.track-row.playing .track-eq-icon { display: flex; }
.track-row.playing .track-title { color: var(--accent-color) !important; }
.cover-sm { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.text-light { color: #fff !important; }
.track-num-wrapper { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 24px; }
.track-num { font-size: 0.85rem; }
.track-play-icon { display: none; color: #fff; }
.track-eq-icon { display: none; }
.btn-options, .queue-header-btn { 
    background: none;
    color: #b6b6b6;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}
.btn-options:hover, .queue-header-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
@media (hover: hover) {
    .btn-options { opacity: 0; }
    .track-row:hover .btn-options, .queue-item:hover .btn-options { opacity: 1; }
}
.btn-options:hover { color: #fff !important; transform: scale(1.1); }

/* --- GRID CARDS --- */
.grid-container { display: grid; grid-template-columns: repeat(8, 1fr); gap: 20px; padding: 20px 0; min-width: 0; }
@media (min-width: 1699.99px) {
    body.queue-visible .grid-container { grid-template-columns: repeat(7, 1fr); }
}
@media (min-width: 1199.98px) {
    body.queue-visible #btn-back-to-top { right: 375px; }
}

@media (max-width: 1699.98px) { .grid-container { grid-template-columns: repeat(6, 1fr); gap: 18px; } }
@media (max-width: 1399.98px) { .grid-container { grid-template-columns: repeat(5, 1fr); gap: 16px; } }
@media (max-width: 1099.98px) { .grid-container { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (max-width: 899.98px) { .grid-container { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 599.98px) { .grid-container { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

@media (min-width: 1399.99px) and (max-width: 1699.98px) {
    body.queue-visible .grid-container { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1199.98px) and (max-width: 1399.98px) {
    body.queue-visible .grid-container { grid-template-columns: repeat(4, 1fr); }
}

.grid-card { position: relative; background: #161616; border-radius: 10px; padding: 14px; cursor: pointer; min-width: 0; overflow: hidden; content-visibility: auto; contain-intrinsic-size: 250px; }
.grid-cover-wrapper { position: relative; margin-bottom: 14px; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.5); background: #1a1a1a; cursor: default; }
.grid-cover { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 20%; display: block; cursor: pointer; }
.grid-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px; display: flex; justify-content: space-between; align-items: flex-end; opacity: 1; pointer-events: auto; transition: opacity 0.2s; background: linear-gradient(transparent, rgba(0,0,0,0.8)); }

@media (hover: hover) {
    .grid-overlay { opacity: 0; pointer-events: none; }
    .grid-card:hover .grid-overlay { opacity: 1; pointer-events: auto; }
}
.grid-overlay-right { display: flex; gap: 8px; align-items: center; }
.btn-grid-play, .btn-grid-fav, .btn-grid-options { background: rgba(0,0,0,0.6); border: none; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(4px); width: 32px; height: 32px; padding: 6px; }
.btn-grid-play { background: var(--accent-color); }
.btn-grid-play:hover { background: var(--accent-color); filter: brightness(1.2); transform: scale(1.1); color: #fff; }
.btn-grid-fav:hover, .btn-grid-options:hover { background: rgba(0,0,0,0.9); transform: scale(1.1); color: var(--accent-color); }
.grid-title { font-weight: 700; font-size: 0.95rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.grid-sub { font-size: 0.8rem; color: #808080; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 10; }

/* --- DETAIL VIEW --- */
#detail-bg-wrapper { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; }
#detail-bg-wrapper.active { opacity: 1; }
#detail-bg-img { position: absolute; top: -100px; left: -100px; right: -100px; bottom: -100px; background-size: cover; background-position: center; filter: blur(80px) saturate(1.4) brightness(0.3); }
#view-detail { position: relative; }
#view-detail > * { position: relative; z-index: 1; }
#detail-header { display: flex; align-items: flex-end; gap: 24px; margin-bottom: 24px; padding: 20px 0; position: relative; z-index: 1; }
#detail-header > div:last-child { min-width: 0; flex: 1; }
#detail-cover { width: 240px; height: 240px; object-fit: cover; border-radius: 6px; box-shadow: 0 4px 60px rgba(0,0,0,0.5); }
#detail-title { font-size: 3rem; font-weight: 900; color: #fff; margin: 0 0 8px 0; letter-spacing: -1px; line-height: 1.05; overflow-wrap: break-word; word-break: break-word; }
.detail-artist-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #b3b3b3; flex-wrap: wrap; }
.detail-actions { flex-wrap: wrap; }

.btn-play-detail { background-color: var(--accent-color); color: #fff; border: none; border-radius: 500px; padding: 12px 32px; cursor: pointer; transition: transform 0.2s, filter 0.2s; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; }
.btn-play-detail:hover { transform: scale(1.04); filter: brightness(1.15); color: #fff; }
.btn-label { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; }

.btn-outline-detail { background-color: rgba(255, 255, 255, 0.05); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 500px; padding: 12px 32px; cursor: pointer; transition: transform 0.2s, background-color 0.2s, border-color 0.2s; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; }
.btn-outline-detail:hover { transform: scale(1.04); background-color: rgba(255, 255, 255, 0.1); border-color: #fff; }

.btn-fav-detail { background: none; border: none; color: #b3b3b3; padding: 10px; cursor: pointer; transition: transform 0.2s, color 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-fav-detail:hover { transform: scale(1.1); color: #fff; }
.btn-fav-detail.active { color: var(--accent-color); }

/* --- PLAYER CONTROLS --- */
.controls { height: 96px; background-color: #000; border-top: 1px solid #262626; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; z-index: 1000; position: relative; overflow: visible; }
.now-playing { width: 30%; display: flex; padding: 2px 10px; align-items: center; gap: 14px; min-width: 0; }
.np-cover { max-height: 80px; object-fit: cover; flex-shrink: 0; }
.np-title { color: #fff; font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.np-artist { color: #b3b3b3; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-album { color: #666; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-info { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.np-text { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.np-actions { display: none; flex-direction: column; gap: 2px; flex-shrink: 0; }
.now-playing.has-track .np-actions { display: flex; }
.np-action-btn { background: none; border: none; color: #666; cursor: pointer; padding: 3px; border-radius: 50%; transition: color 0.2s, background 0.2s, transform 0.15s; display: flex; align-items: center; justify-content: center; }
.np-action-btn:hover { color: #fff; background: rgba(255,255,255,0.08); transform: scale(1.1); }
.np-action-btn.active { color: var(--accent-color); }

.player-center { width: 40%; max-width: 722px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 20px; }
.player-buttons { display: flex; align-items: center; gap: 28px; margin-bottom: 8px; }
.control-btn { background: none; border: none; color: #b3b3b3; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; transition: color 0.2s, transform 0.2s; }
.control-btn:hover { color: #fff; }
.control-btn.active { color: var(--accent-color); }
.btn-play { position: relative; width: 44px; height: 44px; border-radius: 50%; background-color: #fff; color: #000; transition: transform 0.2s; }
.btn-play:hover { transform: scale(1.06); color: #000; background-color: #fff; }
.btn-play.loading::before { content: ''; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 0.8s linear infinite; pointer-events: none; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.progress-container { width: 100%; display: flex; align-items: center; gap: 8px; font-size: 0.7rem; color: #a7a7a7; }
#progress-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 4px; background: #535353; border-radius: 2px; outline: none; transition: height 0.1s; cursor: pointer; margin: 0; }
input[type=range]:hover { height: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #fff; border-radius: 50%; opacity: 0; transition: opacity 0.1s; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.progress-container:hover input[type=range]::-webkit-slider-thumb, .volume-slider-wrapper:hover input[type=range]::-webkit-slider-thumb { opacity: 1; }
#progress-tooltip { position: absolute; bottom: 20px; background-color: #282828; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.5); pointer-events: none; opacity: 0; transition: opacity 0.2s; white-space: nowrap; transform: translateX(-50%); z-index: 1100; }
#progress-wrapper:hover #progress-tooltip { opacity: 1; }

.right-controls { width: 30%; display: flex; justify-content: flex-end; align-items: center; gap: 22px; padding-right: 16px; }
.volume-container { position: relative; display: flex; align-items: center; justify-content: center; height: 100%; padding: 10px 0; z-index: 1100; }
.volume-slider-wrapper { position: absolute; bottom: 45px; left: 50%; transform: translateX(-50%); background: #1e1e1e; border: 1px solid #333; border-radius: 10px; width: 36px; height: 130px; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s, bottom 0.2s; z-index: 2000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.volume-container:hover .volume-slider-wrapper { opacity: 1; visibility: visible; bottom: calc(100% + 10px); }
.volume-slider-wrapper input[type=range] { transform: rotate(-90deg); width: 100px; height: 4px; margin: 0; }

/* --- QUEUE PANEL --- */
.queue-header { font-weight: 700; color: #fff; margin-bottom: 5px; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; white-space: nowrap; }
.queue-header-actions { display: flex; align-items: center; gap: 4px; }
.queue-section-title { font-size: 0.9rem; font-weight: 700; color: #fff; padding: 15px 8px 5px 8px; white-space: nowrap; }
.playlist-container { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain !important; }
.queue-item { padding: 8px; border-radius: 6px; display: flex; align-items: center; gap: 12px; cursor: grab; transition: background 0.15s; position: relative; content-visibility: auto; contain-intrinsic-size: 56px; }
.queue-item:hover { background: rgba(255,255,255,0.06); }
.queue-item:active { cursor: grabbing; }
.queue-item.playing .queue-title { color: var(--accent-color); }
.queue-title { font-size: 0.85rem; color: #fff; font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-artist { font-size: 0.75rem; color: #b3b3b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drag-over { box-shadow: 0 -2px 0 var(--accent-color); z-index: 10; }
.queue-cover-wrapper { position: relative; width: 40px; height: 40px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: #1a1a1a; }
.queue-cover { width: 100%; height: 100%; object-fit: cover; }
.queue-overlay-np { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.queue-item.playing .queue-overlay-np { opacity: 1; background: rgba(0,0,0,0.4); }
.queue-item.playing:hover .queue-overlay-np { background: rgba(0,0,0,0.7); }
.queue-item:not(.playing):hover .queue-overlay-np { opacity: 1; }
.icon-play { display: none; color: #fff; }
.queue-item:not(.playing):hover .icon-play, .queue-item.playing:hover .icon-play { display: block; }

/* --- EQ ANIMATION --- */
.icon-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.queue-item.playing .icon-eq { display: flex; }
.queue-item.playing:hover .icon-eq { display: none; }
.eq-bar { width: 3px; background-color: var(--accent-color); border-radius: 1px; animation: eq-bounce 0.5s infinite alternate ease-in-out; }
.eq-bar-1 { height: 60%; animation-delay: 0.0s; }
.eq-bar-2 { height: 100%; animation-delay: 0.2s; }
.eq-bar-3 { height: 80%; animation-delay: 0.4s; }
@keyframes eq-bounce { 0% { height: 20%; } 100% { height: 100%; } }
body.is-paused .eq-bar { animation-play-state: paused !important; height: 3px !important; }

/* Chromecast Launcher */
google-cast-launcher {
    --connected-color: var(--accent-color);
    --disconnected-color: #b3b3b3;
    width: 24px !important; 
    height: 24px !important; 
    max-width: 24px; 
    max-height: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}
google-cast-launcher:hover { transform: scale(1.1); }
#cast-wrapper { width: 24px; height: 24px; display: none; }

#edit-cover-container { display:none; justify-content:center; margin-bottom:20px; }
#edit-cover-preview { width: 150px; height: 150px; border-radius: 8px; object-fit: cover; box-shadow: 0 4px 15px rgba(0,0,0,0.5); border: 2px solid #222; }

/* --- SETTINGS PAGE --- */
.settings-card { background-color: #161616; border-radius: 10px; padding: 24px; margin-bottom: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid #1a1a1a; }
.settings-card label { font-weight: 600; color: #fff; margin-bottom: 8px; display: block; }
.settings-card .form-control, .settings-card .form-select { background-color: #1e1e1e; border: 1px solid #333 !important; color: #fff; border-radius: 6px; }
.settings-card .form-control:focus, .settings-card .form-select:focus { border-color: var(--accent-color); box-shadow: none; }
.settings-card .form-text { color: #a7a7a7; font-size: 0.8rem; margin-top: 6px; }
.btn-save, .btn-cancel { display: inline-flex; align-items: center; gap: 8px; color: #fff; border: none; padding: 12px 28px; border-radius: 8px; font-size: 0.88rem; font-weight: 600 !important; cursor: pointer; transition: filter 0.2s, transform 0.15s; }
.btn-save { background: var(--accent-color); }
.btn-save:hover, .btn-cancel:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-save:active, .btn-save:focus { transform: translateY(0); }
.btn-cancel { background-color: rgba(255, 255, 255, 0.1); }
.btn-primary { background: var(--accent-color); color: #fff; border: none; padding: 12px 28px; border-radius: 8px; font-size: 0.88rem; text-align: center; font-weight: 600 !important; transition: filter 0.2s, transform 0.15s; }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); background: var(--accent-color); }
.btn-primary:active, .btn-primary:focus { background: var(--accent-color) !important; transform: translateY(0); }

/* Settings Dropdown */
.settings-dropdown { position: relative; }
.settings-dropdown-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; background: #1e1e1e; border: 1px solid #333; color: #fff; border-radius: 6px; padding: 7px 12px; font-size: 0.88rem; cursor: pointer; transition: border-color 0.2s; text-align: left; }
.settings-dropdown-btn:hover { border-color: #555; }
.settings-dropdown.open .settings-dropdown-btn { border-color: var(--accent-color); }
.settings-dropdown-btn svg { color: #808080; transition: transform 0.2s; flex-shrink: 0; }
.settings-dropdown.open .settings-dropdown-btn svg { transform: rotate(180deg); }
.settings-dropdown-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #1e1e1e; border-radius: 10px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06); z-index: 3000; display: none; animation: menuPop 0.15s ease-out; max-height: 220px; overflow-y: auto; }
.settings-dropdown.open .settings-dropdown-menu { display: block; }
.settings-dropdown-option { display: block; padding: 9px 14px; color: #ccc; font-size: 0.84rem; border-radius: 6px; cursor: pointer; transition: background 0.15s, color 0.15s; text-decoration: none; }
.settings-dropdown-option:hover { background: rgba(255,255,255,0.08); color: #fff; }
.settings-dropdown-option.active { color: var(--accent-color); font-weight: 600; }
.settings-dropdown-option.active::before { content: ''; display: inline-block; width: 4px; height: 4px; background: var(--accent-color); border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* =========================================
   SLIDER 100% DIV
   ========================================= */

/* Le conteneur (la zone cliquable, un peu plus haute pour les gros doigts) */
.div-slider-container {
    width: 100%;
    height: 30px; /* Zone tactile confortable */
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin: 5px 0;
}

/* La piste grise de fond */
.div-slider-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    position: relative;
}

/* La partie remplie avec ta couleur */
.div-slider-fill {
    height: 100%;
    background: var(--accent-color, #1db954);
    border-radius: 3px;
    width: 50%; /* Sera modifié par le JS */
    pointer-events: none; /* Laisse les clics passer au conteneur */
}

/* Le fameux Thumb (rond) ! Centré parfaitement avec transform */
.div-slider-thumb {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%; /* Sera modifié par le JS */
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: transform 0.1s;
}

/* Petit effet quand on appuie dessus */
.div-slider-container:active .div-slider-thumb {
    transform: translate(-50%, -50%) scale(1.1);
}

/* =========================================
   ÉTAT DÉSACTIVÉ
   ========================================= */
.div-slider-container.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.div-slider-container.disabled .div-slider-fill {
    background: #666;
}
.div-slider-container.disabled .div-slider-thumb {
    background: #ccc;
    box-shadow: none;
}

/* --- BACK TO TOP --- */
#btn-back-to-top { position: fixed; bottom: 120px; right: 40px; width: 46px; height: 46px; border-radius: 50%; background-color: var(--accent-color); color: #fff; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.5); cursor: pointer; z-index: 90; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
#btn-back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#btn-back-to-top:hover { transform: translateY(-4px); filter: brightness(1.15); }
@media (max-width: 767.98px) { #btn-back-to-top { bottom: 130px; right: 20px; width: 40px; height: 40px; } }

/* --- TOAST NOTIFICATIONS --- */
#toast-container { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%); z-index: 5000; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.app-toast { background: #282828; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06); pointer-events: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; animation: toastIn 0.3s ease-out; }
.app-toast.out { animation: toastOut 0.25s ease-in forwards; }
.app-toast svg { flex-shrink: 0; }
.app-toast-success { border-left: 3px solid var(--accent-color); }
.app-toast-info { border-left: 3px solid #3B8BD4; }
.app-toast-warning { border-left: 3px solid #EF9F27; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-8px) scale(0.96); } }

@media (max-width: 767.98px) {
    #toast-container { bottom: auto; top: 12px; left: 12px; right: 12px; transform: none; flex-direction: column; }
    .app-toast { font-size: 0.8rem; padding: 8px 14px; }
}

/* --- AUTO-DJ --- */
.btn-autodj { position: relative; }
.btn-autodj.active { color: var(--accent-color); }
.btn-autodj.active::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--accent-color); border-radius: 50%; }
.autodj-badge { display: none; position: absolute; top: -2px; right: -4px; width: 8px; height: 8px; background: var(--accent-color); border-radius: 50%; border: 2px solid #0d0d0d; }
.btn-autodj.active .autodj-badge { display: block; }
.autodj-indicator { display: none; padding: 6px 12px; background: rgba(var(--accent-color-rgb, 29,185,84), 0.1); border: 1px solid rgba(var(--accent-color-rgb, 29,185,84), 0.2); border-radius: 8px; margin-bottom: 10px; font-size: 0.75rem; color: var(--accent-color); align-items: center; gap: 8px; }
.autodj-indicator.active { display: flex; }
.autodj-indicator svg { flex-shrink: 0; }
.queue-item.autodj-track { border-left: 2px solid var(--accent-color); padding-left: 6px; }
#autodj-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    z-index: 3001;
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    margin-top: 4px;
}
.autodj-dropdown-opt {
    padding: 10px 12px;
    cursor: pointer;
    color: #ccc;
    transition: background 0.2s;
}
.autodj-dropdown-opt:hover {
    background: rgba(255,255,255,0.1);
}
/* ================================================================
   MODALE AUTO-DJ
   ================================================================ */

.modal-subtitle {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.autodj-stats {
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-weight: 500;
    min-height: 20px;
}

/* Le faux champ de texte qui contient les puces (chips) */
.autodj-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: text;
    min-height: 42px;
    align-items: center;
}

.autodj-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Le vrai champ de saisie invisible */
.autodj-input-field {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    flex-grow: 1;
    min-width: 120px;
    padding: 4px;
}

/* La zone de la case à cocher "Mode Strict" */
.autodj-strict-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autodj-checkbox {
    accent-color: var(--accent-color);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.autodj-checkbox-label {
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    margin: 0;
}

/* Utilitaire rapide si tu ne l'as pas déjà */
.position-relative {
    position: relative;
}
.mt-4 {
    margin-top: 24px;
}
/* Flexbox pour les éléments de la file d'attente */
.queue-item-inner {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex: 1; 
    overflow: hidden; 
    pointer-events: none;
}
.queue-item-text {
    flex: 1; 
    overflow: hidden;
}

/* Textes et icônes colorés pour l'Auto-DJ dans la file */
.queue-autodj-text {
    color: var(--accent-color);
}
.queue-icon-mr {
    margin-right: 6px; 
    margin-bottom: 1px;
}

/* ================================================================
   ANIMATIONS & TRANSITIONS
   ================================================================ */
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.grid-card { animation: fadeSlideUp 0.35s ease-out backwards; }
.grid-card:nth-child(1) { animation-delay: 0s; }
.grid-card:nth-child(2) { animation-delay: 0.03s; }
.grid-card:nth-child(3) { animation-delay: 0.06s; }
.grid-card:nth-child(4) { animation-delay: 0.09s; }
.grid-card:nth-child(5) { animation-delay: 0.12s; }
.grid-card:nth-child(6) { animation-delay: 0.15s; }
.grid-card:nth-child(7) { animation-delay: 0.18s; }
.grid-card:nth-child(8) { animation-delay: 0.21s; }
.grid-card:nth-child(n+9) { animation-delay: 0.24s; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.grid-cover, .cover-sm, .np-cover, .queue-cover { transition: opacity 0.3s ease; -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; }
.lazy-img { opacity: 0.4; transition: opacity 0.3s ease; }
.lazy-img[src]:not([data-src]) { opacity: 1; }

@media (hover: hover) {
    .grid-card { transition: background 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease; }
    .grid-card:hover { background: #1e1e1e; transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
    
    .grid-overlay { transition: opacity 0.25s ease; }
    .btn-grid-play, .btn-grid-fav, .btn-grid-options { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
    .btn-grid-play, .btn-grid-fav, .btn-grid-options { transform: translateY(4px); opacity: 0; }
    .grid-card:hover .btn-grid-play, .grid-card:hover .btn-grid-fav, .grid-card:hover .btn-grid-options { transform: translateY(0); opacity: 1; }
    .grid-card:hover .btn-grid-play { transition-delay: 0s; }
    .grid-card:hover .btn-grid-fav { transition-delay: 0.04s; }
    .grid-card:hover .btn-grid-options { transition-delay: 0.08s; }
}

.queue-item { transition: background 0.15s ease, transform 0.15s ease; }
.queue-item:hover { transform: translateX(2px); }

@keyframes coverPop { 0% { transform: scale(0.92); opacity: 0.6; } 60% { transform: scale(1.03); } 100% { transform: scale(1); opacity: 1; } }
.np-cover.pop { animation: coverPop 0.35s ease-out; }

.view-container { opacity: 0; transition: opacity 0.2s ease; }
.view-container.active { opacity: 1; }

#view-tracks.active { display: flex !important; flex-direction: column; overflow: hidden; padding: 0; height: 100%; }

.top-nav-tabs .nav-link::after { content: ''; position: absolute; bottom: 0; left: 50%; right: 50%; height: 2px; background-color: var(--accent-color); border-radius: 2px 2px 0 0; transition: left 0.25s ease, right 0.25s ease; }
.top-nav-tabs .nav-link.active::after { left: 16px; right: 16px; }

@keyframes detailFade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
#detail-header { animation: detailFade 0.4s ease-out; }

.progress-container:hover input[type=range] { filter: brightness(1.2); }

.custom-context-menu { transform-origin: top right; }
@keyframes menuPop { from { opacity: 0; transform: scale(0.95) translateY(-4px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.view-container h4 { padding: 0 10px;}
#view-tracks.view-container h4 { padding: 0 20px;}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */

@media (max-width: 1199.98px) {
    #main-container { position: relative; }
    #detail-header { gap: 16px; margin-bottom: 16px; }
    #detail-title { font-size: 2rem; }
}

/* =======================================================
   MENUS CONTEXTUELS : BOTTOM SHEET (Mobile Uniquement)
   ======================================================= */
.menu-drag-handle {
    display: none; 
}
.mobile-menu-overlay {
    opacity: 0;
    visibility: hidden;  
}
@media (max-width: 767.98px) {
    /* L'arrière-plan sombre */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px); /* Léger flou en arrière-plan */ 
        z-index: 99999; /* Juste en dessous du menu (100000) */
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Affichage de la poignée sur mobile */
    .menu-drag-handle {
        display: block;
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 5px;
        margin: 0 auto 15px auto;
        padding-bottom: 10px; 
    }

    .custom-context-menu {
        /* 1. On annule les coordonnées (X/Y) injectées par le Javascript */
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        bottom: 0 !important;
        
        /* 2. On prend toute la largeur et on limite la hauteur */
        width: 100% !important;
        max-height: 85vh; /* Laisse un peu de place en haut pour voir l'app */
        overflow-y: auto;
        
        /* 3. Design "App Native" */
        border-radius: 20px 20px 0 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) 16px !important;
        border: 1px solid rgba(255,255,255,0.05);
        border-bottom: none;
        
        /* 4. Préparation de l'effet Slide */
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
        opacity: 0;
        visibility: hidden;
        z-index: 100000 !important;
    }

    /* Quand le menu est affiché via la classe JS */
    .custom-context-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* 5. Agrandissement des zones de clic pour les "gros doigts" */
    .custom-context-menu a {
        padding: 14px 12px !important;
        font-size: 1.05rem !important;
        border-radius: 10px;
        display: flex;
        align-items: center;
        gap: 12px; /* Espace net entre l'icône et le texte */
    }

    /* Effet d'appui sur mobile */
    .custom-context-menu a:active {
        background: rgba(255, 255, 255, 0.1);
    }

    /* 6. Ajustements visuels des en-têtes et séparateurs */
    .custom-context-menu .cm-header-box {
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .custom-context-menu .cm-separator {
        margin: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}



@media (max-width: 767.98px) {
    .view-container h4 { font-size: 1.2rem; padding: 0 2px;}
    #view-tracks.view-container h4 { padding: 0 12px;}
    .navbar-inner { padding: 8px 12px; gap: 10px; }
    .nav-logo { flex: 0; }
    .nav-logo-text { display: none; }
    .nav-right-actions { flex: 0; }
    .search-pill { height: 38px; padding: 0 14px; max-width: none; width: auto; flex: 1 !important; }
    .search-pill-input { font-size: 0.88rem; }
    .nav-tabs-row { padding: 0 12px; }
    .top-nav-tabs .nav-link { padding: 10px; font-size: 0.78rem; letter-spacing: 0.6px; }
    
    .col-album, .col-year, .th-album, .th-year, .tr-album, .tr-year { display: none !important; }
    .track-title { max-width: none !important; }
    
    #detail-header { flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 10px 0; margin-bottom: 5px; }
    #detail-header > div:last-child { width: 100%; }
    .detail-artist-row { justify-content: center; }
    #detail-meta { text-align: center; }
    #detail-cover { width: 200px; height: 200px; }
    #detail-title { font-size: 1.6rem; }
    .detail-actions { justify-content: center; margin-bottom: 10px !important; }
    
    .btn-play-detail { padding: 0; border-radius: 50%; width: 48px; height: 48px; }
    .btn-play-detail svg { width: 22px; height: 22px; }
    .btn-play-detail .btn-label { display: none; }
    .btn-outline-detail { padding: 0; border-radius: 50%; width: 48px; height: 48px; }
    .btn-outline-detail svg { width: 22px; height: 22px; }
    .btn-outline-detail .btn-label { display: none; }
    
    .controls { height: auto; flex-wrap: wrap; padding: 0; gap: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
    .controls .progress-container { order: -1; width: 100%; padding: 0 12px; gap: 6px; height: 24px; border-bottom: 1px solid #1a1a1a; background: #0d0d0d; }
    .now-playing { width: auto; flex: 1; min-width: 0; padding: 4px 12px; gap: 10px; }
    .player-center { width: auto; flex: none; }
    .player-center .progress-container { display: none; }
    .player-buttons { margin-bottom: 0; gap: 16px; padding: 8px 6px 8px 0; }
    .player-buttons svg { width: 20px; height: 20px; }
    .player-buttons .btn-play svg { width: 22px; height: 22px; }
    .btn-play { width: 36px; height: 36px; }
    
    #btnShuffle, #btnRepeat, .btn-prev { display: none; }
    .np-cover { max-height: 64px; }
    .np-title { font-size: 0.82rem; }
    .np-artist { font-size: 0.72rem; }
    .np-text .link-hover { pointer-events: none !important; text-decoration: none !important; }    
    
    .right-controls { width: auto; padding-right: 8px; gap: 10px; }
    .volume-container { display: none; }
    
    #main-container { padding: 0 8px 8px 8px; gap: 8px; }
    .grid-card { padding: 10px; border-radius: 8px; }
    
    #playlist-panel { margin-top: 8px; bottom: 73px;}
    
    #breadcrumbs { padding: 10px 12px 4px 12px; font-size: 0.8rem; }
    .bc-link, #breadcrumbs > span { display: inline-block; vertical-align: middle; }
    
    .settings-card { padding: 16px; margin-bottom: 16px; }
    .settings-card .row { flex-direction: column; }
    .settings-card .col-md-6 { width: 100%; }
    .settings-card .d-flex.gap-2 { flex-direction: column; }
    .settings-card .d-flex.gap-3 { flex-direction: column; align-items: flex-start !important; }
    
    .np-album { font-size: 0.65rem; }
    .now-playing .np-actions { display: none !important; }

    /* 1. En-tête des Playlists */
    #my-playlists-container .p-3 {
        padding: 6px 8px !important;
    }
    #my-playlists-container strong.text-light {
        font-size: 0.85rem !important; /* Texte encore plus fin */
    }
    #my-playlists-container small {
        font-size: 0.7rem !important;
    }

    /* 2. Boutons d'action (Lire, Renommer, Supprimer) */
    #my-playlists-container .gap-3 {
        gap: 6px !important; /* Rapproche les boutons entre eux */
    }
    #my-playlists-container .gap-3 > button {
        width: 28px !important;
        height: 28px !important;
    }
    #my-playlists-container .gap-3 > button svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* 3. Lignes des titres dans l'accordéon */
    #my-playlists-container [id^="tracks-list-"] {
        padding: 4px !important; /* Moins de marge globale */
    }
    #my-playlists-container [id^="tracks-list-"] > div {
        padding: 4px !important;
        gap: 6px !important;
    }

    /* 4. Images de couverture ultra-réduites */
    #my-playlists-container [id^="tracks-list-"] img {
        width: 28px !important;
        height: 28px !important;
    }

    /* 5. Textes des titres */
    #my-playlists-container [id^="tracks-list-"] .fw-bold {
        font-size: 0.75rem !important; /* Garde le titre lisible mais petit */
    }
    #my-playlists-container [id^="tracks-list-"] .text-muted.text-truncate {
        font-size: 0.65rem !important;
    }

    /* 6. Checkbox et petits boutons (Play, Fav, Menu) */
    #my-playlists-container [id^="tracks-list-"] input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
    }
    #my-playlists-container [id^="tracks-list-"] .btn-sm svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* 7. Barre d'action en bas */
    #my-playlists-container .bottom-0 button {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
}

@media (max-width: 374.98px) {
    .view-container h4 { font-size: 1.1rem; padding: 0 4px;}
    #view-tracks.view-container h4 { padding: 0 8px;}
    .grid-container { gap: 10px; }
    .grid-card { padding: 8px; }
    .grid-title { font-size: 0.85rem; }
    .grid-sub { font-size: 0.72rem; }
    
    #detail-cover { width: 160px; height: 160px; }
    #detail-title { font-size: 1.3rem; }
    
    .player-buttons { gap: 12px; }
    .player-buttons svg { width: 18px; height: 18px; }
    .player-buttons .btn-play svg { width: 20px; height: 20px; }
    .btn-play { width: 34px; height: 34px; }
    .np-title { font-size: 0.78rem; }
    .np-artist { font-size: 0.68rem; }
    .np-album { display: none; }
    
    .top-nav-tabs .nav-link { padding: 9px 10px; font-size: 0.74rem; }
    
    .navbar-inner { padding: 6px 8px; gap: 8px; }
    .nav-tabs-row { padding: 0 8px; }
    .search-pill { height: 36px; padding: 0 12px; }
    #main-container { padding: 0 6px 6px 6px; }
    .view-container { padding: 0 4px; }
    #breadcrumbs { padding: 8px 8px 2px 8px; }
    
    .now-playing { padding: 4px 8px; gap: 8px; }
    .right-controls { padding-right: 6px; gap: 6px; }
    .controls .progress-container { padding: 0 8px; }
    
    .detail-actions { gap: 8px !important; }
    .btn-play-detail { width: 42px; height: 42px; }
    .btn-play-detail svg { width: 20px; height: 20px; }
    .btn-outline-detail { width: 42px; height: 42px; }
    .btn-outline-detail svg { width: 20px; height: 20px; }
    .btn-fav-detail { padding: 6px; }
    
    .track-row { padding: 4px 4px; contain-intrinsic-size: 48.8px;}
    .track-list-header { padding: 6px 4px 8px 4px; font-size: 0.7rem; }
    .cover-sm { width: 36px; height: 36px; }
}

/* Utilitaires d'affichage */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* Modales globales (Remplace les affichages en dur) */
.app-modal {
    display: none; /* Caché par défaut */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 9999;
    justify-content: center; align-items: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}
.app-modal.active { display: flex; } /* La classe gérée par le JS ! */

/* Conteneurs internes des modales */
.app-modal-content {
    position: relative;
    background: #1e1e1e;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
    max-height: 90vh;
    overflow-y: auto;
}
.app-modal-content.large { max-width: 600px; }
.app-modal-content.login { max-width: 360px; padding: 30px; }

.app-modal-content.visible-overflow { 
    overflow: visible; 
}
.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #888;     
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
    transition: all 0.2s ease;
    z-index: 10;   
}
.btn-close-modal:hover {
    color: #fff;    
    background: rgba(255, 255, 255, 0.1); 
    transform: scale(1.1); 
}
.btn-close-modal:active {
    transform: scale(0.95);
}

/* Menus contextuels */
.custom-context-menu.active { display: block; }
.cm-header-box {
    padding: 6px 10px 8px 10px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 6px;
}
.cm-img-container {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--accent-color);
    background: rgba(255,255,255,0.03);
    border-radius: 4px; overflow: hidden;
}
.cm-title-text {
    font-size: 1rem; font-weight: 500; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 180px; line-height: 1.2;
}
.cm-separator { border-top: 1px solid #333; margin: 4px 0; }
.cm-item-hidden { display: none; } 
.cm-item-flex { display: flex; }

/* Barre de navigation (Profil Utilisateur) */
.logged-user-nav {
    font-size: 0.95rem; 
    font-weight: bold; 
    white-space: nowrap; 
    display: flex; 
    align-items: center; 
    gap: 6px;
}

/* Vue Détail (En-tête de l'album) */
.detail-subtitle {
    font-size: 0.85rem; 
    font-weight: bold; 
    text-transform: uppercase;
}
.detail-meta-text {
    font-size: 0.82rem; 
    color: #808080; 
    margin-top: 4px;
}

/* Grille (Priorité de clic par-dessus les autres éléments) */
.grid-link-z10 {
    position: relative; 
    z-index: 10;
}

/* Le chargeur Pull-to-refresh (Mobile) */
.ptr-loader {
    position: fixed; 
    top: 0; 
    left: 50%; 
    transform: translate(-50%, -60px); 
    z-index: 9999; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    background: #2a2a2a; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); 
    opacity: 0; 
    pointer-events: none;
}

/* Menu déroulant d'édition des Genres */
.genre-dropdown {
    display: none; 
    position: fixed; 
    background: #2a2a2a; 
    border: 1px solid #444; 
    border-radius: 6px; 
    max-height: min(200px, 30vh); 
    overflow-y: auto; 
    z-index: 999999; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}

/* Pop-up de sauvegarde "Édition en cours..." */
.persistent-loader {
    position: fixed; 
    bottom: 90px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: #2a2a2a; 
    border: 1px solid var(--accent-color); 
    color: #fff; 
    padding: 12px 24px; 
    border-radius: 30px; 
    z-index: 9999; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
    font-weight: 500; 
    text-wrap-mode: nowrap;
    display: flex; 
    align-items: center; 
    gap: 10px;
}
.persistent-loader svg {
    animation: spin 1s linear infinite;
}

/* Classes utilitaires réutilisables partout */
.text-accent { color: var(--accent-color) !important; }
.text-sm { font-size: 0.8rem !important; }

/* Styles spécifiques à la modale de connexion */
.auth-title {
    display: inline-flex;     
    align-items: center;         
    justify-content: center;    
    gap: 10px;                  
    color: #fff; 
    width: 100%;  
    text-align: left;
}
.auth-title svg {
    display: block;
    flex-shrink: 0;
    transform: translateY(+3px);
}
.auth-error {
    color: #ff4d4d; 
    text-align: center; 
    margin-bottom: 15px; 
    font-size: 0.9rem; 
    min-height: 20px;
}
.auth-input {
    background: rgba(255,255,255,0.05) !important; 
    color: #fff !important; 
    border: 1px solid #444 !important;
}
.auth-input:focus {
    border-color: var(--accent-color) !important;
}
.auth-btn {
    width: 100%; 
    margin-bottom: 15px; 
    padding: 10px; 
    font-weight: bold; 
    border: none;
}
.auth-footer-text {
    text-align: center; 
    font-size: 0.9rem; 
    color: #aaa;
}






