/* Module chat : CSS extrait d'argon-app.css (scripts/extract_module_css.py). Feuille du module : editer ici, avec les variables de static/css/app/tokens.css. */
.chat-container {
    height : calc(100dvh - 200px);
}

.chat-container-espace-de-travail{
    height : calc(89dvh);
}

.chat-body {
    height: calc(89dvh - 200px);
    margin : auto;
}

.chat-body-espace-de-travail {
    height: 78dvh;
    margin: 0 auto 0 auto;
}

.chat-conversation {
    height: calc(100% - 150px);
    overflow-y: scroll;
    padding: 0px 5% 0px 5%;
}

.chat-footer {
    padding: 0px 5% 0px 5%;
    height: 115px;
}

#chat-mi {
    height: 89dvh;
}

.chat-footer.disabled {
    opacity: 0.5;
    pointer-events: none;
  }

/* Bouton de toggle - Mode flottant uniquement */
.chat-toggle-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bs-link-hover-color);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle-button:hover {
  transform: scale(1.05);
  background: #0d9169;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-toggle-button:active {
  transform: scale(0.98);
}

/* Panneau du chat - Mode flottant */
.chat-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 440px;
  height: 650px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.chat-panel-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Header minimal - ChatGPT style */
.chat-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  color: #202123;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #202123;
}

.chat-header-title svg {
  width: 20px;
  height: 20px;
  fill: var(--bs-link-hover-color);
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

.chat-btn-icon {
  background: transparent;
  border: none;
  color: #8e8ea0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-btn-icon:hover {
  background: #f7f7f8;
  color: #202123;
}

/* Zone de messages - Layout centré comme ChatGPT */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  position: relative;
}

.chat-messages {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}

/* Message - Blocs alternés comme ChatGPT */
.chat-message {
  width: 100%;
  padding: 12px 16px;
  display: flex;
  animation: messageSlideIn 0.2s ease;
}

/* Messages de l'assistant - Alignés à gauche, plain text */
.chat-message-assistant {
  justify-content: flex-start;
  background: transparent;
}

/* Messages de l'utilisateur - Alignés à droite, capsule gris-bleu */
.chat-message-user {
  justify-content: flex-end;
  background: transparent;
}

/* Wrapper pour contrôler la largeur du contenu */
.chat-message-wrapper {
  max-width: 75%;
  display: flex;
  gap: 12px;
}

/* Wrapper spécifique pour l'assistant */
.chat-message-assistant .chat-message-wrapper {
  flex-direction: row;
}

/* Wrapper spécifique pour l'utilisateur - inversé */
.chat-message-user .chat-message-wrapper {
  flex-direction: row-reverse;
}

/* Avatar - Style ChatGPT */
.chat-message-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.chat-message-avatar svg {
  width: 100%;
  height: 100%;
}

/* Masquer l'avatar pour les messages utilisateur */
.chat-message-user .chat-message-avatar {
  display: none;
}

/* Contenu du message */
.chat-message-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Style pour les messages de l'assistant - plain text */
.chat-message-assistant .chat-message-text {
  color: #2d3748;
  line-height: 1.6;
  font-size: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: transparent;
  padding: 0;
}

/* Style pour les messages utilisateur - capsule gris-bleu */
.chat-message-user .chat-message-text {
  color: #1a202c;
  line-height: 1.5;
  font-size: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: #e8eef5;
  padding: 12px 16px;
  border-radius: 18px;
  display: inline-block;
}

.chat-message-text {
  color: #2d3748;
  line-height: 1.6;
  font-size: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Formatage du texte */
.chat-message-text h1,
.chat-message-text h2,
.chat-message-text h3 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #202123;
}

.chat-message-text h1 { font-size: 1.5em; }
.chat-message-text h2 { font-size: 1.3em; }
.chat-message-text h3 { font-size: 1.1em; }

.chat-message-text p {
  margin-bottom: 12px;
}

.chat-message-text code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: #d63384;
}

