/* Masquer le grand scrollbar de la page */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent scrolling issues */
}

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ****************************************ABOUT SNOW************************************************ */



@keyframes snow {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100vh);
  }
}

.snowflake {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  background: #fff;
  opacity: 0.8;
  border-radius: 50%;
  animation: snow 10s linear infinite;
}

.snowflake:nth-child(odd) {
  animation-duration: 15s;
}


/* ****************************************ABOUT SIDEBAR************************************************ */

/* All about sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh; /* Occuper toute la hauteur de l'écran */
  background-color: #f0f0f0;
  padding: 10px;
  transition: width 0.3s ease;
  color: #030303;
  font-size: 16px;
}
.sidebar h4 {
  font-size: 14px;
  font-weight: bold;
}

.sidebar.closed {
  width: 0;
  padding: 0;
  overflow: hidden;
}
/* Bouton pour fermer la sidebar */
.close-sidebar-btn {
  border: none;
  color: #5f5959;
  cursor: pointer;
  font-size: 28px;
  margin-right: 6px; /* Aligne à droite */
  padding: 5px;
  border-radius: 100%;
  margin-left: 5px;
}
.close-sidebar-btn:hover {
  background-color: rgb(7, 4, 4);
  color: #fff;
}


.sidebar.open {
  width: 400px;
}


.sidebar-header {
  position: sticky;
  top: 0;
  background-color: #f0f0f0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #ccc;
}

.sidebar-content {
  flex-grow: 1;
  overflow-y: auto; /* Ajout du scroll pour le contenu de la sidebar */
  padding: 10px 0;
  margin-bottom: 50px; /* Espace pour le footer */
}

.sidebar-footer {
  bottom: 0;
  background-color: #f0f0f0;
  padding: 10px;
  display: flex;
  justify-content: center;
  border-top: 1px solid #ccc;
  margin-bottom: 10px;
}

/* new chat in sidebar*/
.new-chat-button {
  border: none;
  color: #5f5959;
  font-size: 25px;
  cursor: pointer;
  border-radius: 100%;
  padding: 5px;
  margin-left: 10px;
}
.new-chat-button:hover {
  background-color: #020202;
  color: #fff;
}


/* Section des catégories de discussions */
.category-section {
  margin-top: 70px;
}

/* Conteneur des éléments de discussion avec une flexbox pour aligner les discussions */
.chat-item-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-radius: 50px;
}
.chat-item-container:hover {
  background-color: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 10px;
}
.chat-item-container.hovered {
  background-color: #cec0c0; /* Changez cette couleur selon vos besoins */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: #080808;
  padding: 10px;
}

/* Style des éléments de discussion */
.chat-item {
  color: #020202;
  text-decoration: none;
  font-size: 14px;
}
.chat-item-container.hovered .chat-item {
  color: #070606;
  text-decoration: none;
  font-size: 14px;
}

.chat-item:hover {
  color: #fff;
}

/* Icône du menu pour chaque discussion (les trois points) */
.menu-icon {
  cursor: pointer;
}

/* Menu contextuel pour les options de discussion (archive, partage, suppression) */
.chat-options-menu {
  display: flex;
  flex-direction: row;
  position: absolute;
  background-color: #444;
  padding: 10px;
  border-radius: 5px;
  z-index: 1000; /* S'assure que le menu contextuel soit au-dessus de tout */
}

.chat-options-menu .menu-item {
  background-color: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  margin-right: 10px;
}

.toggle-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  color: #050505;
  background-color: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000; /* Garde le bouton visible en tout temps */
}

/* ******************************************ABOUT SIDEBAR********************************************** */


/* ************************************ABOUT CHATWINDOWS**************************************************** */

.chat-window {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%; /* S'assurer que le chat prend toute la hauteur */
  overflow: hidden; /* Empêcher le débordement des éléments */
  width: 90%;
}

.chat-header {
  padding: 10px;
  display: flex;
  justify-content: flex-end; /* Aligner à droite */
  align-items: center;
}

.chat-header  .profile-dropdown {
  position: relative;
}

