/* ***************** SIDEBAR **************** */
/* Styles de la sidebar pour les utilisateurs non connectés */
.sidebar {
    background-color: #f9f9f9;
    color: #333333;
    /* Passé de 250px à 18vw pour s’adapter au zoom, avec min/max pour garder une taille raisonnable */
    width: 18vw;
    min-width: 180px;
    max-width: 260px;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    /* Padding en unités relatives */
    /*padding: 1.5vw;*/
    padding-left:1.0vw;
    padding-right:0.2vw;
    box-shadow: 2px 0px 10px rgba(0, 0, 0, 0.1);
    z-index: 802;
}

/* Titre fixé en haut à gauche */
.sidebar-title {
    font-size: 1.25rem;       /* Taille de police en rem */
    font-weight: bold;
    position: absolute;
    top: 1.5vw;               /* Décalage proportionnel */
    left: 1.5vw;              /* Décalage proportionnel */
    width: auto;
    display: flex;
    align-items: center;
}

.sidebar-title a {
    text-decoration: none;
    color: #000;
    display: block;
    padding: 0.25em 0;        /* Padding en em pour suivre le zoom */
}

.sidebar-title a:hover {
    text-decoration: none;
}

/* Conteneur principal pour le contenu de la sidebar */
.sidebar-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    /* Padding-top adapté à la nouvelle hauteur du titre */
    padding-top: calc(1.5vw + 3.0rem);
    box-sizing: border-box;
    flex-grow: 1;
}

/* Introduction avec logo et description */
.sidebar-intro {
    display: flex;
    align-items: center;
    gap: 1vw;                 /* Espacement relatif */
    margin-bottom: 1.5vw;
    width: 100%;
}

.sidebar-logo {
    width: 2vw;
    height: 2vw;
    min-width: 24px;
    min-height: 24px;
}

.sidebar-description {
    font-size: 0.7rem;
    color: #666666;
}

/* Bouton Créer */
.sidebar-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1vw;
    width: 60%;
    padding: 0.75vw 1vw;
    background-color: #f7f7f7;
    color: #333333;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 2vw;       /* Rayons relatifs */
    cursor: pointer;
    margin-bottom: 2vw;
    margin-left: 0;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.sidebar-create-btn img.create-icon {
    width: 1.5vw;
    height: auto;
    min-width: 20px;
    vertical-align: middle;
    filter: brightness(0) saturate(100%) invert(26%) sepia(98%) saturate(2311%) hue-rotate(203deg) brightness(99%) contrast(101%);
}

/* Effet de survol */
.sidebar-create-btn:hover {
    background-color: #e0e0e0;
    color: #333333;
    text-decoration: none;
}

/* Section d'information en bas */
.sidebar-info {
    text-align: center;
    width: 100%;
    border-top: 1px solid #e0e0e0;
    padding-top: 1.5vw;
    margin-top: auto;
}

/* Historique de l'utilisateur connecté */
.sidebar-history {
    width: 100%;
    height: 70vh;             /* Hauteur relative à la fenêtre */
    padding: 1vw;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    color: #FFFFFF;
    overflow-y: auto;         /* Active le défilement vertical */
}

/* Styles pour la barre de défilement */
.sidebar-history::-webkit-scrollbar {
    width: 0.4vw;
    /*min-width: 6px;*/
}

.sidebar-history::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-history::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 1vw;
    border: 2px solid transparent;
}

.sidebar-history::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.history-date {
    margin-bottom: 1.0vw;
}

.history-date p {
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    font-style: italic;
    text-align: left;
    font-weight: bold;
    font-size: 0.7rem;
    margin: 0vw 0;
    color: dimgrey;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5vw;
    padding-left: 0.5vw;
    font-size: 0.7rem;
}

.history-item .history-question {
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    color: dimgrey;
    text-decoration: none;
}

.history-item .history-question:hover {
    text-decoration: underline;
}

.history-item .delete-history {
    cursor: pointer;
    color: #007bff;
    background-color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5vw;
    height: 1.5vw;
    min-width: 16px;
    min-height: 16px;
    font-size: 1rem;
}

/* Informations utilisateur en bas */
.sidebar-user-info {
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 0.5vw;
    /*left: 1.5vw;*/
    width: calc(100% - 3vw);
    /*padding: 1vw;*/
}

.sidebar-user-avatar {
    width: 2vw;
    height: 2vw;
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    margin-right: 1vw;
}

.sidebar-user-name {
    display: block;
    color: dimgrey;
    font-weight: normal;
    /* Taille adaptative : minimum 0.7rem, idéale 1.2vw, maximum 0.9rem */
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
}

/* Boutons d'information pour les utilisateurs non connectés */
.sidebar-info h2 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333333;
    margin-bottom: 1vw;
}

.sidebar-info p {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 2vw;
    text-align: justify;
}

.sidebar-learn-more-btn,
.sidebar-register-btn {
    display: inline-block;
    width: 60%;
    padding: 0.75vw 1vw;
    border-radius: 1vw;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-learn-more-btn {
    background-color: #f0f0f0;
    color: #333333;
    font-size: 0.9rem;
    margin-bottom: 1vw;
}

.sidebar-learn-more-btn:hover {
    background-color: #d8d8d8;
}

/* Bouton "Créer mon compte" */
.sidebar-register-btn {
    background-color: #007bff;
    color: #ffffff;
    font-size: 0.9rem;
    margin-top: 0.5vw;
    margin-bottom: 2vw;
}

.sidebar-register-btn:hover {
    background-color: #0056b3;
}

/* Masque la sidebar sur les écrans de tablette et mobile */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* Cache la sidebar sur les petits écrans */
    }
}