.chat-message-text pre {
  background: #000000;
  color: #ffffff;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.chat-message-text pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.chat-message-text ul,
.chat-message-text ol {
  margin: 12px 0;
  padding-left: 24px;
}

.chat-message-text li {
  margin: 6px 0;
  line-height: 1.75;
}

.chat-message-text strong {
  font-weight: 600;
  color: #202123;
}

.chat-message-time {
  font-size: 11px;
  color: #8e8ea0;
  margin-top: 4px;
}

/* Indicateur de chargement - Style ChatGPT */
.chat-loading {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  display: flex;
  justify-content: flex-start;
}

.chat-loading-wrapper {
  max-width: 75%;
  display: flex;
  gap: 12px;
}

.chat-loading-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.chat-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8e8ea0;
  animation: dotPulse 1.4s infinite ease-in-out both;
}

.chat-loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.chat-loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Menu contexte flottant - Style ChatGPT */
.chat-context-menu {
  position: absolute;
  bottom: 80px;
  left: 16px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 8px;
  display: none;
  z-index: 100;
  min-width: 240px;
}

.chat-context-menu.active {
  display: block;
}

.chat-context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 14px;
  color: #202123;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.chat-context-menu-item:hover {
  background: #f7f7f8;
}

.chat-context-menu-item svg {
  width: 18px;
  height: 18px;
  fill: #8e8ea0;
  flex-shrink: 0;
}

.chat-context-menu-item:hover svg {
  fill: #202123;
}

.chat-context-menu-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 4px 0;
}

/* Toggle items avec indicateur */
.chat-context-menu-toggle {
  justify-content: space-between;
  position: relative;
}

.chat-toggle-indicator {
  width: 36px;
  height: 20px;
  background: #d9d9e3;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-toggle-indicator::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.chat-context-menu-toggle.active .chat-toggle-indicator {
  background: var(--bs-link-hover-color);
}

.chat-context-menu-toggle.active .chat-toggle-indicator::after {
  transform: translateX(16px);
}

/* Documents sélectionnés - Pills comme ChatGPT */
.chat-selected-docs {
  padding: 8px 16px;
  background: #f7f7f8;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chat-selected-docs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.chat-selected-doc-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #d9d9e3;
  border-radius: 16px;
  font-size: 13px;
  color: #202123;
  transition: all 0.15s ease;
  max-width: 220px;
}

.chat-selected-doc-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.chat-selected-doc-item:hover {
  background: #f7f7f8;
  border-color: #8e8ea0;
}

.chat-selected-doc-item svg {
  width: 14px;
  height: 14px;
  fill: var(--bs-link-hover-color);
}

.chat-selected-doc-remove {
  background: none;
  border: none;
  color: #8e8ea0;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.chat-selected-doc-remove:hover {
  color: #202123;
}

/* Zone d'entrée - Style ChatGPT */
.chat-input-container {
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  padding: 16px 24px;
  flex-shrink: 0;
}

.chat-input-wrapper {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
}

.chat-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 13px;
  margin-bottom: 12px;
}

.chat-error i {
  flex-shrink: 0;
}