.chat-header  .dropdown-menu {
  position: absolute;
  top: 40px; /* Ajustez cette valeur pour placer le menu sous l'icône */
  right: 0;
  background-color: white;
  border: 1px solid #ddd;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000; /* S'assurer que le menu est au-dessus des autres éléments */
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.chat-header  .profile-image {
  width: 40px;
  height: 40px;
  border-radius: 50%; /* Cercle */
  cursor: pointer;
}

.chat-header  .dropdown-menu a {
  padding: 5px 10px;
  text-decoration: none;
  color: #333;
}

.chat-header  .dropdown-menu a:hover {
  background-color: #f1f1f1;
}


.chat-body {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  height: calc(100vh - 140px); /* Ajuste la hauteur */
  margin-bottom: 70px;
  display: flex;
  flex-direction: column;
}

.upload-btn,
.send-btn {
  background-color: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.upload-btn {
  margin-left: 5px;
}

.send-btn {
  margin-right: 5px;
  color: #007bff;
}

.send-btn:hover,
.upload-btn:hover {
  color: #0056b3;
}

/* Style pour la prévisualisation des images 
.image-previews {
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  background-color: #f9f9f9;
  border-top: 1px solid #ccc;
}

.image-preview {
  position: relative;
  margin-right: 10px;
}

.image-preview img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
}

.image-preview button {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: red;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
*/

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.message {
  margin-bottom: 10px;
  padding: 20px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
}

.user-message {
  background-color: #f9f9f9;
  color: #070707;
  text-align: right;
  padding: 0px;
  border-radius: 10px;
  margin: 10px 0;
  margin-left: auto;
  max-width: 80%;
  margin-right: 10%;
  text-align: left;
  font-size: 14px; /* Ajuste la taille de la police ici */
}

.assistant-message {
  color: #333;
  padding: 12px;
  border-radius: 12px;
  margin: 10px 0;
  margin-left: 20%;
  max-width: 70%;
  align-self: flex-start;
  font-size: 14px;
  word-wrap: break-word;
}

/* Style du message pendant le streaming */
.assistant-streaming {
  background-color: #f9f9f9;
  font-style: italic;
  color: #555;
}

/* Style pour les images envoyées par l'utilisateur */
.chat-image {
  max-width: 100px;  /* L'image ne dépasse jamais la largeur de son conteneur */
  height: auto;     /* Conserve le ratio d'aspect de l'image */
  border-radius: 8px;  /* Ajoute des coins arrondis pour un aspect moderne */
  margin-top: 10px;  /* Un petit espace au-dessus de l'image */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);  /* Ajoute une légère ombre */
}

/* Style pour les images générées par l'IA */
.chat-image-assist {
  max-width: 500px;  /* Les images générées par l'IA sont plus grandes */
  height: auto;      /* Conserve le ratio d'aspect de l'image */
  border-radius: 12px;  /* Ajoute des coins arrondis plus prononcés */
  margin-top: 15px;     /* Un espace légèrement plus grand au-dessus de l'image */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);  /* Une ombre un peu plus marquée pour les images générées par l'IA */
  border: 2px solid rgba(0, 123, 255, 0.2);  /* Un léger contour bleu pour indiquer que l'image vient de l'IA */
  transition: transform 0.3s ease;  /* Ajoute une transition pour l'effet hover */
}

/* Effet de survol pour les images générées par l'IA */
.chat-image-assist:hover {
  transform: scale(1.05);  /* Agrandit légèrement l'image au survol */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);  /* Accentue l'ombre au survol */
}

.image-description {
  font-size: 14px;
  color: #555; /* Couleur légèrement grisée pour ne pas distraire */
  font-style: italic;
  text-align: center;
  max-width: 90%; /* Pour éviter que la description ne s'étende trop */
  line-height: 1.4;
}

.download-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #050505; /* Couleur de fond bleu */
  color: white; /* Couleur du texte */
  border-radius: 5px; /* Coins arrondis */
  text-decoration: none; /* Pas de soulignement */
  font-size: 14px; /* Taille du texte */
  font-weight: 500; /* Texte légèrement en gras */
  transition: background-color 0.3s ease; /* Transition pour l'effet hover */
  margin-top: 10px; /* Espace au-dessus du bouton */
}

