/*
 * Styles for the marketing site chat widget (cm-chat.js). Every rule is scoped
 * to #cm-chat-widget so it cannot restyle the host page. Font size, line height
 * and the default text colour are inherited from the host page on purpose, so
 * the widget looks the same as the one it replaced.
 */
#cm-chat-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

#cm-chat-widget *,
#cm-chat-widget *::before,
#cm-chat-widget *::after {
	box-sizing: border-box;
}

#cm-chat-widget [hidden] {
	display: none !important;
}

#cm-chat-widget button {
	font-family: inherit;
}

#cm-chat-widget .cm-chat-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #03907f;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

#cm-chat-widget .cm-chat-trigger:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#cm-chat-widget .cm-chat-trigger:focus-visible,
#cm-chat-widget .cm-chat-send:focus-visible,
#cm-chat-widget .cm-chat-pill:focus-visible {
	outline: 2px solid #026f60;
	outline-offset: 2px;
}

#cm-chat-widget .cm-chat-trigger svg {
	width: 28px;
	height: 28px;
	fill: #fff;
	transition: transform 0.3s ease;
}

#cm-chat-widget .cm-chat-trigger--open svg {
	transform: rotate(90deg);
}

#cm-chat-widget .cm-chat-panel {
	position: fixed;
	right: 20px;
	bottom: 90px;
	display: flex;
	flex-direction: column;
	width: 500px;
	height: 600px;
	max-height: calc(100vh - 110px);
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	animation: cm-chat-open 0.3s ease;
}

#cm-chat-widget .cm-chat-header {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	padding: 16px;
	background: #03907f;
	color: #fff;
}

#cm-chat-widget .cm-chat-logo {
	width: 32px;
	height: 32px;
	filter: brightness(0) invert(1);
}

#cm-chat-widget .cm-chat-title {
	font-size: 16px;
	font-weight: 600;
}

#cm-chat-widget .cm-chat-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 16px;
	overflow-y: auto;
	background: #f9fafb;
}

#cm-chat-widget .cm-chat-messages::-webkit-scrollbar {
	width: 6px;
}

#cm-chat-widget .cm-chat-messages::-webkit-scrollbar-track {
	background: #f1f1f1;
}

#cm-chat-widget .cm-chat-messages::-webkit-scrollbar-thumb {
	border-radius: 3px;
	background: #888;
}

#cm-chat-widget .cm-chat-message {
	display: flex;
	margin-bottom: 16px;
}

#cm-chat-widget .cm-chat-message--user {
	justify-content: flex-end;
}

#cm-chat-widget .cm-chat-message--assistant {
	justify-content: flex-start;
}

#cm-chat-widget .cm-chat-content {
	max-width: 70%;
	padding: 10px 14px;
	border-radius: 8px;
	overflow-wrap: break-word;
	word-break: break-word;
}

#cm-chat-widget .cm-chat-message--user .cm-chat-content {
	background: #03907f;
	color: #fff;
}

#cm-chat-widget .cm-chat-message--assistant .cm-chat-content {
	background: #fff;
	color: #374151;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#cm-chat-widget .cm-chat-content a {
	color: #037d6b;
	text-decoration: underline;
}

#cm-chat-widget .cm-chat-content code {
	padding: 2px 4px;
	border-radius: 3px;
	background: #f1f3f4;
	font-family: monospace;
	font-size: 0.9em;
}

#cm-chat-widget .cm-chat-bullet {
	margin: 4px 0;
	padding-left: 16px;
}

#cm-chat-widget .cm-chat-cursor {
	display: inline-block;
	margin-left: 2px;
	color: #18a0a0;
	animation: cm-chat-blink 1s infinite;
}

#cm-chat-widget .cm-chat-typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 0;
}

#cm-chat-widget .cm-chat-typing span {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9ca3af;
	opacity: 0.4;
	animation: cm-chat-typing 1.4s infinite;
}

#cm-chat-widget .cm-chat-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

#cm-chat-widget .cm-chat-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

#cm-chat-widget .cm-chat-starters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	max-height: 100px;
	margin: 10px 0;
	padding: 12px 16px;
	overflow-y: auto;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}

#cm-chat-widget .cm-chat-pill {
	max-width: 100%;
	padding: 6px 12px;
	overflow: hidden;
	border: 1px solid #ddd;
	border-radius: 16px;
	background: #f0f0f0;
	color: inherit;
	font-size: 14px;
	white-space: nowrap;
	text-overflow: ellipsis;
	cursor: pointer;
	transition:
		background-color 0.2s,
		color 0.2s;
}

#cm-chat-widget .cm-chat-pill:hover {
	border-color: transparent;
	background: #03907f;
	color: #fff;
}

#cm-chat-widget .cm-chat-composer {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 16px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}

#cm-chat-widget .cm-chat-input {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	outline: none;
	background: #fff;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	transition: border-color 0.2s;
}

#cm-chat-widget .cm-chat-input:focus {
	border-color: #03907f;
}

#cm-chat-widget .cm-chat-input:disabled {
	background: #f5f5f5;
	color: #888;
	cursor: not-allowed;
}

#cm-chat-widget .cm-chat-send {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: #03907f;
	cursor: pointer;
	transition: transform 0.2s ease;
}

#cm-chat-widget .cm-chat-send:hover {
	transform: scale(1.05);
}

#cm-chat-widget .cm-chat-send:disabled {
	background: #ccc;
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

#cm-chat-widget .cm-chat-send svg {
	width: 20px;
	height: 20px;
	fill: #fff;
}

@keyframes cm-chat-open {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes cm-chat-typing {
	0%,
	60%,
	100% {
		opacity: 0.4;
		transform: scale(1);
	}
	30% {
		opacity: 1;
		transform: scale(1.2);
	}
}

@keyframes cm-chat-blink {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	#cm-chat-widget .cm-chat-panel,
	#cm-chat-widget .cm-chat-typing span,
	#cm-chat-widget .cm-chat-cursor {
		animation: none;
	}
}

@media (max-width: 768px) {
	#cm-chat-widget .cm-chat-panel {
		right: 10px;
		width: calc(100% - 20px);
	}

	#cm-chat-widget .cm-chat-messages {
		padding: 12px;
	}

	#cm-chat-widget .cm-chat-content {
		max-width: 85%;
		padding: 8px 12px;
	}

	#cm-chat-widget .cm-chat-composer {
		gap: 6px;
		padding: 10px;
	}

	#cm-chat-widget .cm-chat-starters {
		max-height: 80px;
		padding: 8px;
	}

	#cm-chat-widget .cm-chat-pill {
		padding: 4px 10px;
		font-size: 12px;
	}
}

@media (max-width: 480px) {
	#cm-chat-widget .cm-chat-panel {
		bottom: 86px;
		height: 70vh;
	}

	#cm-chat-widget .cm-chat-header {
		min-height: 50px;
		padding: 12px;
	}

	#cm-chat-widget .cm-chat-title {
		font-size: 14px;
	}
}
