body{
    display: flex;
    flex-direction: column;
    background-color: #141414;
    margin: 0;
    position: relative;
    overflow-x: hidden;
}
        

table { 
    border-collapse: collapse; 
    width: 90%;  
    border-collapse: separate; /* important ! sinon border-spacing ne fonctionne pas */
    border-spacing: 0 12px;  
    table-layout: fixed;
    position: relative;
    padding-top: 15px;
}

th, td { padding: 10px; border: 0px solid #ccc; text-align: left; }

th { 
    background-color: #141414; 
    color:#9d9d9d;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-size: 14px;
}

tr{
    vertical-align: center;

}

header{
    width: 100%;
    display: flex;
    justify-content:space-between;
    align-items: center;
    background: linear-gradient(to right, #091106, #141414);

}

header h1{
    font-size: 20px;
    color: #ababab;;
}

header h1, header p{
    margin: 10px;
}

h1,p,a,td,h2,h3{
    color:rgb(227, 227, 227);

    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

#main{
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 100vw;

}

a{
    color:#88ff00;
    text-decoration: none;
}

.nouveaute{
    color: #88ff00;
    font-weight: bold;
    white-space: nowrap; /* pour ne pas casser le texte */
    border: 1px #88ff00 solid;
    border-radius: 10px;
    padding:5px;
}


.classement{
    background-color: #141414;
    width: 4%  ;       /* largeur fixe */
    text-align:center; /* optionnel, centrer le texte */
    font-size: 24px;
}
#design-nouveaute{
    color:rgb(83, 255, 83);
    border: 1px rgb(83, 255, 83) solid;
    border-radius: 10px; 
    padding:1px; 
}

.score{
    width: 10%  ;  
    text-align: center;      /* largeur fixe */
}

.release_date{
    text-align: center;      /* largeur fixe */

}

#header-classement{
    display: flex;
    flex-direction: column;
    align-items:flex-start;
    justify-content: center;
}

#header-classement h1, #header-classement h2{
    margin: 0;
}

#header-classement h2{
    font-size: 14px;
}

#color-legend {
    width: 40%;
    text-align: center;
    font-family: "Roboto", sans-serif;
    color: rgb(227, 227, 227);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.legend-title {
    font-size: 14px;
    margin-bottom: 5px;
}

.legend-bar {
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(
        to right,
        rgb(64, 0, 30),     /* rouge sombre = sorties anciennes (2024) */
        rgb(92, 40, 30),    /* orange sombre */
        rgb(0, 64, 30)      /* vert sombre = sorties récentes (2025) */
    );
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 14px;
}

#main-page{
    width: 100%;
    padding-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 85vh;
}

#tableau{
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

#div_playlist{
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    align-items: center;
    background-color: #00ff04;
    padding-top: 2em;
    padding-bottom: 2em;
    height: 40vh;
}

#div_playlist h1{
    color: #000000;
    margin-top: 0;
}

#div_playlist iframe{
    height: 152px; /* Vous pouvez ajuster cette valeur (par exemple 40% ou 40vh) */
    width: 40%; /* Assurez-vous qu'il prend la largeur complète du conteneur parent */
}

.player {
    display: flex;           /* aligne iframe et badge horizontalement */
    align-items: center;     /* centre verticalement le badge par rapport à l’iframe */
    gap: 10px;               /* espace entre l’iframe et le badge */
}
.player iframe {
    border-radius: 8px;
}

.boxnouveaute{
    width: 10%;
    text-align: center;
    background-color: #141414;
}

#tableau h1{
    width: 90%;
}

#encadrement-header{
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 50%;
    border-radius: 15px;
    justify-content: space-around;
    align-items: flex-end;
}




#colonne_artist_1,#colonne_artist_2 {
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

#colonne_artist_1 img,#colonne_artist_2 img{
    width: 140px;
    height: 140px;
    object-fit: cover;     /* Recadre l'image pour remplir le carré */
    transition: transform 0.2s ease,width 0.2s ease,height 0.2s ease;
    aspect-ratio: 1 / 1;  /* Force le format carré */

}

#colonne_artist_1 img:hover,#colonne_artist_2 img:hover{
    transform: translateY(-5px);
    width: 180px;
    height: 180px;
    aspect-ratio: 1 / 1;  /* Force le format carré */


}

#scroll-button-container {
    display: flex;
    justify-content: center;

}