.chat-error-close {
  background: none;
  border: none;
  color: #991b1b;
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.chat-error-close:hover {
  opacity: 1;
}

.chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input-plus-btn {
  background: transparent;
  border: none;
  color: #8e8ea0;
  flex-shrink: 0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.chat-input-plus-btn:hover {
  background: #f7f7f8;
  color: #202123;
}

.chat-input-plus-btn svg {
  width: 20px;
  height: 20px;
}

/* Pilule contenant textarea + bouton send */
.chat-input-pill {
  flex: 1;
  display: flex;
  align-items: flex-end;
  border: 1px solid #d9d9e3;
  border-radius: 25px;
  background: #f7f7f8;
  transition: all 0.15s ease;
  min-height: 44px;
  overflow: hidden;
}

.chat-input-pill:focus-within {
  border-color: var(--bs-primary);
  background: #ffffff;
  box-shadow: 0 0 0 1px var(--bs-link-hover-color);
}

.chat-input {
  flex: 1;
  border: none;
  border-radius: 25px 0 0 25px;
  padding: 11px 4px 9px 16px;
  font-size: 14px;
  resize: none;
  max-height: 200px;
  font-family: inherit;
  line-height: 1.5;
  background: transparent;
  color: #202123;
}

.chat-input::placeholder {
  color: #8e8ea0;
}

.chat-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

.chat-input:disabled {
  background: transparent;
  cursor: not-allowed;
  opacity: 0.6;
}

.chat-input:disabled ~ .chat-send-btn {
  opacity: 0.3;
  cursor: not-allowed;
  background: #d9d9e3;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bs-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin: 6px 6px 6px 4px;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--bs-link-hover-color);
}

.chat-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #d9d9e3;
}

/* Indicateurs de recherche */
.chat-search-indicators {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.chat-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f0f4f8;
  border: 1px solid #d0dae5;
  border-radius: 12px;
  font-size: 12px;
  color: #2d3748;
  font-weight: 500;
  transition: all 0.2s ease;
}

.chat-indicator svg {
  width: 14px;
  height: 14px;
  color: #5a67d8;
}

.chat-indicator span {
  line-height: 1;
}

/* Variantes des indicateurs */
.chat-indicator-web {
  background: #e6f7ff;
  border-color: #91d5ff;
}

.chat-indicator-web svg {
  color: #1890ff;
}

.chat-indicator-docs {
  background: #f0f5ff;
  border-color: #adc6ff;
}

.chat-indicator-docs svg {
  color: #2f54eb;
}

.chat-indicator-deep {
  background: #f9f0ff;
  border-color: #d3adf7;
}

.chat-indicator-deep svg {
  color: #722ed1;
}

/* Compteur de caractères */
.chat-char-counter {
  font-size: 11px;
  color: #8e8ea0;
  white-space: nowrap;
  align-self: flex-end;
  padding-bottom: 10px;
  flex-shrink: 0;
}

/* Footer info - Style ChatGPT */
.chat-footer-info {
  text-align: center;
  margin-top: 6px;
  font-size: 8px;
  color: #8e8ea0;
  line-height: 1.4;
}

/* Modal de documents - Design moderne inspiré de media_kit_edit */
.chat-documents-modal .modal-header {
  border-bottom: none;
  padding: 1.25rem 1.5rem;
}

.chat-documents-modal .modal-header .modal-title {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-documents-modal .modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.chat-documents-modal .modal-header .btn-close:hover {
  opacity: 1;
}

.chat-documents-modal .modal-body {
  padding: 1.5rem;
}

.chat-documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-height: 450px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.chat-document-card {
  position: relative;
  background: white;
  border: 1px solid var(--mv-gray-200);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: pointer;
}

.chat-document-card:hover {
  border-color: var(--mv-primary);
  box-shadow: 0 10px 25px rgba(0, 85, 255, 0.14);
  transform: translateY(-2px);
}

.chat-document-card.selected {
  border-color: var(--mv-primary);
  box-shadow: 0 10px 25px rgba(0, 85, 255, 0.18);
}

.chat-document-card.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mv-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(0, 85, 255, 0.35);
  z-index: 2;
}

.chat-document-preview {
  position: relative;
  height: 120px;
  border-bottom: 1px solid #f0f2f5;
  overflow: hidden;
  background: var(--mv-gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-document-icon {
  font-size: 48px;
  color: var(--mv-primary);
}

.chat-document-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-document-type-pdf {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  color: white;
}

.chat-document-type-doc {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  color: white;
}

.chat-document-type-txt {
  background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
  color: white;
}

.chat-document-type-other {
  background: linear-gradient(135deg, #805ad5 0%, #6b46c1 100%);
  color: white;
}

.chat-document-body {
  padding: 0.9rem 1rem;
}

.chat-document-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f3a5f;
  margin-bottom: 0.35rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-document-meta {
  font-size: 12px;
  color: #6c7b90;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-document-size {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-documents-search-bar {
  margin-bottom: 1.25rem;
}

.chat-documents-search-bar .form-control {
  border-radius: 10px;
  border: 1px solid #e0e5ea;
  padding: 0.6rem 1rem;
  font-size: 14px;
}

.chat-documents-search-bar .form-control:focus {
  border-color: var(--mv-primary);
  box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.1);
}

.chat-documents-upload-zone {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--mv-gray-50);
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.chat-documents-upload-zone:hover {
  border-color: var(--mv-primary);
  background: rgba(0, 85, 255, 0.05);
}

.chat-documents-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #8e8ea0;
}

.chat-documents-empty i {
  font-size: 64px;
  color: #cbd5e0;
  margin-bottom: 1rem;
}

.chat-documents-modal .modal-footer {
  border-top: 1px solid var(--mv-gray-200);
  padding: 1rem 1.5rem;
  background: var(--mv-gray-50);
}

.chat-selected-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--mv-primary);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Scrollbar personnalisée - Style ChatGPT */
.chat-messages-container::-webkit-scrollbar,
.chat-documents-list::-webkit-scrollbar {
  width: 8px;
}

.chat-messages-container::-webkit-scrollbar-track,
.chat-documents-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages-container::-webkit-scrollbar-thumb,
.chat-documents-list::-webkit-scrollbar-thumb {
  background: #d9d9e3;
  border-radius: 4px;
}

.chat-messages-container::-webkit-scrollbar-thumb:hover,
.chat-documents-list::-webkit-scrollbar-thumb:hover {
  background: #8e8ea0;
}

/* ========================================
   MODE INLINE (Intégré dans la page)
   ======================================== */

.chat-inline-mode {
  position: static !important;
  bottom: auto !important;
  right: auto !important;
  height: 100%;
}

.chat-inline-mode .chat-toggle-button {
  display: none !important;
}

.chat-panel-inline {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  bottom: auto !important;
  right: auto !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: all !important;
  box-shadow: none !important;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
}

.chat-panel-inline .chat-header-actions button[id*="minimize"] {
  display: none !important;
}

/* Fix z-index pour les modals du chat */
#chat-documents-modal {
  z-index: 10000 !important;
}

