/* Réinitialisation des styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Style général pour le corps de la page */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f6f8;
    color: #333;
    font-family: 'Montserrat', Arial, sans-serif;
    position: relative;
}

/* Fond blanc uniquement pour la page d'accueil */
.home-page {
    background-color: white;
}

/* Style du texte principal pour l'accueil */
h1 {
    font-size: 5rem;
    font-weight: 700;
    color: black;
}

/* Positionnement du conteneur utilisateur en haut à droite */
.user-menu-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Style du bouton utilisateur */
.user-button {
    background-color: black;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Montserrat';
}

.user-button:hover {
    background-color: #333;
}

/* Style du menu déroulant */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    min-width: 170px;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    color: #333;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 0.9em;
}

.dropdown-menu a:hover {
    background-color: #ddd;
}

/* Conteneur de connexion */
.login-container {
    width: 100%;
    max-width: 360px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Titre de formulaire */
h2 {
    margin-bottom: 1.5em;
    font-size: 1.8em;
    color: #333;
}

/* Style des labels */
label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    text-align: left;
    color: #555;
}

/* Champs de saisie */
input[type="email"],
input[type="password"],
input[type="text"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    background-color: #f9f9f9;
}

/* Boutons de formulaire */
.btn-login,
.btn-reset-password,
.btn-new-password,
.btn-account-update {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: dimgrey;
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover,
.btn-reset-password:hover,
.btn-new-password:hover,
.btn-account-update:hover {
    background-color: #000;
}

/* Message d'erreur */
.error {
    color: #d9534f;
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* Message de succès */
.success {
    color: #28a745;
    font-size: 0.9em;
    margin-top: 15px;
}

/* Lien mot de passe oublié */
.forgot-password {
    margin-top: 10px;
}

.forgot-password a {
    color: dimgrey;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}

.forgot-password a:hover {
    color: #0056b3;
}

/* Spinner de chargement */
.loading-spinner {
    margin-top: 10px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: none;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Conteneur de la page de compte */
.account-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Titre principal */
.account-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 2em;
}

/* Section d'informations utilisateur et assistants */
.user-info, .assistant-info {
    margin-bottom: 30px;
}

.user-info h3, .assistant-info h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
    text-align: left;
}

.name-container,
.password-container {
    display: flex;
    gap: 10px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.password-container {
    margin-top: 15px;
}


/* ************* MON COMPTE *************** */
.header-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Espace entre l'avatar et le texte */
    margin-bottom: 20px;
    justify-content: center;
}

.avatar-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar-circle {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; /* Assure que l'image reste ronde */
}

.header-container h2 {
    font-size: 2em;
    color: #333;
    margin: 0;
}



/* ************* SECTION MES ASSISTANTS ************** */
.assistant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 10px;
}

.assistant-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease;
    text-align: center;
}

.assistant-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.assistant-avatar:hover img {
    transform: scale(1.1);
    border-color: #000;
}

.assistant-avatar span {
    margin-top: 8px;
    font-size: 0.9em;
    color: #555;
}

/* Bouton "Créer un nouvel assistant" */
.add-assistant {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    font-size: 2em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.add-assistant:hover {
    background-color: #45a049;
    transform: scale(1.1);
}


/* ************* PAGE ASSISTANTS **************** */
.chat-container {
    max-width: 600px;
    margin: auto;
    padding: 20px;
    background-color: #f4f6f8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
}

.message {
    display: flex;
    align-items: flex-start; /* Alignement en haut de l'avatar et du nom */
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
}

.user-message {
    background-color: #d1e7dd;
}

.assistant-message {
    background-color: #e9ecef;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ccc;
    background-size: cover;
    background-position: center;
    margin-right: 10px;
    flex-shrink: 0; /* Empêche l'avatar de se comprimer */
}

.message-content {
    flex: 1; /* Permet au contenu de prendre tout l'espace restant */
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.message-header strong {
    font-weight: bold;
    display: inline-block;
}

.message-text {
    margin-top: 5px;
    margin-left: 50px; /* Indentation pour aligner sous le texte de l'avatar */
    line-height: 1.4;
}




/* ************* PAGE SET-UP ASSISTANT ************** */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px 0;
    box-sizing: border-box;
    overflow-y: auto;
}

.assistant-container {
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 40px);
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    text-align: center;
    overflow-y: auto;
}

/* Custom scrollbar style - Modern, elegant look */
.assistant-container::-webkit-scrollbar,
textarea#knowledge_content::-webkit-scrollbar {
    width: 10px;
}

.assistant-container::-webkit-scrollbar-track,
textarea#knowledge_content::-webkit-scrollbar-track {
    background: #f3f3f3;
    border-radius: 10px;
}

.assistant-container::-webkit-scrollbar-thumb,
textarea#knowledge_content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c9c9c9, #a9a9a9);
    border-radius: 10px;
    border: 2px solid #f3f3f3;
    transition: background 0.3s ease;
}

