/**
 * Styles front-end du widget de chat flottant AI ChatBot Assistant
 */

/* Conteneur principal */
#ai-chatbot-widget-container {
	position: fixed;
	bottom: 30px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

/* Positions */
#ai-chatbot-widget-container.ai-chatbot-pos-right {
	right: 30px;
	align-items: flex-end;
}

#ai-chatbot-widget-container.ai-chatbot-pos-left {
	left: 30px;
	align-items: flex-start;
}

/* Lanceur de chat (Bulle flottante) */
#ai-chatbot-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background-color: var(--chatbot-primary);
	color: #ffffff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	padding: 0;
}

#ai-chatbot-launcher:hover {
	transform: scale(1.08) translateY(-3px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#ai-chatbot-launcher:active {
	transform: scale(0.95);
}

.ai-chatbot-launcher-icon, .ai-chatbot-launcher-close-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: ai-chat-pop-in 0.3s ease-out;
}

/* Fenêtre de discussion */
#ai-chatbot-window {
	width: 370px;
	height: 520px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin-bottom: 15px;
	transform-origin: bottom right;
	animation: ai-chat-slide-up 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#ai-chatbot-widget-container.ai-chatbot-pos-left #ai-chatbot-window {
	transform-origin: bottom left;
}

/* En-tête de la fenêtre */
.ai-chatbot-header {
	padding: 15px 20px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ai-chatbot-header-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ai-chatbot-header-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.3);
}

.ai-chatbot-header-avatar-default {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	border: 2px solid rgba(255, 255, 255, 0.3);
}

.ai-chatbot-header-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #ffffff;
}

.ai-chatbot-header-status {
	font-size: 11px;
	opacity: 0.85;
	display: flex;
	align-items: center;
	gap: 4px;
}

.ai-chatbot-header-status::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	background-color: #2ec4b6;
	border-radius: 50%;
}

#ai-chatbot-close-btn {
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.2s;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
}

#ai-chatbot-close-btn:hover {
	opacity: 1;
}

/* Zone des messages */
.ai-chatbot-messages-container {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background-color: #f8f9fa;
}

/* Messages */
.ai-chatbot-message {
	max-width: 80%;
	display: flex;
	flex-direction: column;
	animation: ai-chat-msg-fade 0.3s ease-out;
}

.ai-chatbot-msg-content {
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

/* Style de message bot */
.ai-chatbot-msg-bot {
	align-self: flex-start;
}

.ai-chatbot-msg-bot .ai-chatbot-msg-content {
	background-color: #ffffff;
	color: #2d3748;
	border-radius: 16px 16px 16px 4px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
	border: 1px solid #edf2f7;
}

/* Style de message utilisateur */
.ai-chatbot-msg-user {
	align-self: flex-end;
}

.ai-chatbot-msg-user .ai-chatbot-msg-content {
	background-color: var(--chatbot-primary);
	color: #ffffff;
	border-radius: 16px 16px 4px 16px;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

/* Indicateur d'écriture (Typing Indicator) */
.ai-chatbot-typing-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
}

.ai-chatbot-typing-dot {
	width: 6px;
	height: 6px;
	background-color: #a0aec0;
	border-radius: 50%;
	animation: ai-chat-bounce 1.4s infinite ease-in-out both;
}

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

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

/* Zone d'écriture */
.ai-chatbot-input-area {
	display: flex;
	border-top: 1px solid #edf2f7;
	background-color: #ffffff;
	padding: 12px 15px;
	align-items: center;
}

#ai-chatbot-input-field {
	flex: 1;
	border: none;
	outline: none;
	font-size: 14px;
	padding: 8px 10px;
	color: #2d3748;
	background: transparent;
}

#ai-chatbot-input-field::placeholder {
	color: #a0aec0;
}

#ai-chatbot-send-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s;
}

#ai-chatbot-send-btn:hover {
	transform: scale(1.1);
}

#ai-chatbot-send-btn:active {
	transform: scale(0.9);
}

/* Scrollbar Customization */
.ai-chatbot-messages-container::-webkit-scrollbar {
	width: 5px;
}

.ai-chatbot-messages-container::-webkit-scrollbar-track {
	background: transparent;
}

.ai-chatbot-messages-container::-webkit-scrollbar-thumb {
	background-color: #cbd5e0;
	border-radius: 10px;
}

/* Animations */
@keyframes ai-chat-slide-up {
	from {
		opacity: 0;
		transform: scale(0.92) translateY(20px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@keyframes ai-chat-pop-in {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes ai-chat-msg-fade {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ai-chat-bounce {
	0%, 80%, 100% { 
		transform: scale(0);
	} 40% { 
		transform: scale(1.0);
	}
}

/* Responsive Mobile */
@media screen and (max-width: 480px) {
	#ai-chatbot-widget-container {
		bottom: 0 !important;
		right: 0 !important;
		left: 0 !important;
		width: 100% !important;
		height: 100% !important;
		pointer-events: none;
	}
	
	#ai-chatbot-launcher, #ai-chatbot-window {
		pointer-events: auto;
	}

	#ai-chatbot-launcher {
		position: fixed;
		bottom: 20px;
	}
	#ai-chatbot-widget-container.ai-chatbot-pos-right #ai-chatbot-launcher {
		right: 20px;
	}
	#ai-chatbot-widget-container.ai-chatbot-pos-left #ai-chatbot-launcher {
		left: 20px;
	}

	#ai-chatbot-window {
		position: fixed;
		top: 0;
		left: 0;
		width: 100% !important;
		height: 100% !important;
		border-radius: 0;
		margin-bottom: 0;
	}
	
	.ai-chatbot-header {
		padding: 18px 20px;
	}
}