#scroll-button {
    background: linear-gradient(45deg, #88ff00, #00ff04, #84dc20, #4fae10);
    background-size: 300% 300%; /* pour l'animation */
    color: #141414;
    border: none;
    border-radius: 25px;
    padding: 20px 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: gradientShift 3s ease infinite;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#scroll-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

/* Animation du dégradé */
@keyframes gradientShift {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}


.artist_square{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.artist_square a{
    display: flex;
    align-items: center;
    justify-content: center;
}

.artist_square p{
    color: white;;

}



td img{
    width: 100%;
    aspect-ratio: 1 / 1;  /* Force le format carré */
    object-fit: cover;     /* Recadre l'image pour remplir le carré */
}

.colonne_image_tableau{
    width: 5%;
    padding: 0px;
}


#carrousel_section{
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: #0de110;
    height: 80vh;
}

#carrousel_section h1{
    color:#091106;
    margin-bottom:0;
}

#carrousel_section h2{
    font-size: 16px;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 250;
    text-align: center;
    margin: 0px;
    width: 100%;
    color: #091106;;
}

/* --- Conteneur Global --- */
.carousel-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* MODIFICATION ICI : 80% sur PC, centré avec auto */
    width: 80%; 
    max-width: 1200px; /* Optionnel : empêche de devenir géant sur les écrans ultra-larges */
    margin: 20px auto; 
    
    position: relative;
    overflow: hidden; 
}

/* --- La piste de défilement (Track) --- */
.carousel-track {
    display: flex;
    justify-content: flex-start; /* Garder flex-start pour le scroll gauche */
    align-items: center;
    gap: 20px;
    overflow-x: auto; 
    
    /* MODIFICATION ICI : Le track remplit 100% de son parent (qui fait 80% de l'écran) */
    width: 100%; 
    max-width: 100vw;
    padding: 20px 10px; 
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-left: 10px;
    
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* --- La Carte Artiste --- */
.carousel-card {
    flex: 0 0 auto; /* Empêche la carte de rétrécir */
    width: 200px;   /* Largeur fixe d'une carte */
    scroll-snap-align: start; /* S'aligne proprement au scroll */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.carousel-card:hover {
    transform: translateY(-5px); /* Petit effet de levée au survol */
}

/* --- Image --- */
.card-image {
    position: relative;
    width: 100%;
    height: 200px; /* Carré ou rectangle selon préférence */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'image remplit la zone sans déformation */
    aspect-ratio: 1 / 1;  /* Force le format carré */

}

/* --- Badge de Croissance --- */
.badge-growth {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #00ff04; /* Vert croissance */
    color: black;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- Infos Artiste --- */
.card-info {
    padding: 15px;
    text-align: center;
}

.card-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Coupe le texte si trop long */
}

.card-info{
    background-color: #1e1e1e;
}

/* --- Boutons de Navigation (PC uniquement) --- */
.carousel-btn {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 1.2rem;
    color: #333;
    transition: background 0.3s;
    flex-shrink: 0; /* Empêche le bouton de s'écraser */
}

.carousel-btn:hover {
    background-color: white;
    color: #000;
}

#last_release_section{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

#last_release_section h1{
    margin-bottom: 0;
}

#last_release{
    display: flex;
    flex-direction: row;
    width: 100%;
    align-items: center;
    padding-top: 1em;
    margin: 20px auto;
}

#last_release a {
    width: 100%;
    height: 100%;
}

.release_div{
    display: flex;
    flex-direction: row;
    width: 100%;
    background: linear-gradient(to right, #141414, #222222);
    border-radius: 0px 0px 0px 0px;
    height: 100%;
    transition: transform 0.3s ease,box-shadow 0.3s ease;

}

.release_div:hover {
    transform: translateY(-15px); /* Petit effet de levée au survol */
    box-shadow: 0 15px 15px rgba(0,0,0,0.2);

}

.release_div img{
    width: 50%;
    object-fit: cover;     /* Recadre l'image pour remplir le carré */
    aspect-ratio: 1 / 1;  /* Force le format carré */

}

.release_info{
    flex-direction: column;
    width: 40%;
    display: flex;
    padding-left: 10px;
}

.release_info h1{
    font-size: 16px;
    text-align: left;
    margin-bottom: 2px;
}

.nom_artiste_last_release{
    font-size: 14px;
    text-align: left;
    font-weight: 250;
}

#sous_titre_last_release{
    font-size: 16px;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 250;
    text-align: center;
    margin: 0px;
    width: 100%;
    color: #ababab;
}

#titre_last_release_section{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}




/* --- Conteneur du Graphique (Définit l'espace) --- */
.bar-chart-container {
    width: 80%;
    height: 100%;
}

.bar-chart-container h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 20px;
}

