/* Conteneur principal du chat */
.mistral-chat-container {
	width: 100%;
	max-width: none;
	margin: 0 auto;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	background-color: #f8f9fa;
	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
	display: flex;
	flex-direction: column;
	height: 600px;
	border: 1px solid #e0e6e8; /* Bordure gris-vert clair */
}

/* En-tête du chat */
.mistral-chat-header {
	padding: 16px 20px;
	background-color: #4a675a; /* Vert foncé élégant */
	color: white;
	text-align: center;
}

.mistral-chat-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 500;
	letter-spacing: 0.5px;
}

.mistral-chat-header p {
	margin: 4px 0 0;
	font-size: 14px;
	opacity: 0.9;
}

/* Zone des messages */
.mistral-chat-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	background-color: #ffffff;
	border-bottom: 1px solid #e0e6e8;
	min-height: 400px;
	max-height: 500px;
}

/* Messages utilisateur (alignés à droite) */
.user-message {
	background-color: #d4e8e4; /* Vert très clair */
	color: #2d3a3a; /* Texte vert foncé */
	padding: 12px 16px;
	margin: 8px 0;
	border-radius: 18px 18px 4px 18px;
	max-width: 85%;
	margin-left: auto;
	word-wrap: break-word;
	white-space: pre-line;
	line-height: 1.6;
	font-size: 15px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	border: 1px solid #b8d4cc; /* Bordure subtile */
}

/* Messages de l'assistant (alignés à gauche) */
.mistral-message {
	background-color: #f0f4f2; /* Gris-vert très clair */
	color: #2d3a3a; /* Texte vert foncé */
	padding: 12px 16px;
	margin: 8px 0;
	border-radius: 18px 18px 18px 4px;
	max-width: 85%;
	word-wrap: break-word;
	white-space: pre-line;
	line-height: 1.6;
	font-size: 15px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	border: 1px solid #d0d8d4; /* Bordure subtile */
}

/* Style pour les listes à puces et numérotées */
.mistral-message ul,
.mistral-message ol {
	margin: 8px 0 8px 20px;
	padding-left: 15px;
	color: #2d3a3a;
}

.mistral-message li {
	margin: 4px 0;
}

/* Style pour les liens */
.mistral-message a {
	color: #4a675a; /* Vert foncé pour les liens */
	text-decoration: none;
	font-weight: 500;
}

.mistral-message a:hover {
	text-decoration: underline;
}

/* Style pour les éléments en gras */
.mistral-message strong,
.mistral-message b {
	font-weight: 600;
	color: #2d3a3a;
}

/* Style pour les éléments en italique */
.mistral-message em,
.mistral-message i {
	font-style: italic;
	color: #5a7567; /* Vert moyen */
}

/* Style pour les titres */
.mistral-message h1,
.mistral-message h2,
.mistral-message h3,
.mistral-message h4 {
	margin: 10px 0 5px 0;
	font-weight: 600;
	color: #2d3a3a;
}

/* Zone d'entrée */
.mistral-chat-input {
	display: flex;
	padding: 12px;
	background-color: #f0f4f2; /* Gris-vert très clair */
	border-top: 1px solid #e0e6e8;
}

/* Champ de saisie (textarea) */
#mistral-user-message {
	flex: 1;
	padding: 12px 16px;
	border: 1px solid #b8d4cc;
	border-radius: 24px;
	outline: none;
	font-size: 15px;
	margin-right: 8px;
	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
	resize: none;
	min-height: 48px;
	line-height: 1.5;
	color: #2d3a3a;
	background-color: #ffffff;
}

#mistral-user-message:focus {
	border-color: #4a675a;
}

/* Bouton d'envoi */
#mistral-send-message {
	padding: 12px 20px;
	background-color: #4a675a; /* Vert foncé */
	color: white;
	border: none;
	border-radius: 24px;
	cursor: pointer;
	font-size: 15px;
	font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
	min-width: 80px;
	transition: background-color 0.2s;
}

#mistral-send-message:hover {
	background-color: #3a5245; /* Vert plus foncé au survol */
}

/* Messages d'erreur */
.error-message {
	background-color: #f8e8e8; /* Rouge très clair */
	color: #8a3d3d; /* Rouge foncé */
	padding: 12px 16px;
	margin: 8px 0;
	border-radius: 18px;
	max-width: 85%;
	word-wrap: break-word;
	white-space: pre-line;
	line-height: 1.6;
	font-size: 15px;
	border: 1px solid #e8c8c8;
}

/* Champ de saisie désactivé */
#mistral-user-message:disabled {
	background-color: #e8ece8;
	cursor: not-allowed;
}

/* Bouton désactivé */
#mistral-send-message:disabled {
	background-color: #a8b8b0;
	cursor: not-allowed;
}

/* Barre de défilement personnalisée */
.mistral-chat-messages::-webkit-scrollbar {
	width: 8px;
}

.mistral-chat-messages::-webkit-scrollbar-track {
	background: #f0f4f2;
	border-radius: 10px;
}

.mistral-chat-messages::-webkit-scrollbar-thumb {
	background: #b8d4cc;
	border-radius: 10px;
}

.mistral-chat-messages::-webkit-scrollbar-thumb:hover {
	background: #9bc5b7;
}

/* Barre de défilement pour Firefox */
.mistral-chat-messages {
	scrollbar-width: thin;
	scrollbar-color: #b8d4cc #f0f4f2;
}

/* Effet de survol sur les messages */
.user-message:hover,
.mistral-message:hover {
	opacity: 0.95;
	transform: translateY(-1px);
	transition: transform 0.2s, opacity 0.2s;
}

/* Animation pour les nouveaux messages */
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.user-message,
.mistral-message {
	animation: fadeIn 0.3s ease-out;
}

/* Adaptation pour les petits écrans */
@media (max-width: 768px) {
	.mistral-chat-container {
		margin: 0;
		border-radius: 0;
		height: 80vh;
	}

	.user-message,
	.mistral-message {
		max-width: 90%;
	}
}
