/* ClickPo AI Chatbot — frontend widget (RTL) */
.clickpo-bot-root {
	--cpb-color: #4f46e5;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
	direction: rtl;
}
.clickpo-bot-pos-left { left: 20px; }
.clickpo-bot-pos-right { right: 20px; }

.clickpo-bot-launcher {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: none;
	background: var(--cpb-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}
.clickpo-bot-launcher:hover { transform: scale(1.06); }

/* Custom image icon: no colored circle, the SVG is the button */
.clickpo-bot-launcher--img {
	width: 62px;
	height: 62px;
	background: transparent;
	box-shadow: none;
	padding: 0;
}
.clickpo-bot-launcher--img img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
	filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}

.clickpo-bot-panel {
	position: absolute;
	bottom: 72px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.clickpo-bot-pos-left .clickpo-bot-panel { left: 0; }
.clickpo-bot-pos-right .clickpo-bot-panel { right: 0; }

.clickpo-bot-header {
	background: var(--cpb-color);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 600;
}
.clickpo-bot-testing {
	display: inline-block;
	margin-right: 6px;
	font-size: 11px;
	font-weight: 600;
	background: rgba(255, 255, 255, .25);
	border-radius: 10px;
	padding: 1px 8px;
	vertical-align: middle;
}
.clickpo-bot-title {
	display: flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.2;
}
.clickpo-bot-subtitle {
	font-size: 12px;
	font-weight: 400;
	opacity: .85;
}
.clickpo-bot-actions {
	display: flex;
	align-items: center;
	gap: 2px;
}
.clickpo-bot-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
}
.clickpo-bot-iconbtn {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 5px 6px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	opacity: .9;
}
.clickpo-bot-iconbtn:hover,
.clickpo-bot-close:hover {
	background: rgba(255, 255, 255, .2);
	opacity: 1;
}

.clickpo-bot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f7f9;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.clickpo-bot-msg {
	max-width: 80%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.clickpo-bot-msg.user {
	align-self: flex-start;
	background: var(--cpb-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.clickpo-bot-msg.bot {
	align-self: flex-end;
	background: #fff;
	color: #222;
	border: 1px solid #e5e5ea;
	border-bottom-left-radius: 4px;
}
.clickpo-bot-typing {
	align-self: flex-end;
	background: #fff;
	border: 1px solid #e5e5ea;
	color: #555;
	font-size: 13px;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
	padding: 9px 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.clickpo-bot-dots {
	display: inline-flex;
	gap: 3px;
}
.clickpo-bot-dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: .35;
	animation: clickpoBlink 1.2s infinite both;
}
.clickpo-bot-dots span:nth-child(2) { animation-delay: .2s; }
.clickpo-bot-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes clickpoBlink {
	0%, 80%, 100% { opacity: .3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

.clickpo-bot-suggestions {
	align-self: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
	margin-top: 2px;
}
.clickpo-bot-suggestion {
	background: #fff;
	border: 1px solid var(--cpb-color);
	color: var(--cpb-color);
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.clickpo-bot-suggestion:hover {
	background: var(--cpb-color);
	color: #fff;
}

.clickpo-bot-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eee;
	background: #fff;
}
.clickpo-bot-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
}
.clickpo-bot-input:focus { border-color: var(--cpb-color); }
.clickpo-bot-submit {
	border: none;
	background: var(--cpb-color);
	color: #fff;
	border-radius: 20px;
	padding: 0 18px;
	cursor: pointer;
	font-weight: 600;
}
.clickpo-bot-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}
.clickpo-bot-cta {
	display: block;
	align-self: stretch;
	box-sizing: border-box;
	width: 100%;
	margin-top: 10px;
	background: var(--cpb-color);
	color: #fff !important;
	text-decoration: none;
	text-align: center;
	padding: 13px 18px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
	transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.clickpo-bot-cta:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
	box-shadow: 0 7px 20px rgba(0, 0, 0, .28);
}

/* ---------- Mobile: full-screen panel that stays above the keyboard ---------- */
@media (max-width: 600px) {
	.clickpo-bot-panel {
		position: fixed;
		top: 0;
		bottom: auto;
		width: 100%;
		max-width: 100%;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
		box-shadow: none;
	}
	.clickpo-bot-pos-left .clickpo-bot-panel,
	.clickpo-bot-pos-right .clickpo-bot-panel {
		left: 0;
		right: 0;
	}
	.clickpo-bot-header {
		padding-top: calc(14px + env(safe-area-inset-top));
	}
	.clickpo-bot-form {
		padding-bottom: calc(10px + env(safe-area-inset-bottom));
	}
	/* Bubble corners look better as near-edge speech bubbles on small screens */
	.clickpo-bot-msg { max-width: 88%; }
}