.assistant-container::-webkit-scrollbar-thumb:hover,
textarea#knowledge_content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a9a9a9, #888888);
}

/* Scrollbar for Firefox */
.assistant-container,
textarea#knowledge_content {
    scrollbar-width: thin;
    scrollbar-color: #a9a9a9 #f3f3f3;
}

/* Styles for other elements */
.assistant-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 2em;
}

.assistant-avatar-large {
    margin: 20px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid dimgrey;
    cursor: pointer;
    position: relative;
}

.assistant-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.assistant-details {
    text-align: left;
    margin-top: 20px;
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}

.assistant-details p {
    margin: 8px 0;
}

/* Style for textarea */
textarea#knowledge_content {
    width: 100%;
    max-width: 960px;
    height: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Return button */
.btn-back {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 15px;
    background-color: dimgrey;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background-color: #000;
}

/* Boutons Mettre à jour et Supprimer */
.form-buttons {
    display: flex;
    gap: 10px;
}

.btn-delete {
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn-delete:hover {
    background-color: #c9302c;
}

/* Popin de confirmation */
.delete-assistant-popin {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 1000;
    font-size: 1em;
    color: #333;
    animation: fadeIn 0.5s ease-in-out;
}

.popin-content {
    padding: 20px;
}

.close-cross {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
}

.btn-confirm-delete {
    background-color: #d9534f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
    margin-top: 15px; /* Marge au-dessus du bouton */
}

.btn-confirm-delete:hover {
    background-color: #c9302c;
}

.btn-cancel-delete {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px; /* Marge au-dessus du bouton */
}

.btn-cancel-delete:hover {
    background-color: #5a6268;
}






/* *************** LOGOUT *************** */
.logout-page {
    background-color: #f4f6f8;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.logout-container {
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.logout-container h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 15px;
}

.logout-container p {
    font-size: 1em;
    color: #555;
    margin-top: 10px;
}

.logout-container a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.logout-container a:hover {
    color: #0056b3;
}


/* ************* CREATE ASSISTANT ************** */
/* Conteneur principal pour la création d'assistant */
.create-assistant-container {
    max-width: 600px;
    height: calc(100vh - 60px); /* Hauteur dynamique pour occuper l'espace avec une marge de 30px en haut et en bas */
    margin: 30px auto; /* Marge pour espacer du haut et du bas */
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Barre de défilement interne */
    text-align: center;
}

/* Style personnalisé pour la barre de défilement */
.create-assistant-container::-webkit-scrollbar {
    width: 8px;
}

.create-assistant-container::-webkit-scrollbar-track {
    background: #f3f3f3;
    border-radius: 10px;
}

.create-assistant-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c9c9c9, #a9a9a9);
    border-radius: 10px;
    border: 2px solid #f3f3f3;
    transition: background 0.3s ease;
}

.create-assistant-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a9a9a9, #888888);
}

/* Barre de défilement pour Firefox */
.create-assistant-container {
    scrollbar-width: thin;
    scrollbar-color: #a9a9a9 #f3f3f3;
}

/* Titres et formulaire */
.create-assistant-container h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
    color: #333;
}

.create-assistant-container label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1em;
    color: #555;
    text-align: left;
}

.create-assistant-container input[type="text"],
.create-assistant-container select,
.create-assistant-container textarea {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-size: 1em;
}

/* Section de téléchargement d'image */
.image-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    display: block;
    margin-bottom: 10px;
}

.image-upload-label {
    background-color: #4CAF50;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
}

.image-upload-label:hover {
    background-color: #45a049;
}

#picture {
    display: none; /* Masque l'input de fichier par défaut */
}

/* Bouton de validation */
.btn-assistant-create {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background-color: dimgrey;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-assistant-create:hover {
    background-color: #000;
}

/* Popin de confirmation */
.confirmation-popin {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 1000;
    font-size: 1em;
    color: #333;
    animation: fadeIn 0.5s ease-in-out;
}

.confirmation-popin p {
    margin: 10px 0;
}

.confirmation-popin a {
    color: #4CAF50;
    font-weight: bold;
    text-decoration: none;
}

.confirmation-popin a:hover {
    text-decoration: underline;
}

/* Animation de fade-in pour la popin */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* *************** SIDEBAR *************** */
/* sidebar.css */
.sidebar {
    width: 250px;
    background-color: #fff;
    padding: 20px;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 1.5em;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    display: block;
    border-radius: 50%;
}

.sidebar-description {
    text-align: center;
    color: #555;
}

.history-date {
    font-size: 0.9em;
    color: #888;
    cursor: pointer;
}

.questions-container {
    padding-left: 15px;
    border-left: 2px solid #eee;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.sidebar-user-name {
    font-weight: bold;
    color: #333;
}

.sidebar-create-btn,
.sidebar-register-btn,
.sidebar-learn-more-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 10px;
}

.sidebar-learn-more-btn {
    background-color: #007bff;
}

