/* Fixer la largeur de la barre latérale et ajouter l'animation */
/* Fixer la largeur de la barre latérale et ajouter l'animation */
#sidebar {
    width: 280px;
    flex-shrink: 0;
    /* On ajoute opacity et visibility à l'animation pour un effet fondu */
    transition: margin-left 0.3s ease, transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1040;
}

/* 1. Comportement sur Desktop (Escamotable à la demande) */
@media (min-width: 769px) {
    #sidebar.hide-desktop {
        margin-left: -280px; /* Recule la barre */
        opacity: 0;         /* La rend totalement transparente */
        visibility: hidden; /* Empêche de cliquer dessus par erreur */
    }
}
/* 2. Comportement sur Mobile (Caché par défaut, glisse par dessus) */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%); /* Caché hors de l'écran à gauche */
    }
    #sidebar.show-mobile {
        transform: translateX(0); /* Ramène le menu sur l'écran */
    }
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;  /* Correction ici (au lieu de 100vw) */
    height: 100%; /* Correction ici (au lieu de 100vh) */
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    display: none;
}

.sidebar-backdrop.show {
    display: block;
}

/* Style des liens de la barre latérale */
.workspace-item {
  background-color: transparent;
  transition: background-color 0.2s ease;
}

.workspace-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.workspace-item.active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  font-weight: 600;
}

/* Style spécifique des bulles de discussion */
.message-bubble {
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 1.2rem;
  line-height: 1.5;
  font-size: 0.95rem;
}

.user-row {
  justify-content: flex-end;
}

.user-bubble {
  background-color:#932D30; /* Bleu primary Bootstrap */
  color: white;
  border-bottom-right-radius: 0.2rem; /* Casse l'arrondi pointant vers l'utilisateur */
}

.ai-row {
  justify-content: flex-start;
}

.ai-bubble {
  background-color: #ffffff;
  color: #212529; /* Texte sombre Bootstrap */
  border: 1px solid #dee2e6;
  border-bottom-left-radius: 0.2rem; /* Casse l'arrondi pointant vers l'IA */
}
.ai-bubble a {
  text-decoration: underline;
  color: #7a288a; /* couleur des liens non visités */
}

.ai-bubble a:visited {
  color: #3498db; /* couleur des liens visités */
}

/* Personnalisation subtile de la scrollbar pour le chat */
#chat-container::-webkit-scrollbar {
  width: 8px;
}
#chat-container::-webkit-scrollbar-track {
  background: transparent;
}
#chat-container::-webkit-scrollbar-thumb {
  background-color: #ced4da;
  border-radius: 10px;
}
/* Gestion de la zone de saisie élastique */
#chat-input {
    min-height: 42px;    /* Hauteur de base pour 1 ligne */
    max-height: 200px;   /* Hauteur max avant de scroller (environ 8 lignes) */
    overflow-y: auto;    /* Ajoute une barre de défilement si le texte dépasse 200px */
}
/* Empêche le placeholder de passer à la ligne sur mobile */
#chat-input::placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entete {
    margin-top: 80px;
}

#current-workspace-sharees {
  font-size:10px;
}

/* Édition du nom de l'espace en ligne */
#current-workspace-name {
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

#current-workspace-name:hover {
    color: #0d6efd !important; /* Couleur primaire Bootstrap */
}

/* Ajout d'un petit crayon au survol (Emoji natif anti-pare-feu) */
#current-workspace-name::after {
    content: "✏️"; /* Utilisation de l'emoji au lieu de la police Bootstrap */
    font-size: 0.9rem;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

#current-workspace-name:hover::after {
    opacity: 1;
}

/* Style pour l'arborescence des documents dans la sidebar */
.document-tree {
    display: none; /* Masqué par défaut */
    max-height: 150px;
    overflow-y: auto;
}

/* On affiche la liste des documents UNIQUEMENT si l'espace parent a la classe .active */
.workspace-block:has(.workspace-item.active) .document-tree {
    display: block;
}

.sidebar-doc-link {
    transition: color 0.2s;
    font-size: 0.8rem;
}

.sidebar-doc-link:hover {
    color: #0d6efd !important; /* Devient bleu au survol */
}

/* Personnalisation de la mini-barre de défilement des documents */
.document-tree::-webkit-scrollbar {
    width: 4px;
}
.document-tree::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.deconnexion a{
  text-align:center;
  color:lightblue;
  width: 100%;
  display: inline-block;
  font-size: 10px;
}

.deconnexion a:hover{
  text-align:center;
  color:lightblue;
  width: 100%;
  display: inline-block;
  font-size: 10px;
}

.titreworkspace {
  /* On remplace width et margin-left par des marges globales (Haut Droite Bas Gauche) */
  margin: 10px 10px 0 10px; 
  border-radius: 10px;
  background-color: #FFFAFA !important;
}

.colonneworkspace {
  text-align: center;
  width:97%;
  background:#932D30;
  margin:5px;
  border-radius: 5px;
  color:#0f0f0f;
  text-shadow: #212529;
  font-weight: bold;
}

.selected-people {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0;
  min-height: 40px;
  border: 1px solid #ccc;
  padding: 5px;
  border-radius: 4px;
}
.person-input {
  width: 100%;
  padding: 8px;
  margin-top: 10px;
}
.autocomplete-results {
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  width: 300px;
  display: none;
  position: absolute;
  background: white;
  z-index: 1000;
}
/* Pastille ronde pour la photo/initiales */
.person-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #ccc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  overflow: hidden;
}
/* Style des suggestions */
.autocomplete-item {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
}
.autocomplete-item:hover {
  background-color: #f0f0f0;
}
/* Style des tags sélectionnés */
.person-tag {
  background-color: #e0e0e0;
  padding: 5px 10px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  margin-right: 5px;
  margin-bottom: 5px;
}
.remove-tag {
  margin-left: 5px;
  cursor: pointer;
  color: #ff0000;
}

#webpage {
  display: none;
}

#my-workspaces-list {
  overflow-y: auto;
  height:70%;
}
#my-workspaces-share-list{
    overflow-y: auto;
    height:30%;
}