.chat-inline-mode {
  z-index: auto !important;
  position: relative !important;
}

.chat-panel-inline {
  position: relative !important;
  z-index: 1 !important;
}

.chat-inline-mode ~ #chat-documents-modal.show {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

/* Responsive - Mode mobile */
@media (max-width: 768px) {
  .chat-toggle-button {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }
  
  .chat-panel {
    width: calc(100vw - 16px) !important;
    height: calc(100vh - 80px) !important;
    right: 8px;
    bottom: 70px;
    border-radius: 8px;
  }
  
  .chat-message {
    padding: 16px 12px;
  }
  
  .chat-message-wrapper {
    max-width: 100%;
  }
  
  .chat-input-container {
    padding: 12px;
  }
  
  .chat-input-wrapper {
    max-width: 100%;
  }
}

/* Barre de recherche condensée - État initial */
.chat-compact-trigger {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-compact-input-wrapper {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-compact-trigger:hover .chat-compact-input-wrapper {
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.35);
  transform: translateY(-2px);
}

.chat-compact-icon {
  width: 24px;
  height: 24px;
  stroke: white;
  flex-shrink: 0;
}

.chat-compact-search-text {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.chat-compact-trigger:hover .chat-compact-search-text {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.chat-compact-badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Panneau complet - Version expandée */
.chat-compact-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-compact-panel.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Header du chat compact */
.chat-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-compact-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-compact-header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.chat-compact-header-text h6 {
  color: white;
  margin: 0;
  font-weight: 600;
  font-size: 16px;
}

.chat-compact-header-text small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.chat-compact-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-compact-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Messages container pour version compacte */
#chat-compact-messages-container {
  flex: 1;
  overflow-y: auto;
  background: var(--mv-gray-50);
}

#chat-compact-messages {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Responsive pour version compacte */
@media (min-width: 768px) {
  .chat-compact-panel {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 800px;
    height: 85vh;
    max-height: 700px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }
  
  .chat-compact-panel.open {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .chat-compact-header {
    border-radius: 20px 20px 0 0;
  }
}

/* Overlay pour mobile */
.chat-compact-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.chat-compact-overlay.visible {
  opacity: 1;
  visibility: visible;
}
