/* TCA Chatbot widget — appears only when ?chatbot=1 is on the URL */

.tca-chatbot {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;
	font-family: "DM Sans", sans-serif;
}

/* Daily greeting bubble */
.tca-chatbot__bubble {
	position: absolute;
	bottom: 15px;
	right: 76px;
	background: #fff;
	color: #222;
	font-size: 13px;
	line-height: 1.5;
	padding: 14px 18px;
	border-radius: 16px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.13);
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translateX(8px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	border: 1px solid #ECECEC;
}
/* Right-pointing tail */
.tca-chatbot__bubble::before,
.tca-chatbot__bubble::after {
	content: '';
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	border: 8px solid transparent;
	border-right-width: 0;
}
.tca-chatbot__bubble::before {
	right: -9px;
	border-left-color: #ECECEC;
}
.tca-chatbot__bubble::after {
	right: -8px;
	border-left-color: #fff;
}
.tca-chatbot__bubble--visible {
	opacity: 1;
	transform: translateX(0);
	pointer-events: auto;
}

/* Floating launcher button */
.tca-chatbot__launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #AC1F26;
	border: none;
	box-shadow: 0 6px 24px rgba(172, 31, 38, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
}
.tca-chatbot__launcher:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 28px rgba(172, 31, 38, 0.45);
}
.tca-chatbot__launcher .mdi,
.tca-chatbot__launcher .mdi::before {
	color: #fff !important;
	margin: 0;
	font-size: 28px;
}

/* Conversation panel */
.tca-chatbot__panel {
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 380px;
	height: 540px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(20px) scale(0.96);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.2s ease;
}
.tca-chatbot--open .tca-chatbot__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}
.tca-chatbot--open .tca-chatbot__launcher {
	transform: scale(0.92);
}

/* Header */
.tca-chatbot__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: #AC1F26;
	color: #fff;
	flex-shrink: 0;
}
.tca-chatbot__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.tca-chatbot__avatar .mdi,
.tca-chatbot__avatar .mdi::before {
	color: #fff !important;
	margin: 0;
	font-size: 22px;
}
.tca-chatbot__title { flex: 1; line-height: 1.2; min-width: 0; }
.tca-chatbot__name { font-weight: 700; font-size: 16px; }
.tca-chatbot__subtitle { font-size: 12px; opacity: 0.85; }
.tca-chatbot__close {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 6px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tca-chatbot__close:hover { background: rgba(255, 255, 255, 0.15); }
.tca-chatbot__close .mdi,
.tca-chatbot__close .mdi::before {
	color: #fff !important;
	margin: 0;
	font-size: 22px;
}

/* Message list */
.tca-chatbot__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #F8F8F8;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tca-chatbot__msg {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.tca-chatbot__msg--bot {
	background: #fff;
	color: #222;
	border: 1px solid #ECECEC;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
}
.tca-chatbot__msg--user {
	background: #AC1F26;
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}
.tca-chatbot__msg--error {
	background: #FFE7E7;
	color: #7a0d12;
	border: 1px solid #f3c2c4;
	align-self: flex-start;
}

/* Suggestion chips */
.tca-chatbot__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}
.tca-chatbot__chip {
	background: #fff;
	border: 1px solid #AC1F26;
	color: #AC1F26;
	padding: 6px 12px;
	border-radius: 18px;
	font-size: 12px;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.15s, color 0.15s;
}
.tca-chatbot__chip:hover {
	background: #AC1F26;
	color: #fff;
}

/* Typing indicator */
.tca-chatbot__typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #ECECEC;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
}
.tca-chatbot__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #AC1F26;
	opacity: 0.4;
	animation: tca-chatbot-bounce 1.2s infinite ease-in-out;
}
.tca-chatbot__typing span:nth-child(2) { animation-delay: 0.15s; }
.tca-chatbot__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tca-chatbot-bounce {
	0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}

/* Input form */
.tca-chatbot__form {
	display: flex;
	padding: 12px;
	border-top: 1px solid #ECECEC;
	background: #fff;
	gap: 8px;
	flex-shrink: 0;
}
.tca-chatbot__input {
	flex: 1;
	border: 1px solid #DDD;
	border-radius: 22px;
	padding: 10px 16px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	background: #fff;
	color: #222;
	min-width: 0;
}
.tca-chatbot__input:focus { border-color: #AC1F26; }
.tca-chatbot__send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #AC1F26;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
}
.tca-chatbot__send:hover:not(:disabled) { background: #880f15; }
.tca-chatbot__send:disabled { background: #ccc; cursor: not-allowed; }
.tca-chatbot__send .mdi,
.tca-chatbot__send .mdi::before {
	color: #fff !important;
	margin: 0;
	font-size: 18px;
}

@media (max-width: 480px) {
	.tca-chatbot { bottom: 16px; right: 16px; }
	.tca-chatbot__panel {
		width: calc(100vw - 32px);
		height: calc(100vh - 120px);
		max-height: calc(100vh - 120px);
	}
}
