:root {
	--rousseau-chat-bg: #ffffff;
	--rousseau-chat-text: #1a1a1a;
	--rousseau-chat-accent: #000000;
	--rousseau-chat-bubble-user: #f3f3f3;
	--rousseau-chat-bubble-ai: #ffffff;
	--rousseau-chat-border: #e5e5e5;
	--rousseau-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#rousseau-chat-wrapper {
	font-family: var(--rousseau-font-family);
	max-width: 900px;
	margin: 0 auto;
	padding: 20px;
	min-height: 400px;
	display: flex;
	flex-direction: column;
	position: relative;
	transition: all 0.3s ease;
}

#rousseau-chat-wrapper * {
	box-sizing: border-box;
}

/* Initial State: Centered */
#rousseau-chat-wrapper.rousseau-chat-initial .rousseau-chat-container {
	min-height: 400px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

#rousseau-chat-wrapper.rousseau-chat-initial .rousseau-chat-messages {
	display: none;
}

/* Active State */
#rousseau-chat-wrapper.rousseau-chat-active .rousseau-chat-container {
	display: flex;
	flex-direction: column;
	height: 500px; /* Fixed height for chat window */
	border: 1px solid var(--rousseau-chat-border);
	border-radius: 12px;
	overflow: hidden;
	overflow-x: hidden; /* Prevent horizontal scroll */
}

#rousseau-chat-wrapper.rousseau-chat-active .rousseau-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	background: #fafafa;
}

/* Input Area */
.rousseau-chat-input-area {
	width: 100%;
	max-width: 800px;
	position: relative;
}

#rousseau-chat-wrapper.rousseau-chat-active .rousseau-chat-input-area {
	max-width: 100%;
	padding: 16px;
	background: #fff;
	border-top: 1px solid var(--rousseau-chat-border);
}

#rousseau-chat-form {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 100%;
}

#rousseau-chat-input {
	width: 100%;
	padding: 16px 48px 16px 20px;
	border-radius: 24px;
	border: 1px solid var(--rousseau-chat-border);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	outline: none;
	transition: border-color 0.2s;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	resize: none;
	overflow-y: hidden; /* Hide scrollbar initially */
	min-height: 56px; /* Approx height of one line including padding */
	max-height: 200px;
}

#rousseau-chat-input:focus {
	border-color: var(--rousseau-chat-accent);
}

#rousseau-chat-submit {
	position: absolute;
	right: 8px;
	bottom: 8px; /* Position at bottom right */
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--rousseau-chat-accent);
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

#rousseau-chat-submit:hover {
	background: #f0f0f0;
}

/* Chat Messages */
.rousseau-message {
	max-width: 80%;
	padding: 12px 16px;
	border-radius: 12px;
	line-height: 1.5;
	font-size: 15px;
}

.rousseau-message.user {
	align-self: flex-end;
	background: var(--rousseau-chat-bubble-user);
	color: var(--rousseau-chat-text);
	border-bottom-right-radius: 4px;
}

.rousseau-message.ai {
	align-self: flex-start;
	background: var(--rousseau-chat-bubble-ai);
	border: 1px solid var(--rousseau-chat-border);
	color: var(--rousseau-chat-text);
	border-bottom-left-radius: 4px;
}

.rousseau-message p {
	margin: 0 0 8px 0;
}
.rousseau-message p:last-child {
	margin-bottom: 0;
}

/* Results Grid (Property Cards) */
#rousseau-chat-results {
	margin-top: 32px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	width: 100%;
	opacity: 0;
	transition: opacity 0.5s ease;
}

#rousseau-chat-results.visible {
	opacity: 1;
}

.rousseau-property-card {
	background: #fff;
	border: 1px solid var(--rousseau-chat-border);
	border-radius: 12px;
	overflow: hidden;
	transition: transform 0.2s, box-shadow 0.2s;
	text-decoration: none;
	color: inherit;
	display: block;
}

.rousseau-property-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.rousseau-card-image {
	width: 100%;
	height: 200px;
	object-fit: cover;
	background-color: #f0f0f0;
}

.rousseau-card-content {
	padding: 16px;
}

.rousseau-card-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 8px 0;
	line-height: 1.3;
}

.rousseau-card-price {
	font-size: 16px;
	font-weight: 500;
	color: #666;
}

.rousseau-card-meta {
	margin-top: 8px;
	font-size: 14px;
	color: #888;
}

/* Loading State */
.rousseau-typing-indicator {
	display: flex;
	gap: 4px;
	padding: 8px;
}
.rousseau-typing-dot {
	width: 6px;
	height: 6px;
	background: #ccc;
	border-radius: 50%;
	animation: rousseau-typing 1.4s infinite ease-in-out both;
}
.rousseau-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.rousseau-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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