.download-link:hover {
  background-color: #0056b3; /* Changement de couleur au survol */
}

.download-link .download-icon {
  margin-right: 8px; /* Espace entre l'icône et le texte */
  font-size: 18px; /* Taille de l'icône */
}


/* Pour s'assurer que l'image soit centrée à l'intérieur du message */
.message img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100px;
  height: auto;
}
/* Styles pour les blocs de code */
.code-block {
  position: relative;
  background-color: #1e1e1e; /* Fond noir */
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  color: white; /* Couleur du texte en blanc */
}

/* Style du bouton de copie */
.copy-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(255, 255, 255, 0.1); /* Fond transparent */
  border: none;
  color: #fff; /* Couleur du bouton */
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.2); /* Hover plus visible */
}

.copy-btn svg {
  font-size: 16px;
}

/* Ajuster la couleur des blocs de code pour différents types */
.code-block code {
  color: white; /* Couleur du texte dans le bloc de code */
}



.chat-footer {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #f1f1f1;
  border-top: 1px solid #ccc;
  border-radius: 100px;
  position: sticky;  /* Position sticky pour qu'il reste visible même en scrollant */
  bottom: 0;  /* Coller au bas de la fenêtre */
  width: 50%;
  margin-left: 25%;
  margin-bottom: 10px;
}

/* Zone d'input : par défaut, un conteneur arrondi et centré */
.chat-input {
  display: flex;
  align-items: center;
  background-color: #fff;
  padding: 10px 15px;
  border-radius: 25px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 90%;
  max-width: 600px;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
  z-index: 100;
  margin-bottom: 10px;
}

/* Lorsque la conversation est vide, l'input est centré verticalement */
.chat-input.empty {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}

/* Quand une discussion est active, l'input se fixe en bas */
.chat-input.active {
  bottom: 0;
  top: auto;
  transform: translateX(-50%);
}

.chat-input input[type="text"] {
  flex: 1;
  padding: 10px 15px;
  border: none;
  outline: none;
  font-size: 1rem;
  border-radius: 25px;
}

.upload-btn,
.send-btn {
  background-color: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.upload-btn {
  margin-left: 5px;
}

.send-btn {
  margin-right: 5px;
  color: #007bff;
}

.send-btn:hover,
.upload-btn:hover {
  color: #0056b3;
}

/* Style pour les boutons désactivés */
.send-btn:disabled {
  color: #ccc; /* Rend le bouton grisé */
  cursor: not-allowed; /* Change le curseur pour indiquer que le bouton est désactivé */
}


/* Style pour la prévisualisation des images */
.image-previews {
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  background-color: #f9f9f9;
  border-top: 1px solid #ccc;
}

.image-preview {
  position: relative;
  margin-right: 10px;
}

.image-preview img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
}

