/* Réinitialisation de la marge et du padding */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Style global du body */
body {
    font-family: Arial, sans-serif;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
}

/* Header style */
header {
    width: 100%;
    height: 12.5%;
}
/* Main content style */
main {
    padding: 20px;
    max-width: 800px;
    margin: auto;
    background-color: #fff; /* Fond blanc pour le contenu principal */
    border-radius: 10px; /* Coins arrondis pour le main */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Ombre portée */
}

/* Style des liens */
a {
    text-decoration: none;
    transition: color 0.3s;
}

/* Style des titres */
h1,
h2 {
    color: #333;
    text-align: center;
    margin-bottom: 20px; /* Espacement sous les titres */
}

/* Style des blocs d'information */
#profile-info,
#user-options,
#logout {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Ombre légère */
}

/* Style pour l'image de profil */
#my-account-pp {
    width: 60px; /* Ajustez la taille selon vos besoins */
    border-radius: 50%; /* Image ronde */
    border: 2px solid #ddd; /* Bordure autour de l'image */
}

/* Liste des options utilisateur */
#user-options ul {
    list-style-type: none;
    padding: 0;
}

#user-options li {
    margin: 10px 0;
}

#user-options a {
    text-decoration: none;
    color: #007bff;
}

#user-options a:hover {
    text-decoration: underline;
}

/* Style des boutons */
.btn {
    display: inline-block;
    padding: 10px 15px;
    color: #fff;
    background-color: #007bff;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
    transition: background-color 0.3s, transform 0.3s; /* Ajout de transitions */
}

.btn:hover {
    background-color: #0056b3;
    transform: scale(1.05); /* Effet de zoom au survol */
}

#logout-btn {
    background-color: #ff0000;
    transition: background-color 0.3s;
}

#logout-btn:hover {
    background-color: #b30000;
}

/* Style des aperçus de favoris, historiques et playlists */
.favorites-preview,
.history-preview,
.playlists-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.favorite-item,
.history-item,
.playlist-item {
    width: 21%;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #fff;
    transition: transform 0.3s, box-shadow 0.3s; /* Animations pour les items */
}

.favorite-item:hover,
.history-item:hover,
.playlist-item:hover {
    transform: scale(1.02); /* Effet de zoom léger */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Ombre plus marquée */
    cursor: pointer;
}

.favorite-item img,
.history-item img {
    width: 100%;
    border-radius: 5px;
    transition: transform 0.3s; /* Transition pour les images */
}

.favorite-item:hover img,
.history-item:hover img {
    transform: scale(1.05); /* Zoom léger sur les images au survol */
}

.favorite-item p,
.history-item p {
    margin: 0;
    margin-bottom: 5px;
}

/* Style des éléments de playlist */
.playlist-cover {
    width: 100%;
    height: 10vh;
    background-color: white;
    border: solid 1px black;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-cover img {
    width: 50%;
}

.playlist-item p {
    margin-top: 5%;
}

/* Liste historique */
.history-list {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

/* Style pour le lien du compte */
#account-link {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Alignement à droite */
    width: 100%;
    padding: 10px;
}

#account-link a {
    display: flex;
    align-items: center;
}

#account-link img {
    width: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

#account-link span {
    margin-left: 10px;
}

#modify-profile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

#current-pp-img {
    width: 80px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: all 0.3s;
    cursor: pointer;
}
#current-pp-img:hover {
    transform: scale(1.1);
    border: 2px solid #5c95f7;
}

#all-pp-available {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    width: 50%;
    border: solid 1px black;
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    display: none;
}

.pp-available {
    width: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
}
.pp-available:hover {
    transform: scale(1.1);
    border: 2px solid #5c95f7;
}

#import-pp {
    cursor: pointer;
    transition: all 0.3s;
}
#import-pp:hover {
    transform: scale(1.1);
}

/* Media Queries pour les appareils mobiles et tablettes */

/* Smartphones (portrait et paysage) */
@media only screen and (max-width: 767px) {
    header {
        height: auto; /* Ajuster la hauteur du header pour les petits écrans */
    }

    main {
        padding: 10px;
        margin: 0;
        border-radius: 0; /* Supprimer les coins arrondis pour une meilleure adaptation */
        box-shadow: none; /* Supprimer l'ombre pour les petits écrans */
    }

    /* Ajuster la taille des éléments pour les petits écrans */
    .favorites-preview,
    .history-preview,
    .playlists-preview {
        flex-direction: column; /* Disposer les éléments en colonne */
        gap: 5px;
    }

    .favorite-item,
    .history-item,
    .playlist-item {
        width: 100%; /* Occuper toute la largeur disponible */
        margin-bottom: 10px;
    }

    /* Style des boutons */
    .btn {
        display: block;
        width: 100%; /* Boutons pleins pour les petits écrans */
        padding: 15px; /* Augmenter le padding pour une meilleure accessibilité */
        box-sizing: border-box;
    }

    #logout-btn {
        width: 100%; /* Bouton de déconnexion plein écran */
    }

    /* Ajustement pour le lien du compte */
    #account-link {
        flex-direction: column; /* Disposer les éléments en colonne */
        align-items: center;
    }

    #account-link img {
        width: 40px; /* Réduire la taille de l'image */
    }

    #account-link span {
        margin-left: 0; /* Supprimer l'espace à gauche */
    }

    /* Réduction de la taille des images dans les aperçus */
    .favorite-item img,
    .history-item img {
        width: 80%; /* Réduire la largeur des images */
    }
    .playlist-cover {
        height: 15vh;
    }
    .playlist-item {
        font-size: large;
    }
}

/* Tablettes (portrait et paysage) */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    main {
        padding: 15px;
    }

    .favorites-preview,
    .history-preview,
    .playlists-preview {
        flex-direction: row; /* Disposer les éléments en ligne */
        flex-wrap: wrap;
    }

    .favorite-item,
    .history-item,
    .playlist-item {
        width: 30%; /* Ajuster la largeur des éléments pour les tablettes */
    }

    .btn {
        width: auto; /* Boutons avec largeur automatique */
    }

    #logout-btn {
        width: auto; /* Largeur automatique pour le bouton de déconnexion */
    }

    #account-link {
        flex-direction: row; /* Disposer les éléments en ligne */
    }

    #account-link img {
        width: 45px; /* Ajuster la taille de l'image */
    }
}
