/*
 * Interface inspirée du chat Orange.
 * La mise en page comporte un en-tête sombre avec la marque et le logo,
 * une zone de conversation défilante,
 * et un pied de page avec un champ de saisie, un bouton pour joindre un fichier et un bouton d’envoi orange.
 */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f6f6f6;
}

.chat-container {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  height: 90vh;
  margin: 20px auto;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* En-tête */
.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background-color: #000;
  color: #ffffff;
}

/* Logo Orange simplifié : carré orange avec barre blanche */
.logo {
  width: 28px;
  height: 28px;
  background-color: #ff7900;
  border-radius: 4px;
  position: relative;
  margin-right: 10px;
}

.logo::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 6px;
  height: 6px;
  background-color: #fff;
}

.brand {
  font-size: 20px;
  font-weight: 600;
}

/* Zone de conversation */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: #f9fafb;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 12px;
  line-height: 1.5;
  font-size: 14px;
  word-wrap: break-word;
}

.message.bot {
  align-self: flex-start;
  background-color: #f0f0f0;
  color: #333;
  border-top-left-radius: 0;
}

.message.user {
  align-self: flex-end;
  background-color: #e6f0ff;
  color: #004080;
  border-top-right-radius: 0;
}

/* Styles pour les images dans les messages */
.image-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-image {
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-text {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* Zone de saisie */
.chat-input {
  display: flex;
  align-items: center;
  padding: 12px;
  border-top: 1px solid #e6e6e6;
  background-color: #ffffff;
}

#msgInput {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  margin-right: 8px;
  outline: none;
}

#msgInput::placeholder {
  color: #999;
}

#attachBtn {
  background: none;
  border: none;
  font-size: 20px;
  margin-right: 8px;
  cursor: pointer;
  color: #666;
  padding: 4px;
}

#attachBtn:hover {
  color: #333;
}

#sendBtn {
  background-color: #ff7900;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

#sendBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Styles pour le diagnostic structuré */
.diagnostic-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diagnostic-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.7);
  border-left: 4px solid transparent;
}

.diagnostic-main {
  border-left-color: #4CAF50;
  background-color: rgba(76, 175, 80, 0.1);
}

.diagnostic-cause {
  border-left-color: #FF9800;
  background-color: rgba(255, 152, 0, 0.1);
}

.diagnostic-action {
  border-left-color: #2196F3;
  background-color: rgba(33, 150, 243, 0.1);
}

.diagnostic-warning {
  border-left-color: #F44336;
  background-color: rgba(244, 67, 54, 0.1);
}

.diagnostic-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.diagnostic-content {
  flex: 1;
  line-height: 1.5;
}

.diagnostic-content strong {
  color: #333;
  font-weight: 600;
}