/* LinkGente Chatbot Styles */
:root {
	--lg-chatbot-primary: #0066cc; /* LinkGente Primary Blue */
	--lg-chatbot-primary-hover: #0052a3;
	--lg-chatbot-bg: #ffffff;
	--lg-chatbot-text: #333333;
	--lg-chatbot-muted: #666666;
	--lg-chatbot-border: #e2e8f0;
	--lg-chatbot-msg-bot: #f1f5f9;
	--lg-chatbot-msg-user: #0066cc;
	--lg-chatbot-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

#lg-chatbot-wrapper {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Launcher Button */
.lg-chatbot-launcher {
	width: 60px;
	height: 60px;
	background-color: var(--lg-chatbot-primary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 102, 204, 0.39);
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
	position: absolute;
	bottom: 0;
	right: 0;
	z-index: 2;
}

.lg-chatbot-launcher:hover {
	transform: scale(1.05);
	background-color: var(--lg-chatbot-primary-hover);
}

.lg-chatbot-launcher svg {
	width: 28px;
	height: 28px;
}

/* Chat Window */
.lg-chatbot-window {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 350px;
	height: 550px;
	max-height: calc(100vh - 100px);
	background: var(--lg-chatbot-bg);
	border-radius: 16px;
	box-shadow: var(--lg-chatbot-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateY(20px) scale(0.95);
	transform-origin: bottom right;
	transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
	border: 1px solid rgba(0,0,0,0.05);
}

#lg-chatbot-wrapper.lg-chatbot-open .lg-chatbot-window {
	opacity: 1;
	pointer-events: all;
	transform: translateY(0) scale(1);
}

#lg-chatbot-wrapper.lg-chatbot-open .chatbot-icon-open {
	display: none;
}
#lg-chatbot-wrapper.lg-chatbot-open .chatbot-icon-close {
	display: block;
}

/* Header */
.lg-chatbot-header {
	background: var(--lg-chatbot-primary);
	color: white;
	padding: 15px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

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

.lg-chatbot-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.lg-chatbot-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lg-chatbot-avatar svg {
	width: 24px;
	height: 24px;
}

.lg-chatbot-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: white;
	line-height: 1.2;
}

.lg-chatbot-header span {
	font-size: 12px;
	opacity: 0.8;
}

/* Messages Area */
.lg-chatbot-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 15px;
	background: #f8fafc;
	scroll-behavior: smooth;
}

.lg-chatbot-messages::-webkit-scrollbar {
	width: 6px;
}
.lg-chatbot-messages::-webkit-scrollbar-track {
	background: transparent;
}
.lg-chatbot-messages::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.lg-msg {
	display: flex;
	max-width: 85%;
	animation: lgChatbotMsgIn 0.3s ease forwards;
	opacity: 0;
	transform: translateY(10px);
}

@keyframes lgChatbotMsgIn {
	to { opacity: 1; transform: translateY(0); }
}

.lg-msg-bot {
	align-self: flex-start;
}

.lg-msg-user {
	align-self: flex-end;
}

.lg-msg-bubble {
	padding: 12px 16px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
}

.lg-msg-bot .lg-msg-bubble {
	background: var(--lg-chatbot-bg);
	color: var(--lg-chatbot-text);
	border: 1px solid var(--lg-chatbot-border);
	border-bottom-left-radius: 4px;
}

.lg-msg-user .lg-msg-bubble {
	background: var(--lg-chatbot-msg-user);
	color: white;
	border-bottom-right-radius: 4px;
}

.lg-msg-bot .lg-msg-bubble a {
	color: var(--lg-chatbot-primary);
	text-decoration: underline;
}

/* Quick Buttons */
.lg-chatbot-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.lg-chatbot-suggestion-btn {
	background: transparent;
	border: 1px solid var(--lg-chatbot-primary);
	color: var(--lg-chatbot-primary);
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.lg-chatbot-suggestion-btn:hover {
	background: var(--lg-chatbot-primary);
	color: white;
}

.lg-chatbot-suggestion-link {
	display: inline-block;
	background: #e0f2fe;
	color: #0284c7;
	border: 1px solid #bae6fd;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s;
}

.lg-chatbot-suggestion-link:hover {
	background: #bae6fd;
}

/* Input Area */
.lg-chatbot-input-area {
	padding: 15px;
	background: var(--lg-chatbot-bg);
	border-top: 1px solid var(--lg-chatbot-border);
}

#lg-chatbot-form {
	display: flex;
	gap: 10px;
	align-items: center;
}

#lg-chatbot-input {
	flex: 1;
	border: 1px solid var(--lg-chatbot-border);
	padding: 12px 15px;
	border-radius: 24px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
	background: #f8fafc;
}

#lg-chatbot-input:focus {
	border-color: var(--lg-chatbot-primary);
	background: #fff;
}

#lg-chatbot-submit {
	width: 40px;
	height: 40px;
	background: var(--lg-chatbot-primary);
	color: white;
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.2s;
	padding: 0;
	flex-shrink: 0;
}

#lg-chatbot-submit:hover {
	background: var(--lg-chatbot-primary-hover);
}

#lg-chatbot-submit svg {
	width: 18px;
	height: 18px;
	margin-left: -2px; /* optical alignment */
}

/* Typing indicator */
.lg-typing-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 16px;
	background: var(--lg-chatbot-bg);
	border: 1px solid var(--lg-chatbot-border);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
	width: max-content;
}

.lg-typing-dot {
	width: 6px;
	height: 6px;
	background: #94a3b8;
	border-radius: 50%;
	animation: lgTyping 1.4s infinite ease-in-out both;
}

.lg-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.lg-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Responsive */
@media (max-width: 480px) {
	.lg-chatbot-window {
		position: fixed;
		bottom: 0;
		right: 0;
		width: 100%;
		height: 100%;
		max-height: 100vh;
		border-radius: 0;
		z-index: 9999999;
	}
	
	#lg-chatbot-wrapper {
		bottom: 15px;
		right: 15px;
	}
	
	#lg-chatbot-wrapper.lg-chatbot-open .lg-chatbot-launcher {
		display: none; /* Hide launcher on mobile when open to show full chat */
	}
	
	/* Add a close button specifically for mobile inside the header */
	.lg-chatbot-mobile-close {
		display: block;
		background: transparent;
		border: none;
		color: white;
		cursor: pointer;
		padding: 5px;
	}
}

.lg-chatbot-mobile-close {
	display: none; /* Only visible on mobile normally, but let's make it always available for better UX */
}

@media (min-width: 481px) {
	.lg-chatbot-mobile-close {
		display: block;
		background: transparent;
		border: none;
		color: white;
		cursor: pointer;
		opacity: 0.8;
	}
	.lg-chatbot-mobile-close:hover {
		opacity: 1;
	}
}
