/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

.light-style .menu .app-brand.demo {
  height: 64px;
}

.dark-style .menu .app-brand.demo {
  height: 64px;
}

.app-brand-logo.demo {
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  display: -ms-flexbox;
  display: flex;
  width: 34px;
  height: 24px;
}

.app-brand-logo.demo svg {
  width: 35px;
  height: 24px;
}

.app-brand-text.demo {
  font-size: 1.375rem;
}

/* ! For .layout-navbar-fixed added fix padding top tpo .layout-page */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 72px !important;
}
/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

/*
* Content
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  margin: 1rem 0.375rem 0 0 !important;
}

/* ? .demo-vertical-spacing class is used to have vertical margins between elements. To remove margin-top from the first-child, use .demo-only-element class with .demo-vertical-spacing class. For example, we have used this class in forms-input-groups.html file. */
.demo-vertical-spacing > * {
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-top: 1.875rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-top: 5rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.rtl-only {
  display: none !important;
  text-align: left !important;
  direction: ltr !important;
}

[dir='rtl'] .rtl-only {
  display: block !important;
}

/* Dropdown buttons going out of small screens */
@media (max-width: 576px) {
  #dropdown-variation-demo .btn-group .text-truncate {
    width: 254px;
    position: relative;
  }
  #dropdown-variation-demo .btn-group .text-truncate::after {
    position: absolute;
    top: 45%;
    right: 0.65rem;
  }
}

/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 1rem;
}
.layout-demo-placeholder img {
  width: 900px;
}
.layout-demo-info {
  text-align: center;
  margin-top: 1rem;
}

  /* Loader */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -25px;
    margin-left: -25px;
}

.loader-message {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #3498db;
    text-align: center;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}
/* Styliser le bouton Copier dans le textarea */
#copy-text {
    padding: 5px 10px;
    cursor: pointer;
    background-color: #2196F3;
    color: white;
    border: none;
    z-index: 1;
}

#copy-text:hover {
    background-color: #0b7dda;
}
#download-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

#download-image:hover {
    background-color: #0b7dda;
}
.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 1.5rem;
    height: 100%;
    text-align: center;
	flex-direction: column; 
}

/* Zone d'affichage de l'image générée */
.image-display {
    flex-grow: 1;
    margin-bottom: 50px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
	height: 80vh;
}

#mess_img {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	justify-content: center; /* Centre horizontalement */
	align-items: center;    /* Centre verticalement */
    padding: 10px;
    border-radius: 8px;
    text-align: center;
	min-height: 500px;
}

