/* Fonctionnement de base */
:root {
	--agent-bg-color: #f9f9f2;
	--agent-primary-color: #3a42ff;
	--agent-text-color: #000;
}

.chat-container {
	background-color: var(--agent-bg-color);
	border: 1px solid rgba(157,157,157,.4);
	border-radius: 1.5rem;
	padding: 3rem 2rem;
	min-height: 60vh;
	display: flex;
	flex-direction: column;
}

.chat-welcome {
	text-align: center;
	margin-bottom: 2rem;
}

.chat-welcome h1 {
	font-size: 2.5rem;
	font-weight: 400;
	margin-bottom: 2rem;
	color: var(--agent-text-color);
}

.chat-messages {
	flex: 1;
	overflow-y: auto;
	margin-bottom: 2rem;
	max-height: 588px;
}

.message {
	margin-bottom: 1.5rem;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

div.message:not(.agent):not([id]) {
	background-color: rgba(255, 255, 255, 0.6);
	border: 1px solid #e0e0e0;
	padding: 1rem 1.25rem;
	border-radius: 0.75rem;
}

.message.agent {
	gap: 0;
}

.message-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background-color: #d4d4d4;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.875rem;
	font-weight: 600;
	color: #fff;
	flex-shrink: 0;
}

.message-avatar.user {
	background-color: var(--agent-text-color);
}

.message-avatar.agent {
	display: none;
}

.message-content {
	flex: 1;
	padding: 0.15rem 1rem 0.15rem 1rem;
	font-size: 1rem;
	line-height: 1.6;
}

.agent .message-content {
	border: none;
	padding: 1rem 1.25rem;
}

.message.agent .message-content {
	background-color: transparent;
	padding: 0;
	border-radius: 0;
}

.message-content ul {
	margin: 0.5rem 0;
	padding-left: 1.5rem;
}

.message-content strong {
	font-weight: 600;
}

.chat-input-wrapper {
	position: relative;
	max-width: 100%;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-wrapper.moved-up {
	animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
	from {
		transform: translateY(20px);
		opacity: 0.7;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.chat-input {
	width: 100%;
	border: 1px solid #e0e0e0;
	border-radius: 1rem;
	padding: 1rem 3.5rem 1rem 1.25rem;
	font-size: 1rem;
	background-color: #fff;
	resize: none;
	min-height: 60px;
	max-height: 150px;
}

.chat-input:focus {
	outline: none;
	border-color: var(--agent-primary-color);
	box-shadow: 0 0 0 3px rgba(58, 66, 255, 0.1);
}

.chat-input::placeholder {
	color: #999;
}

.chat-submit {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 0.5rem;
	background-color: var(--agent-primary-color);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
}

.chat-submit:hover {
	background-color: #2a32df;
	transform: translateY(-1px);
}

.chat-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.chat-stop {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 0.5rem;
	background-color: #dc3545;
	color: #fff;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.2s;
}

.chat-stop.active {
	display: flex;
}

.chat-stop:hover {
	background-color: #bb2d3b;
	transform: translateY(-1px);
}

.chat-stop svg {
	width: 16px;
	height: 16px;
}

.chat-submit svg {
	width: 20px;
	height: 20px;
}

.loading-indicator {
	display: flex;
	gap: 0.5rem;
	padding: 1rem;
}

.loading-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--agent-primary-color);
	animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes bounce {
	0%, 80%, 100% {
		transform: scale(0);
	}
	40% {
		transform: scale(1);
	}
}

.hidden {
	display: none;
}
/* Fonctionnement de base */

/* Scrollbar personnalisée */
.chat-messages::-webkit-scrollbar {
	width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.3);
}


/* Animations keyframes */
@keyframes fadeInBottom {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeOutBottom {
	0% {
		opacity: 1;
		transform: translateY(0);
		display: block;
	}
	99% {
		opacity: 0;
		transform: translateY(20px);
		display: block;
	}
	100% {
		opacity: 0;
		transform: translateY(20px);
		display: none;
	}
}

/* État par défaut */
#agent-dialog {
	display: none;
}

.classic-mode {
	animation: fadeInBottom 0.3s ease-out forwards;
}

/* Mode beta activé */
body.beta-mode #agent-dialog {
	display: block;
	animation: fadeInBottom 0.3s ease-out 0.5s forwards;
	opacity: 0;
}

body.beta-mode .classic-mode {
	animation: fadeOutBottom 0.3s ease-out forwards;
	display:none;
}

/* Retour au mode classique */
body:not(.beta-mode) #agent-dialog {
	animation: fadeOutBottom 0.3s ease-out forwards;
}

body:not(.beta-mode) .classic-mode {
	animation: fadeInBottom 0.3s ease-out 0.5s forwards;
	opacity: 0;
}

body.beta-mode .search-form-header,
body.beta-mode .hd-card .col.d-none.d-md-block {
	display: none !important;
}
body.beta-mode .search-form-header,
body.beta-mode .hd-card .col.d-none.d-md-block {
	opacity: 0;
	max-width: 0;
	overflow: hidden;
	transition: opacity 0.5s ease, max-width 0.5s ease;
}

body.beta-mode .col-auto.ms-auto.col-md.ms-lg-0 {
	flex: 0 0 auto !important;
	width: auto !important;
	margin-left: auto !important;
	transition: all 0.5s ease;
}

body.beta-mode .hd-card.rounded-pill {
	transition: all 0.5s ease;
	padding-top: 0.5rem !important;
	padding-bottom: 0.5rem !important;
}

/* États normaux pour la transition */
.search-form-header,
.hd-card .col.d-none.d-md-block {
	opacity: 1;
	max-width: 100%;
	transition: opacity 0.5s ease, max-width 0.5s ease;
}

.col-auto.ms-auto.col-md.ms-lg-0 {
	transition: all 0.5s ease;
}

.hd-card.rounded-pill {
	transition: all 0.5s ease;
}