/* Villa Zöldvölgy chat widget. Calm, neutral palette to match the site. */

#villa-chatbot-root {
	--vcb-accent: #4a5d4f;
	--vcb-accent-text: #ffffff;
	--vcb-user-bg: #4a5d4f;
	--vcb-bot-bg: #f0efe9;
	--vcb-text: #2a2a2a;
}

.vcb-bubble {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: var(--vcb-accent);
	color: var(--vcb-accent-text);
	font-size: 24px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.25 );
	z-index: 99999;
}

.vcb-panel {
	position: fixed;
	right: 20px;
	bottom: 88px;
	width: 360px;
	max-width: calc( 100vw - 40px );
	height: 480px;
	max-height: calc( 100vh - 120px );
	max-height: calc( 100dvh - 120px );
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba( 0, 0, 0, 0.25 );
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--vcb-text);
}

.vcb-hidden {
	display: none;
}

.vcb-header {
	background: var(--vcb-accent);
	color: var(--vcb-accent-text);
	padding: 12px 16px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.vcb-close {
	background: none;
	border: none;
	color: var(--vcb-accent-text);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.vcb-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vcb-msg {
	max-width: 80%;
	padding: 9px 12px;
	border-radius: 12px;
	line-height: 1.4;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.vcb-user {
	align-self: flex-end;
	background: var(--vcb-user-bg);
	color: #fff;
	border-bottom-right-radius: 3px;
}

.vcb-assistant {
	align-self: flex-start;
	background: var(--vcb-bot-bg);
	color: var(--vcb-text);
	border-bottom-left-radius: 3px;
}

.vcb-typing {
	opacity: 0.6;
	font-style: italic;
}

.vcb-form {
	display: flex;
	border-top: 1px solid #e5e5e5;
	padding: 8px;
	gap: 8px;
}

.vcb-input {
	flex: 1;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 14px;
	outline: none;
}

.vcb-input:focus {
	border-color: var(--vcb-accent);
}

.vcb-send {
	background: var(--vcb-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0 14px;
	cursor: pointer;
	font-size: 14px;
}

.vcb-send:disabled {
	opacity: 0.6;
	cursor: default;
}

/*
 * Mobile: full-width sheet anchored to the top. Height defaults to the dynamic
 * viewport (dvh) so the address bar collapsing does not make it jump. When the
 * on-screen keyboard opens, the widget.js visualViewport handler overrides
 * height + transform so the panel exactly fills the visible area above the
 * keyboard (iOS does not shrink the layout viewport for the keyboard, so CSS
 * alone cannot do this). Only the message log scrolls.
 */
@media ( max-width: 600px ) {
	.vcb-panel {
		top: 0;
		right: 0;
		bottom: auto;
		left: 0;
		width: 100%;
		max-width: 100%;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}

	.vcb-bubble {
		right: 16px;
		bottom: 16px;
	}
}