.image-display img {
    width: auto;
	max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* Colonne d'historique des images */
.image-history {
    display: flex;
    flex-wrap: wrap; /* Permet aux images de revenir à la ligne si nécessaire */
    gap: 15px; /* Espacement entre les images */
    padding: 0;
    margin: 0;
    list-style: none; /* Enlève les puces des listes */
}

/* Style des images dans l'historique */
.image-history li {
    position: relative; /* Nécessaire pour positionner la croix */
    /*flex-basis: calc(25% - 12px); */
    margin: 0;
    padding: 0;
}

.image-history img.thumbnail {
    width: 100%; /* L'image prend toute la largeur disponible dans son conteneur */
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
	cursor: pointer;
}

/* Effet hover sur les images */
.image-history img.thumbnail:hover {
    transform: scale(1.05); /* Effet zoom au survol */
}

/* Position de la croix sur l'image */
.image-history .delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.image-history .delete-image-btn:hover {
    background-color: rgba(255, 0, 0, 0.9);
}

/* Bouton de téléchargement */
.image-history .download-image-btn {
    position: absolute;
    top: 5px;
    left: 5px; /* À l'opposé du bouton de suppression */
	width: 10px;  /* Largeur égale à la hauteur */
    height: 10px; /* Hauteur égale à la largeur */
    background-color: rgba(0, 0, 255, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    padding: 8px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.image-history .download-image-btn:hover {
    background-color: rgba(0, 0, 255, 0.9);
}

/* Le conteneur de la modale */
.modal2 {
    display: none; /* Cachée par défaut */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Fond sombre transparent */
    justify-content: center;
    align-items: center;
}

/* Contenu de la modale */
.modal-content2 {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Boutons */
.modal-buttons2 {
    margin-top: 20px;
}

.modal-buttons2 .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    font-size: 16px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-buttons2 .btn:hover {
    opacity: 0.8;
}

#confirmYes {
    background-color: #28a745;
    color: white;
}

#confirmNo {
    background-color: #dc3545;
    color: white;
}

/* Fenêtre de chat pour afficher les messages */
.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 8px;
    height: 400px;
	text-align:left;
}

/* Style pour les messages de l'utilisateur */
.chat-window .user-message {
    background-color: #CECECE;
    color: white;
    padding: 6px 10px 6px 10px;
    border-radius: 10px;
    max-width: 60%;
    margin-left: auto;
    text-align: left;
    word-wrap: break-word;
    font-size: 14px;
}

/* Style pour les messages de l'IA */
.chat-window .bot-message {
    background-color: #f1f1f1;
    color: black;
    padding: 10px;
    border-radius: 15px;
    max-width: 60%;
    margin-right: auto;
    text-align: left;
    word-wrap: break-word;
    font-size: 14px;
}

.chat-window div {
    margin-bottom: 10px;
    font-size: 14px;
}

.chat-window pre {
    white-space: pre-wrap; /* Gérer les retours à la ligne automatiques */
    word-wrap: break-word;  /* Gérer les coupures de mots longues */
}

.delete-chat-btn {
    color: #e74c3c;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
}

.delete-chat-btn:hover {
    color: #c0392b;
}

#chat-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#chat-history-list li {
    margin-bottom: 10px;
}

#chat-history-list li a {
    text-decoration: none;
}

#chat-history-list li a:hover {
    text-decoration: underline;
}

/* Position de la croix sur l'image */
.delete-blog-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    color: red;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.delete-blog-btn a {
	padding: 0;
	margin: 0;
	color: red;
}

.delete-blog-btn a:hover {
     color: darkred; /* Changement de couleur au survol */
}

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .gauge-chart {
    margin-bottom: 20px; /* Espace entre le graphique et la légende */
  }
    .gauge-background {
      width: 100%;
      height: 100%;
      border-radius: 100px 100px 0 0;
      border: 15px solid #e0cfe6; /* Couleur de la partie non utilisée */
      border-bottom: none;
      position: absolute;
      top: 0;
      left: 0;
      transform: rotate(180deg); /* Aligner correctement la jauge */
    }
    .gauge-progress {
      width: 100%;
      height: 100%;
      border-radius: 100px 100px 0 0;
      border: 15px solid #9a34cd; /* Couleur de la partie utilisée */
      border-bottom: none;
      position: absolute;
      top: 0;
      left: 0;
      clip-path: inset(0 50% 0 0); /* Affiche seulement la moitié supérieure */
      transform-origin: center bottom;
      transform: rotate(calc(180deg * var(--percentage) / 100 - 180deg)); /* Corriger la rotation pour le bon sens */
    }
    .gauge-text {
      position: absolute;
      top: 60%; /* Ajuster selon besoin */
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 1.5em;
      font-weight: bold;
      color: #9a34cd;
    }
/* 🔥 Supprimer la bordure quand un fichier est ajouté */
.dropzone.dz-has-file {
    border: none !important;
    background: transparent !important;
}

.masonry-wide {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

#editToolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap; /* utile en responsive */
}

#editToolbar .btn, 
#editToolbar select {
  width: auto;
  display: inline-block;
  white-space: nowrap;
}

.edit-image-modal .swal2-deny {
  display: none !important;
}

@media (max-width: 768px) {
  #image-display,
  .image-display {
    height: 100vh; /* Pour forcer à occuper l’espace complet */
	height: auto !important;
	overflow: visible !important;
  }
}