.image-preview button {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: red;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* ************************************ABOUT CHATWINDOWS**************************************************** */


/* ************************************ABOUT PRELOADER**************************************************** */
/* Preloader style */
.preloader-wrapper {
  position: relative; /* Relative à son parent */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px; /* Taille adaptée pour être plus discrète */
}

.preloader {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preloader img {
  width: 50px; /* Taille de l'image au centre */
  height: 50px;
  z-index: 1; /* L'image est au-dessus du spinner */
  border-radius: 50%; /* Pour arrondir l'image si besoin */
}

.spinner {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 10px solid #cf142d; /* Couleur et taille du spinner */
  border-top: 10px solid transparent; /* Pour créer l'effet de rotation */
  border-radius: 50%;
  animation: spin 2s linear infinite; /* Animation de rotation */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


/* ************************************ABOUT PRELOADER**************************************************** */


/* ************************************ABOUT RESPONSIVE**************************************************** */

/* Responsiveness */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }

  .chat-body {
    height: calc(100vh - 110px); /* Ajuste la hauteur pour inclure le footer sur petits écrans */
  }
  
}

@media (max-width: 576px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 80%;
    position: fixed;
    z-index: 2;
    height: calc(100vh - 100px); /* Ajuste la hauteur pour inclure le footer */
  }

  .sidebar.closed {
    width: 0;
    padding: 0;
    height: 0;
  }

  .toggle-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 3;
  }

  .chat-body {
    height: calc(100vh - 100px); /* Ajuste la hauteur pour inclure le footer */
  }
  .sidebar-header {
    width: 100%;
  }
  .sidebar-footer {
    width: 100%;
    margin-bottom: 20px;
  }

  .sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
  }

  .chat-footer {
    width: 80%;
    margin-left: 50px;
    margin-bottom: 80px;
  }


  .scroll-container {
    height: 100%; /* Tu peux ajuster la hauteur comme tu veux */
    overflow-y: auto; /* Active le scroll vertical */
    padding: 10px;
    border-radius: 8px;
  }

  .user-message {
    padding: 10px;
    max-width: 60%;
  }
  
  .assistant-message {
       padding-left: 0px;
       max-width: 90%;

  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 80%; /* Occupe toute la largeur sur petits écrans */
    height: calc(100vh - 90px); /* Ajuste pour un espace plus restreint */
  }

  .chat-body {
    height: calc(100vh - 90px); /* Ajuste pour un espace plus restreint */
  }

  .chat-footer {
    width: 95%;
    margin-left: 2.5%; /* Centrer légèrement */
  }

  .toggle-btn {
    top: 8px;
    left: 8px;
  }
}

@media (max-width: 360px) {
  .sidebar {
    width: 80%;
    height: calc(100vh - 80px); /* Moins de place disponible, ajustement */
  }

  .chat-body {
    height: calc(100vh - 80px); /* Moins de place disponible, ajustement */
  }

  .chat-footer {
    width: 100%; /* Prend toute la largeur sur les plus petits écrans */
    margin-left: 0;
    margin-right: 0;
  }

  .toggle-btn {
    top: 5px;
    left: 5px;
    font-size: 20px; /* Réduire la taille de l'icône sur très petits écrans */
  }

  .chat-header {
    font-size: 14px; /* Réduire la taille de la police si nécessaire */
  }

  input {
    font-size: 14px; /* Taille d'entrée plus petite mais toujours lisible */
  }
}


/* ************************************ABOUT RESPONSIVE**************************************************** */



/* src/pages/chatpages/Dashboard.css */

/* Layout principal du dashboard : Sidebar + contenu */

/* Zone de contenu principale (à droite de la sidebar) */
/* dashboard.css */

/* Conteneur principal */
/* dashboard.css */

/* Conteneur principal */
.dashboard-content-stat {
  padding: 20px;
  margin: 0 auto;
  width: 100%;
  background-color: #f9f9f9;
  font-family: Arial, sans-serif;
  overflow: auto;
}

/* En-tête du dashboard */
.dashboard-header {
  text-align: center;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  font-size: 2.5em;
  color: #333;
  margin: 0;
}

/* Formulaire de filtre de dates */
.date-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.date-filter label {
  margin: 0 10px;
  font-size: 1em;
  color: #333;
}

.date-filter input[type="date"] {
  padding: 5px;
  margin-left: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.date-filter button {
  padding: 6px 12px;
  margin-left: 10px;
  border: none;
  background-color: #007bff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.date-filter button:hover {
  background-color: #0056b3;
}

/* Section des widgets */
.widgets {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
}

.widget {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  flex: 1 1 200px;
  margin: 10px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.widget h3 {
  font-size: 1.5em;
  color: #555;
  margin-bottom: 10px;
}

.widget p {
  font-size: 1.8em;
  font-weight: bold;
  color: #333;
}

/* Section des statistiques et graphiques */
.stats {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.stats h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #333;
}

.stats p {
  font-size: 1em;
  color: #777;
  text-align: center;
}

.stats canvas {
  max-width: 100%;
  height: auto;
}

/* Responsive design */
@media (max-width: 768px) {
  .widgets {
    flex-direction: column;
    align-items: center;
  }
  .widget {
    width: 90%;
  }
}



/* Ajustements responsive */
@media (max-width: 768px) {
  .dashboard-content {
    padding: 15px;
  }
  .widgets {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .dashboard-content {
    margin-left: 0;
  }
}