/*
 * Elmont Property Assistant - Styles
 * Vanilla CSS. No external frameworks or CDNs.
 */

.elmont-pa-root {
	--elmont-pa-primary: #093D6F;
	--elmont-pa-bg: #FFFFFF;
	--elmont-pa-text: #000000;
	--elmont-pa-radius: 16px;
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.elmont-pa-root, .elmont-pa-root * {
	box-sizing: border-box;
}

.elmont-pa-pos-right { right: 20px; }
.elmont-pa-pos-left { left: 20px; }

/* Launcher button */
.elmont-pa-launcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--elmont-pa-primary);
	color: #FFFFFF;
	border: none;
	border-radius: 999px;
	padding: 14px 20px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(9, 61, 111, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.elmont-pa-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(9, 61, 111, 0.45);
}

.elmont-pa-launcher:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

.elmont-pa-launcher-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

@media (max-width: 480px) {
	.elmont-pa-launcher-text {
		display: inline;
	}
	.elmont-pa-launcher {
		padding: 12px 16px;
	}
}

/* Chat window */
.elmont-pa-window {
	position: fixed;
	bottom: 20px;
	width: 400px;
	max-width: calc(100vw - 40px);
	height: 650px;
	max-height: calc(100vh - 40px);
	background: var(--elmont-pa-bg);
	border-radius: var(--elmont-pa-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.elmont-pa-pos-right .elmont-pa-window { right: 20px; }
.elmont-pa-pos-left .elmont-pa-window { left: 20px; }

.elmont-pa-window.elmont-pa-open {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.elmont-pa-window[hidden] {
	display: none;
}

@media (max-width: 480px) {
	.elmont-pa-window {
		width: calc(100vw - 16px);
		height: calc(100vh - 90px);
		bottom: 8px;
		right: 8px !important;
		left: 8px !important;
		max-width: calc(100vw - 16px);
	}
}

/* Header */
.elmont-pa-header {
	background: var(--elmont-pa-primary);
	color: #FFFFFF;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.elmont-pa-header-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.elmont-pa-header-subtitle {
	font-size: 12.5px;
	opacity: 0.85;
	margin-top: 2px;
}

.elmont-pa-close {
	background: transparent;
	border: none;
	color: #FFFFFF;
	cursor: pointer;
	padding: 6px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.elmont-pa-close:hover {
	background: rgba(255, 255, 255, 0.15);
}

.elmont-pa-close:focus-visible,
.elmont-pa-launcher:focus-visible,
.elmont-pa-btn:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

/* Body / messages */
.elmont-pa-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #F5F7FA;
}

.elmont-pa-message {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-line;
	word-wrap: break-word;
	animation: elmont-pa-fade-in 0.18s ease;
}

@keyframes elmont-pa-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}

.elmont-pa-message-bot {
	align-self: flex-start;
	background: #FFFFFF;
	color: var(--elmont-pa-text, #000000);
	border: 1px solid #E2E6EB;
	border-bottom-left-radius: 4px;
}

.elmont-pa-message-user {
	align-self: flex-end;
	background: var(--elmont-pa-primary);
	color: #FFFFFF;
	border-bottom-right-radius: 4px;
}

.elmont-pa-message ul {
	margin: 6px 0 0;
	padding-left: 18px;
}

.elmont-pa-message li {
	margin-bottom: 2px;
}

/* Typing indicator */
.elmont-pa-typing {
	align-self: flex-start;
	background: #FFFFFF;
	border: 1px solid #E2E6EB;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	padding: 12px 16px;
	display: inline-flex;
	gap: 4px;
}

.elmont-pa-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9AA5B1;
	display: inline-block;
	animation: elmont-pa-bounce 1.2s infinite ease-in-out;
}

.elmont-pa-typing span:nth-child(2) { animation-delay: 0.15s; }
.elmont-pa-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes elmont-pa-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick reply buttons inside a message group */
.elmont-pa-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-self: stretch;
}

.elmont-pa-btn {
	background: #FFFFFF;
	color: var(--elmont-pa-primary);
	border: 1.5px solid var(--elmont-pa-primary);
	border-radius: 999px;
	padding: 9px 14px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	min-height: 40px;
}

.elmont-pa-btn:hover {
	background: var(--elmont-pa-primary);
	color: #FFFFFF;
}

.elmont-pa-btn-primary {
	background: var(--elmont-pa-primary);
	color: #FFFFFF;
	border-color: var(--elmont-pa-primary);
}

.elmont-pa-btn-primary:hover {
	opacity: 0.9;
}

.elmont-pa-btn-cta {
	width: 100%;
	text-align: center;
	font-size: 14.5px;
	padding: 12px 16px;
}

/* Quick action / footer contact row */
.elmont-pa-quick-actions {
	padding: 0 16px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.elmont-pa-quick-actions:empty {
	display: none;
}

.elmont-pa-footer {
	flex-shrink: 0;
	text-align: center;
	font-size: 11.5px;
	color: #6B7684;
	padding: 10px 14px;
	border-top: 1px solid #E2E6EB;
	background: #FFFFFF;
}

/* Quote / lead form */
.elmont-pa-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
	background: #FFFFFF;
	border: 1px solid #E2E6EB;
	border-radius: 12px;
	padding: 12px;
}

.elmont-pa-form label {
	font-size: 12.5px;
	font-weight: 600;
	color: #33404D;
}

.elmont-pa-form input,
.elmont-pa-form textarea {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #D3D9E0;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
}

.elmont-pa-form input:focus,
.elmont-pa-form textarea:focus {
	outline: 2px solid var(--elmont-pa-primary);
	outline-offset: 1px;
}

.elmont-pa-form-error {
	color: #B3261E;
	font-size: 12.5px;
}

/* Links inside messages */
.elmont-pa-message a {
	color: var(--elmont-pa-primary);
}

/* Fallback (no JS) */
.elmont-pa-noscript-fallback,
.elmont-pa-fallback-static {
	background: #FFFFFF;
	border: 1px solid #E2E6EB;
	border-radius: 12px;
	padding: 14px;
	font-size: 14px;
	line-height: 1.6;
}

/* Screen-reader only utility */
.elmont-pa-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* -----------------------------------------------------------
 * Admin settings page
 * ----------------------------------------------------------- */
.elmont-pa-admin-wrap .elmont-pa-admin-columns {
	display: flex;
	gap: 32px;
	margin-top: 20px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.elmont-pa-admin-settings {
	flex: 1 1 520px;
	max-width: 640px;
}

.elmont-pa-admin-preview {
	flex: 0 0 420px;
	position: sticky;
	top: 40px;
}

.elmont-pa-preview-frame {
	background: #EEF1F5;
	border-radius: 12px;
	padding: 20px;
}

.elmont-pa-preview-window {
	position: static;
	width: 100%;
	height: 460px;
	max-width: 100%;
	box-shadow: 0 12px 30px rgba(0,0,0,0.15);
	opacity: 1;
	transform: none;
}
