/* RAG Homes Chatbot Frontend Styles */

.rag-homes-chatbot-ui {
	--rh-chatbot-theme: #0073aa;
	max-width: 390px;
	width: 100%;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 6px 36px rgba(0,0,0,0.09), 0 1.5px 4px rgba(0,0,0,0.06);
	border: 1px solid #e2e8f0;
	font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 480px;
	margin: 0 auto;
	overflow: hidden;
}

.rag-homes-chatbot-ui .chat-header {
	background: var(--rh-chatbot-theme, #0073aa);
	color: #fff;
	padding: 16px 20px 14px 18px;
	font-size: 1.13em;
	font-weight: 600;
	border-radius: 18px 18px 0 0;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
}

.rag-homes-chatbot-ui .chat-header .chat-reset {
	background: none !important;
	color: #fff !important;
	box-shadow: none;
	margin-left: auto;
	margin-right: 0;
	padding-left: 12px;
	border: none;
	cursor: pointer;
	font-size: 15px;
}

.rag-homes-chatbot-ui .chat-messages {
	padding: 22px 14px 12px 14px;
	flex: 1 1 auto;
	overflow-y: auto;
	background: #f9fbfc;
	min-height: 200px;
	max-height: 400px;
	scroll-behavior: smooth;
}

.rag-homes-chatbot-ui .chat-placeholder {
	color: #94a3b8;
	font-size: 15px;
	text-align: center;
	margin-top: 18px;
}

.rag-homes-chatbot-ui .chat-message {
	display: flex;
	margin-bottom: 12px;
}

.rag-homes-chatbot-ui .chat-user {
	flex-direction: row-reverse;
}

.rag-homes-chatbot-ui .chat-bubble {
	padding: 12px 16px;
	border-radius: 16px;
	background: #e6f1f9;
	color: #28323a;
	max-width: 82%;
	font-size: 15px;
	line-height: 1.55;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	position: relative;
}

.rag-homes-chatbot-ui .chat-message.chat-user .chat-bubble {
	background: var(--rh-chatbot-theme, #0073aa);
	color: #fff;
	margin-left: auto;
	margin-right: 0;
}

.rag-homes-chatbot-ui .chat-message.chat-assistant .chat-bubble {
	background: #e6f1f9;
	color: #28323a;
	margin-right: auto;
}

.rag-homes-chatbot-ui .chat-content {
	word-break: break-word;
	white-space: pre-line;
}

.rag-homes-chatbot-ui .chat-sources {
	margin-top: 10px;
	font-size: 12.5px;
	color: #2980b9;
	background: #f2f8fa;
	border-radius: 7px;
	padding: 6px 9px 5px 10px;
}

.rag-homes-chatbot-ui .chat-sources ul {
	margin: 3px 0 0 0;
	padding: 0 0 0 16px;
}

.rag-homes-chatbot-ui .chat-sources a {
	color: #0073aa;
	text-decoration: underline;
}

.rag-homes-chatbot-ui .chat-input-row {
	border-top: 1px solid #e2e8f0;
	background: #f7fafc;
	padding: 11px 12px 13px 12px;
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.rag-homes-chatbot-ui .chat-input textarea,
.rag-homes-chatbot-ui .chat-input .components-textarea-control__input {
	resize: none;
	border-radius: 8px;
	border: 1px solid #dde4ea;
	box-shadow: none;
	font-size: 15px;
	background: #fff;
	color: #1e293b;
	width: 100%;
	min-height: 36px;
	max-height: 70px;
	padding: 10px 12px;
	outline: none;
	transition: border 0.15s;
}

.rag-homes-chatbot-ui .chat-input textarea:focus,
.rag-homes-chatbot-ui .chat-input .components-textarea-control__input:focus {
	border: 1.5px solid var(--rh-chatbot-theme, #0073aa);
}

.rag-homes-chatbot-ui .components-button.is-primary {
	background: var(--rh-chatbot-theme, #0073aa);
	border: none;
	border-radius: 7px;
	font-weight: 600;
	font-size: 15px;
	box-shadow: none;
	transition: background 0.14s;
}

.rag-homes-chatbot-ui .components-button.is-primary:disabled {
	background: #b9c4ce;
	color: #fff;
	opacity: 0.67;
}

.rag-homes-chatbot-ui .components-spinner {
	margin: 0 2px;
	vertical-align: middle;
	color: var(--rh-chatbot-theme, #0073aa);
}

.rag-homes-chatbot-ui .components-notice {
	margin: 16px 16px 0 16px;
	font-size: 15px;
	border-radius: 5px;
}

@media (max-width: 540px) {
	.rag-homes-chatbot-ui {
		max-width: 100%;
		border-radius: 0;
		min-height: 340px;
	}
	.rag-homes-chatbot-ui .chat-header {
		border-radius: 0;
	}
}

/* Optional: fade-in animation */
.rag-homes-chatbot-ui {
	animation: rh-chatbot-fadein 0.6s;
}
@keyframes rh-chatbot-fadein {
	from { opacity: 0; transform: translateY(25px);}
	to { opacity: 1; transform: none;}
}