/* --- STYLE.CSS : MINIMALIST FUSION THEME (VERSION ROBUSTE) --- */

:root {
    /* --- Palette Minimaliste Harmonieuse --- */
    --bg-body: #f4f6f8;       /* Gris très pâle bleuté */
    --bg-card: #ffffff;       /* Blanc pur */
    --text-main: #2c3e50;     /* Bleu nuit sombre */
    --text-muted: #95a5a6;    /* Gris béton */
    
    /* Couleurs d'accentuation */
    --couleur-primaire: #2c3e50;
    --couleur-secondaire: #34495e;
    --couleur-survol: #3498db;    /* Bleu vif */
    
    /* Ombres teintées */
    --shadow-color: 44, 62, 80; 
    
    /* Surcharge Bootstrap */
    --bs-primary: #2c3e50;
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-main);
    
    /* Couleurs spécifiques aux listes (Mode Light) */
    --color-1001: #3498db;  /* Bleu Peter River */
    --color-rs500: #e74c3c; /* Rouge Alizarin */
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    padding-top: 90px;
}

a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}
a:hover { color: var(--couleur-survol); }

/* --- TITRES --- */
.page-title {
    font-size: clamp(1.5rem, 4vw + 0.5rem, 2rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
    color: var(--couleur-primaire);
}

.section-title {
    font-size: clamp(1.25rem, 3vw + 0.5rem, 1.75rem);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: ''; display: block; width: 40px; height: 3px;
    background-color: var(--couleur-survol);
    margin-top: 5px; border-radius: 2px;
}

/* --- NAVBAR --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.90) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
    padding-top: 0.8rem; padding-bottom: 0.8rem;
    transition: all 0.3s ease;
}
.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(var(--shadow-color), 0.05);
    padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.navbar-brand {
    font-size: 1.2rem; font-weight: 800;
    color: var(--couleur-primaire) !important; letter-spacing: -0.5px;
}
.navbar-nav .nav-link {
    color: #636e72 !important; font-weight: 600; font-size: 0.95rem;
    padding: 0.5rem 1rem !important; transition: all 0.2s ease;
}
.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--couleur-survol) !important;
    background-color: rgba(52, 152, 219, 0.08);
    border-radius: 8px;
}
.navbar-nav .nav-link::after { display: none; }

/* Dropdown Menu */
.dropdown-menu {
    border: none; border-radius: 12px; margin-top: 10px;
    box-shadow: 0 10px 40px rgba(var(--shadow-color), 0.1);
}
.dropdown-menu .dropdown-item {
    border-radius: 8px; padding: 0.6rem 1rem;
    color: var(--text-main); font-weight: 500;
}
.dropdown-menu .dropdown-item:hover {
    background-color: #f0f4f8; color: var(--couleur-survol);
}

/* --- FORMULAIRES --- */
.form-control, .form-select {
    background-color: #fff;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--text-main);
}
.form-control:focus, .form-select:focus {
    border-color: var(--couleur-survol);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}
#autocomplete { border-radius: 8px 0 0 8px; }

/* Liste autocomplétion */
#suggestions {
    z-index: 2000; border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 30px rgba(var(--shadow-color), 0.15);
    border: 1px solid #f0f0f0; overflow: hidden; background: white;
}