/* --- Le Graphique lui-même (Conteneur Flex) --- */
.bar-chart {
    display: flex;
    align-items: flex-end; /* ALIGNEMENT CRITIQUE : Place les barres sur la ligne de base (bas) */
    justify-content: space-between;
    height: 100%;          /* Hauteur totale du graphique (définit le 100%) */
}

/* --- Le Wrapper de chaque Barre (Flex Item) --- */
.bar-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Place la barre en bas du wrapper */
    align-items: center;
    width: 6%; /* Largeur de la colonne (ajustable) */
    height: 100%; /* Prend toute la hauteur du .bar-chart */
    position: relative;
}

.bar-wrapper p{
    text-align: center;
}

/* --- La Barre (La Colonne colorée) --- */
.bar {
    width: 25%;
    border-radius: 5px 5px 0 0; /* Arrondir le haut des barres */
    transition: height 0.5s ease; /* Pour une belle animation si la valeur change */
}

/* --- Valeur au-dessus de la Barre --- */
.value {
    font-weight: bold;
    font-size: 16px;
    padding: 3px 0;
    margin-bottom: 5px; /* Espace entre la valeur et la barre */
    text-align: center;
    font-family: "Roboto", sans-serif;
    color: rgb(227, 227, 227);

}


.bar-wrapper img{
    width: 100%;
    object-fit: cover; 
    aspect-ratio: 1 / 1;  /* Force le format carré */
    transition: transform 0.3s ease,box-shadow 0.3s ease;
}

.bar-wrapper img:hover{
    transform: translateY(-15px); /* Petit effet de levée au survol */
    box-shadow: 0 15px 15px rgba(0,0,0,0.2);
}

#mainstream_section{
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    height: 80vh;
    padding-bottom: 5vh;
}




/* --- Conteneur plus compact --- */
#classement_carteson {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #141414;
}

#liste_classement_carteson {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Espace réduit entre les lignes */
    width: 40%; /* Moins large pour rester discret */
    margin: 3em
}

/* --- Style de base sobre --- */
.son-card {
    display: flex;
    align-items: center;
    background: transparent;
    border-radius: 8px;
    padding: 8px 15px;
    text-decoration: none;
    transition: background 0.2s ease;
    border: 1px solid transparent;
    background-color: #1b1b1b;
}

.son-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(136, 255, 0, 0.3);
}

/* --- Rangs classiques --- */
.rank-container {
    width: 35px;
    flex-shrink: 0;
}

.rank-number {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* --- Images réduites --- */
.image-container {
    width: 5em;
    height: 5em;
    margin-right: 15px;
    flex-shrink: 0;
}

.image-container img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

/* --- Détails --- */
.track-name {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #eee;
}

.artist-name {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

.artist-name span {
    color: #88ff00;
}

/* --- MISE EN AVANT SOBRE DU TOP 3 --- */
.top-3 {
    background: rgba(136, 255, 0, 0.03);
}

.rank-1 {
    border-left: 3px solid #88ff00;
    padding-top: 12px;
    padding-bottom: 12px;
}

.rank-1 .track-name {
    font-size: 17px;
    color: #fff;
}

.rank-1 .image-container {
    width: 5em;
    height: 5em;
}

.rank-1 .rank-number {
    color: #88ff00;
    font-weight: 700;
}

.rank-2 .rank-number, .rank-3 .rank-number {
    color: #eee;
}

#classement_carteson h2{
    font-size: 16px;
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 250;
    text-align: center;
    margin: 0px;
    width: 100%;
    color: #dbdbdb;;
}

#main_title{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
}

#main_title h1,#main_title h2,#main_title h3{
    text-align: left;
}

#main_title h1{
}
#main_title h2{
    font-size: 25px;
    font-weight: 450;
    color: #dadada;
}

#main_title h3{
    font-size: 18px;
    font-weight: 300;
    color: #bfbfbf;

}

#last_release_single{
    display: flex;
    flex-direction: column;
    width: 50%;
    align-items: center;
    padding-top: 1em;
    margin: 20px auto;
}

#last_release_section_single{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#last_release_section_single h1{
    margin-bottom: 0;
}
#last_release_section_single img{
    width: 15%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

#nouveaute_single{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 50%;
}

.carre-grid {
    display: grid;
    /* Crée 3 colonnes de largeur égale */
    grid-template-columns: repeat(3, 1fr); 
    /* Espace entre les cases */
    gap: 10px; 
    /* Largeur de la grille (ajustable) */
    width: 100%;
    max-width: 450px; 
    margin: 0 auto;
}

