/**
 * TailAmerica Chatbot – frontend widget
 */

.canifex-chatbot {
	--canifex-chatbot-primary: #1c49c2;
	position: fixed;
	bottom: 24px;
	z-index: 99999;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.canifex-chatbot--right {
	right: 24px;
}

.canifex-chatbot--left {
	left: 24px;
}

.canifex-chatbot[hidden] {
	display: none !important;
}

.canifex-chatbot__launcher {
	width: 60px;
	height: 60px;
	border: none;
	border-radius: 50%;
	background: var(--canifex-chatbot-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(18, 26, 69, 0.28);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.canifex-chatbot__launcher:hover,
.canifex-chatbot__launcher:focus-visible {
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 12px 28px rgba(18, 26, 69, 0.35);
	outline: none;
}

.canifex-chatbot__panel {
	position: absolute;
	bottom: 76px;
	width: min(360px, calc(100vw - 32px));
	height: min(520px, calc(100vh - 120px));
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(18, 26, 69, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #e8ecf4;
}

.canifex-chatbot--right .canifex-chatbot__panel {
	right: 0;
}

.canifex-chatbot--left .canifex-chatbot__panel {
	left: 0;
}

.canifex-chatbot__panel[hidden] {
	display: none !important;
}

.canifex-chatbot__gate {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f5f7fa;
	flex: 1 1 auto;
}

.canifex-chatbot__gate[hidden],
.canifex-chatbot__conversation[hidden] {
	display: none !important;
}

.canifex-chatbot__gate-text {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.45;
	color: #121a45;
}

.canifex-chatbot__gate-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.canifex-chatbot__conversation {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.canifex-chatbot__send--block {
	width: 100%;
	min-height: 40px;
}

.canifex-chatbot__bubble--agent {
	align-self: flex-start;
	background: #eef3ff;
	color: #121a45;
	border: 1px solid #d7deea;
	border-bottom-left-radius: 4px;
}

.canifex-chatbot__bubble--system {
	align-self: center;
	background: transparent;
	color: #667085;
	font-size: 0.75rem;
	text-align: center;
	max-width: 95%;
}

.canifex-chatbot__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--canifex-chatbot-primary);
	color: #fff;
}

.canifex-chatbot__name {
	display: block;
	font-size: 0.95rem;
}

.canifex-chatbot__status {
	display: block;
	font-size: 0.75rem;
	opacity: 0.85;
	margin-top: 2px;
}

.canifex-chatbot__close {
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.canifex-chatbot__close:hover {
	background: rgba(255, 255, 255, 0.28);
}

.canifex-chatbot__messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: #f5f7fa;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.canifex-chatbot__bubble {
	max-width: 85%;
	padding: 10px 12px;
	border-radius: 14px;
	font-size: 0.875rem;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

.canifex-chatbot__bubble--bot {
	align-self: flex-start;
	background: #fff;
	color: #121a45;
	border: 1px solid #e8ecf4;
	border-bottom-left-radius: 4px;
}

.canifex-chatbot__bubble--user {
	align-self: flex-end;
	background: var(--canifex-chatbot-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.canifex-chatbot__bubble--typing {
	opacity: 0.75;
	font-style: italic;
}

.canifex-chatbot__quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 12px 0;
	background: #fff;
}

.canifex-chatbot__chip {
	border: 1px solid #d7deea;
	background: #fff;
	color: #1c49c2;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
}

.canifex-chatbot__chip:hover {
	background: #eef3ff;
}

.canifex-chatbot__form {
	display: flex;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border-top: 1px solid #e8ecf4;
}

.canifex-chatbot__input {
	flex: 1 1 auto;
	border: 1px solid #d7deea;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 0.875rem;
	min-width: 0;
}

.canifex-chatbot__input:focus {
	outline: 2px solid rgba(28, 73, 194, 0.25);
	border-color: var(--canifex-chatbot-primary);
}

.canifex-chatbot__send {
	border: none;
	border-radius: 10px;
	background: var(--canifex-chatbot-primary);
	color: #fff;
	font-weight: 600;
	font-size: 0.8125rem;
	padding: 0 14px;
	cursor: pointer;
}

.canifex-chatbot__send:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.canifex-chatbot .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 480px) {
	.canifex-chatbot {
		bottom: 16px;
	}

	.canifex-chatbot--right {
		right: 16px;
	}

	.canifex-chatbot--left {
		left: 16px;
	}

	.canifex-chatbot__panel {
		bottom: 72px;
		height: min(70vh, 520px);
	}
}