/* --- CARTE D'ALBUM --- */
.album-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.03);
    border-radius: 16px;
    box-shadow: 0 10px 20px -5px rgba(var(--shadow-color), 0.06);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    overflow: hidden;
}
.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(var(--shadow-color), 0.12);
    border-color: rgba(52, 152, 219, 0.2);
}
.album-card .card-body {
    padding: 0.6rem !important;
    text-align: left; flex-grow: 0 !important;
}
.album-card-title {
    font-weight: 700; font-size: 0.9rem; margin-bottom: 0.1rem;
    min-height: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.album-card-title a { color: var(--text-main); }
.album-card-title a:hover { color: var(--couleur-survol); }

.album-card-artist {
    margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.album-card-artist a {
    color: var(--text-muted); font-weight: 500; font-size: 0.8rem;
}
.album-card-footer {
    background: #fff; border-top: 1px solid #f4f6f8;
    padding: 0.4rem 0.6rem; font-size: 0.75rem;
}

/* --- SUGGESTIONS --- */
.suggestion-card {
    border: none; background: #fff; height: 100%;
    border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s; overflow: hidden;
}
.suggestion-card:hover {
    transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.suggestion-card .album-card-body {
    padding: 0.8rem; text-align: left;
}
.suggestion-card-artist { border-top: 3px solid var(--bs-primary); }
.suggestion-card-shared-styles { border-top: 3px solid var(--bs-info); }
.suggestion-card-graph-score { border-top: 3px solid var(--bs-success); }
.suggestion-card-genre { border-top: 3px solid var(--bs-secondary); }

/* --- BADGES --- */
.album-card-image-link { position: relative; display: block; }
.album-card-badges, .suggestion-reason-badge { 
    position: absolute; top: 8px; right: 8px; z-index: 10;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.suggestion-reason-badge { display: inline-block; }

.badge {
    font-size: 0.65em; font-weight: 700; padding: 0.4em 0.8em;
    border-radius: 6px; letter-spacing: 0.5px; text-transform: uppercase;
    backdrop-filter: blur(8px); box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.badge.bg-danger { background-color: rgba(255, 235, 238, 0.95) !important; color: #e74c3c !important; border: 1px solid rgba(231, 76, 60, 0.1); } 
.badge.bg-info { background-color: rgba(235, 245, 251, 0.95) !important; color: #3498db !important; border: 1px solid rgba(52, 152, 219, 0.1); }   
.badge.bg-success { background-color: rgba(233, 247, 239, 0.95) !important; color: #27ae60 !important; border: 1px solid rgba(39, 174, 96, 0.1); }
.badge.bg-primary { background-color: rgba(236, 240, 241, 0.95) !important; color: #2c3e50 !important; }
.badge.bg-secondary { background-color: rgba(245, 245, 245, 0.95) !important; color: #7f8c8d !important; }

/* Bulles album */
.badge.bg-secondary-subtle { background-color: #ecf0f1 !important; color: #7f8c8d !important; border: none !important; }
.badge.bg-info-subtle { background-color: #eaf2f8 !important; color: #3498db !important; border: none !important; }
.badge.bg-light { background-color: #fff !important; border: 1px solid #eee !important; color: #95a5a6 !important; }

/* Année (Bleu sombre) & Styles (Gris pâle) */
.badge-year {
    background-color: rgba(44, 62, 80, 0.1) !important; color: var(--couleur-primaire) !important;
    border: 1px solid rgba(44, 62, 80, 0.2);
}
.badge-style {
    background-color: #f1f3f5 !important; color: #95a5a6 !important; border: none !important;
}

/* --- TABLEAUX & STATS --- */
.table-responsive-container {
    border-radius: 12px; border: 1px solid #f0f0f0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02); overflow: hidden; background: white;
}
.table { margin-bottom: 0; background: white; }
.table th {
    background-color: #fafbfc; border-bottom: 1px solid #eee;
    text-transform: uppercase; font-size: 0.7rem; letter-spacing: 1px;
    color: #7f8c8d; padding: 1rem; font-weight: 700;
}
.table td {
    border-bottom: 1px solid #f8f9fa; vertical-align: middle;
    padding: 0.5rem 1rem; color: var(--text-main);
}
.table-hover > tbody > tr:hover > * { background-color: #f8fbff; color: var(--couleur-survol); }

.stats-table { table-layout: fixed; width: 100%; }
.stats-table th:first-child, .stats-table td:first-child { width: 30%; }

/* Force les barres de stats à s'étirer */
.stats-table td:nth-child(2) > div { width: 100% !important; display: flex !important; align-items: center !important; }
.stats-table progress { flex-grow: 1 !important; width: auto !important; margin-right: 10px !important; height: 1.5rem !important; }

/* Espacement sections stats */
.statistics-section { margin-bottom: 3rem; }

/* --- TRACKLIST & LIST VIEW --- */
.track-list { list-style: none; padding: 0; margin: 2rem auto; max-width: 800px; }
.track-item { display: flex; align-items: flex-end; margin-bottom: 0.8rem; font-size: 1rem; line-height: 1.2; }
.track-pos { font-weight: 700; min-width: 45px; color: #b2bec3; font-size: 0.9em; }
.track-content { color: var(--text-main); font-weight: 500; }
.track-dots { flex-grow: 1; border-bottom: 2px dotted #dfe6e9; margin: 0 10px 5px 10px; }
.track-duration { font-weight: 600; color: var(--text-muted); }

.list-item-thumbnail { width: 48px !important; height: 48px !important; border-radius: 8px; object-fit: cover; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.column-rangement { width: 120px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rangement-info {
    display: inline-block; font-weight: 700; color: var(--couleur-secondaire); background-color: #ecf0f1; 
    padding: 2px 8px; font-size: 0.7rem; border-left: 3px solid var(--couleur-survol);
    border-radius: 4px; text-transform: uppercase;
}

/* --- BOUTONS, PAGINATION, MODALES, FOOTER --- */
.btn {
    border-radius: 8px; padding: 0.5rem 1.2rem; font-weight: 600; font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(var(--shadow-color), 0.1); border: none;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.btn-primary { background-color: var(--couleur-primaire); color: #fff; }
.btn-primary:hover { background-color: var(--couleur-survol); transform: translateY(-2px); box-shadow: 0 8px 15px rgba(52, 152, 219, 0.3); }
.btn-outline-secondary { border: 1px solid #dfe6e9; color: #636e72; background: transparent; }
.btn-outline-secondary:hover { background-color: #fff; border-color: var(--couleur-survol); color: var(--couleur-survol); }
.btn-xs { padding: 0.15rem 0.5rem !important; font-size: 0.7rem !important; border-radius: 6px; }

.page-link { border: none; color: var(--text-main); border-radius: 8px; margin: 0 2px; font-weight: 600; }
.page-link:hover { background-color: #eaf2f8; color: var(--couleur-survol); }
.page-item.active .page-link { background-color: var(--couleur-primaire); color: #fff; box-shadow: 0 4px 10px rgba(44, 62, 80, 0.3); }
.page-item.disabled .page-link { background-color: transparent; color: #ccc; }

.modal-content { border: none; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.1); }
.modal-header, .modal-footer { border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.app-footer { background-color: #fff; border-top: 1px solid #f0f0f0; color: #b2bec3; }
.footer-text { font-size: 0.85rem; font-weight: 500; }

/* --- CLASSEMENT (Styles Généraux) --- */
.ranking-badge-link {
    display: block; padding: 1.5rem; border-radius: 16px;
    text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
    background-color: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.ranking-badge-link:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }

.link-1001 { color: var(--color-1001); border-left: 5px solid var(--color-1001); }
.link-rs500 { color: var(--color-rs500); border-left: 5px solid var(--color-rs500); }

/* CORRECTIF : Logos Classement (Taille forcée & Contraste) */
.ranking-badge-link img {
    width: 65px !important;
    max-width: 65px !important; 
    height: auto !important;
    object-fit: contain;
}

/* Style spécifique RS500 (Fond blanc) */
.link-rs500 img {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 4px;
    margin-right: 1rem !important;
}

/* Style spécifique 1001 Albums (Pour symétrie parfaite) */
.link-1001 img {
    width: 50px !important;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 4px;
    margin-right: 1rem !important;
}

.ranking-card { background: transparent; border: none; }

/* Badges classement */
.card-1001 .badge { color: var(--color-1001) !important; border-color: rgba(52, 152, 219, 0.3) !important; }
.card-rs500 .badge { color: var(--color-rs500) !important; border-color: rgba(231, 76, 60, 0.3) !important; }

/* --- BARRES DE PROGRESSION CLASSEMENT (Minimalist) --- */

/* --- BARRES DE PROGRESSION (MÉTHODE SOLIDE) --- */

/* Le fond du rail (gris clair) */
.ranking-badge-link .progress {
    background-color: #e9ecef !important;
    border-radius: 10px;
    overflow: hidden;
}

/* La barre 1001 Albums (Bleu) */
.pb-1001 {
    background-color: #3498db !important; /* Bleu direct */
    opacity: 1 !important;
}

/* La barre RS 500 (Rouge) */
.pb-rs500 {
    background-color: #e74c3c !important; /* Rouge direct */
    opacity: 1 !important;
}

/* --- CORRECTIF SURVOL CLASSEMENT (Empêche le bleu générique) --- */

/* Au survol de 1001 Albums -> Tout devient Bleu 1001 */
.link-1001:hover {
    color: var(--color-1001) !important;
    border-color: var(--color-1001) !important;
}
.link-1001:hover h5, 
.link-1001:hover span, 
.link-1001:hover small {
    color: var(--color-1001) !important;
}

/* Au survol de RS 500 -> Tout devient Rouge RS500 */
.link-rs500:hover {
    color: var(--color-rs500) !important;
    border-color: var(--color-rs500) !important;
}
.link-rs500:hover h5, 
.link-rs500:hover span, 
.link-rs500:hover small {
    color: var(--color-rs500) !important;
}

/* =========================================
   SECTION RESPONSIVE (Toujours à la fin !)
   ========================================= */

@media (min-width: 1100px) { .container { max-width: 1080px; } }

/* --- Agrandissement Nom Artiste (Desktop Uniquement) --- */
@media (min-width: 992px) {
    .album-card-artist a {
        font-size: 0.90em !important; /* Passe de 0.8rem à 0.95rem sur PC */
        font-weight: 600; /* On le rend un tout petit peu plus gras pour la lisibilité */
    }
}

@media (max-width: 768px) {
    /* Ajustements cartes */
    .album-card .card-body { padding: 0.5rem !important; }
    
    /* Tableaux */
    .table th, .table td { padding: 0.5rem 0.3rem; font-size: 0.75rem; }
    .list-item-thumbnail { width: 40px !important; height: 40px !important; }
    
    /* Suggestions : On masque tout par défaut */
    .suggestions .row .col-6 { display: none; }
    
    /* On ré-affiche UNIQUEMENT la 1ère et la 3ème suggestion */
    .suggestions .row .col-6:nth-child(1),
    .suggestions .row .col-6:nth-child(3) { 
        display: block; 
    }
}

@media (max-width: 576px) {
    /* Tracklist mobile */
    .track-list { text-align: left !important; }
    .track-item { justify-content: flex-start; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
    .track-pos { min-width: 30px; text-align: left; }
    .track-content { margin-right: auto; padding-right: 10px; }
    .track-dots { display: none; } 
    /* Stats mobile */
    .stats-table th:first-child, .stats-table td:first-child { width: 40%; }
}