.case {
    /* FORCE LE FORMAT CARRÉ : la hauteur sera toujours égale à la largeur */
    aspect-ratio: 1 / 1; 
    
    /* Style pour le contenu de la case */
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(136, 255, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: white;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
}

.case:hover {
    background-color: rgba(136, 255, 0, 0.1);
    border-color: #88ff00;
    transform: scale(1.02);
}

/* Si tes éléments sont des images, ajoute ceci : */
.case img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.case a {
    text-decoration: none; /* Enlève le soulignement */
    color: inherit;        /* Le lien prend la couleur du texte parent (au lieu du bleu) */
    outline: none;         /* Enlève le contour lors du clic (pour rester sobre) */
    width: 100%;
    height: 100%;
}

#top-main-page{
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    align-items: center;
    height: 80%;
}


@media (max-width: 600px) {
    header {
        flex-direction: column;
        height: auto;
        text-align: center;
    }

    header h1 {
        font-size: 20px;
        margin-bottom: 5px;
    }

    #encadrement-header{
        width: 80%;
        display: flex;
        justify-content: space-evenly;
        flex-direction: column;
        align-items: center;
        height: auto;
    }

    table iframe,.player,.boxnouveaute{
        display: none;
    }

    #tableau h1{
        font-size: 18px;
    }

    .classement{
        font-size: 12px;
    }

    table td{
        font-size: 12px;
    }

    table th{
        font-size: 7px;
    }

    table {
        width: 95%;
        padding-top: 0px;
    }

    #colonne_artist_1,#colonne_artist_2,.release_date{
        display: none;
    }


    .colonne_image_tableau{
        width: 10%;
        padding: 5px;
    }

    td{
        padding: 5px;
    }

    .classement{
        text-align: center;
    }
    
    #main-page{
        height: 90vh;
    }

    .carousel-btn {
        display: none; /* On cache les flèches sur mobile, le swipe suffit */
    }
    
    .carousel-card {
        width: 160px; /* Cartes un peu plus petites sur mobile */
    }
    .carousel-wrapper {
        width: 100%; /* Sur mobile, on utilise toute la largeur */
    }
    
    .carousel-track {
        padding-left: 20px; /* Un peu d'espace sur le côté gauche sur mobile */
    }

    #last_release{
        flex-direction: column;
        gap:10px;
    }

    #last_release_section{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 80vh;
    }
    .release_div img{
        width:30%;
        object-fit: cover;     /* Recadre l'image pour remplir le carré */
    }



    /* 1. La fenêtre visible et le défilement */
    .bar-chart-container {
        width: 100%; /* Prend toute la largeur sur mobile */
        overflow-x: auto; /* Active le défilement */
    }

    /* 2. Le conteneur Flex qui dépasse */
    .bar-chart {
        width: max-content; /* Le contenu s'étend autant que nécessaire */
        gap:15px;
    }
    
    /* 3. L'élément de la barre (empêche la compression) */
    .bar-wrapper {
        flex-shrink: 0; /* C'est la clé pour qu'ils n'essaient pas de tenir sur un seul écran */
        width: auto; /* Laisse min-width prendre le dessus */
    }
    
    /* Optionnel : Redimensionner l'image si 150px est trop grand */
    .bar-wrapper img {
        max-width: 80px; 
    }
    .bar-wrapper p {
        width: min-content; 
    }

    .bar{
        width: 10%;
    }

    /* NOUVELLE RÈGLE : Réduire la hauteur de l'iframe sur mobile */
    #encadrement-header iframe {
        height: 152px; /* Vous pouvez ajuster cette valeur (par exemple 40% ou 40vh) */
        width: 100%; /* Assurez-vous qu'il prend la largeur complète du conteneur parent */
    }

    #liste_classement_carteson { width: 95%; }
        .algorithm-badge { display: none; } /* Cache le badge sur petit mobile pour gagner de la place */
        .son-card { padding: 10px; }
        .rank-1 { transform: scale(1.02); }

    .spotify-cta svg {
        width: 28px;
        height: 28px;
    }
    .spotify-link-wrapper {
        padding-left: 10px;
    }

    #liste_classement_carteson {
        width: 75%;
    }
    .son-card {
        padding: 6px 10px;
    }

    #top-main-page{
        flex-direction: column;
        justify-content: space-evenly;
        height: 100%;
    }

    #nouveaute_single{
        width: 80%;
    }

    #main_title{
        width: 100%;
    }

    #main_title h1,#main_title h2{
        text-align: center;
    }

    #main_title h1{
        font-size: 20px;
    }

    #main_title h2{
        font-size: 16px;
    }

    #nouveaute_single h2{
        font-size: 16px;

    }

    #div_playlist iframe {
        height: 152px;
        width: 90%; 
    }

}
