/* ==========================================================================
   Chatbot Widget
   ========================================================================== */

/* Trigger Button */
.chatbot-trigger {
	position: fixed !important;
	bottom: 15px;
	right: 15px;
	z-index: 2000 !important;
	cursor: pointer;
}

@media (min-width: 1024px) {
	.chatbot-trigger {
		bottom: 30px;
		right: 30px;
	}
}

.chatbot-trigger svg {
	position: relative;
	left: 2px;
	width: 26px;
	height: 26px;
	fill: var(--color-white, #fff);
	transition: opacity 0.2s;
}

.chatbot-trigger .chatbot-trigger__close {
	display: none;
}

.chatbot-trigger--active .chatbot-trigger__open {
	display: none;
}

.chatbot-trigger--active .chatbot-trigger__close {
	display: block;
}

/* Panel Overlay */
.chatbot-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(11, 12, 15, 0.35);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0.3s;
	backdrop-filter: blur(2px);
	pointer-events: none;
}

.chatbot-overlay--visible {
	opacity: 1;
	visibility: visible;
}

/* Panel */
.chatbot-panel {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 10000;
	width: 440px;
	height: 100dvh;
	background: var(--color-white, #fff);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: -4px 0 40px rgba(11, 12, 15, 0.1);
}

.chatbot-panel--open {
	transform: translateX(0);
}

/* Panel Header */
.chatbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 15px;
	border-bottom: 1px solid var(--color-black-10, rgba(11, 12, 15, 0.1));
	flex-shrink: 0;
}

.chatbot-header__title {
	font-size: 16px;
	font-weight: normal;
	color: var(--color-black, #0b0c0f);
	letter-spacing: -0.01em;
	margin: 0;
}

.chatbot-header__close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	color: var(--color-black, #0b0c0f);
}

.chatbot-header__close:hover {
	background: var(--color-black-05, rgba(11, 12, 15, 0.05));
}

.chatbot-header__close svg {
	width: 20px;
	height: 20px;
}

/* Messages Area */
.chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 24px 24px 66px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
}

.chatbot-messages::-webkit-scrollbar {
	width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
	background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
	background: var(--color-black-20, rgba(11, 12, 15, 0.2));
	border-radius: 2px;
}

/* Welcome Message */
.chatbot-welcome {
	text-align: center;
	padding: 40px 16px;
}

.chatbot-welcome__icon {
	width: 48px;
	height: 48px;
	margin: 0 auto 16px;
	background: var(--color-black-05, rgba(11, 12, 15, 0.05));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.chatbot-welcome__icon svg {
	width: 24px;
	height: 24px;
	fill: var(--color-purple, #6b21a8);
}

.chatbot-welcome__heading {
	font-weight: 400;
	font-size: 20px;
	margin: 0 0 8px;
	color: var(--color-black, #0b0c0f);
}

.chatbot-welcome__text {
	font-size: 18px;
	line-height: 1.5;
	color: var(--color-black-60, rgba(11, 12, 15, 0.6));
	margin: 0;
}

/* Message Bubbles */
.chatbot-msg {
	max-width: 88%;
	animation: chatbotMsgIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.chatbot-msg--user {
	align-self: flex-end;
}

.chatbot-msg--assistant {
	align-self: flex-start;
}

.chatbot-msg__bubble {
	padding: 12px 16px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.55;
}

.chatbot-msg--user .chatbot-msg__bubble {
	background-color: #1556ea;
	color: var(--color-white, #fff);
	border-bottom-right-radius: 4px;
}

.chatbot-msg--assistant .chatbot-msg__bubble {
	background: var(--color-black-05, rgba(11, 12, 15, 0.05));
	color: var(--color-black, #0b0c0f);
	border-bottom-left-radius: 4px;
}

.chatbot-msg--user .chatbot-msg__bubble a {
	color: var(--color-purple-80, rgba(107, 33, 168, 0.8));
}

.chatbot-msg__bubble p {
	margin: 0 0 8px;
}

.chatbot-msg__bubble p:last-child {
	margin-bottom: 0;
}

.chatbot-msg__bubble strong {
	font-weight: 500;
}

/* Related Links Block */
.chatbot-msg__links {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.chatbot-msg__links p {
	margin: 0 0 16px;
	font-size: 13px;
}

.chatbot-msg__links ul {
	margin: 0;
	padding: 0;
	list-style-type: none;
}

.chatbot-msg__links li {
	margin: 0 0 8px;
}

.chatbot-msg__related-link {
	position: relative;
	display: block;
	padding: 8px 20px 8px 16px;
	color: var(--color-black, #0b0c0f);
	background-color: #ffffff;
	text-decoration: none;
	border-radius: 8px;
	border: 1px solid #1556ea;
	transition: all 0.3s ease;
	cursor: pointer;
}

.chatbot-msg__related-link svg {
	position: absolute;
	top: 0;
	right: 4px;
	display: block;
	width: 12px;
	transform: rotate(-45deg);
	fill: #1556ea;
}

.chatbot-msg__related-link:hover {
	color: var(--color-white);
	background-color: #1556ea;
	border: 1px solid #1556ea;
}

.chatbot-msg__related-link:hover svg {
	fill: #ffffff;
}

/* Typing Indicator */
.chatbot-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 14px 18px;
	background: var(--color-black-05, rgba(11, 12, 15, 0.05));
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	animation: chatbotMsgIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.chatbot-typing__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--color-black-20, rgba(11, 12, 15, 0.2));
	animation: chatbotDot 1.4s ease-in-out infinite;
}

.chatbot-typing__dot:nth-child(2) {
	animation-delay: 0.15s;
}

.chatbot-typing__dot:nth-child(3) {
	animation-delay: 0.3s;
}

/* CTA Block */
.chatbot-cta {
	width: 100%;
	padding: 0 24px 12px;
	box-sizing: border-box;
	flex-shrink: 0;
	animation: chatbotMsgIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.chatbot-cta__inner {
	position: relative;
	border: 1px solid var(--color-black-10, rgba(11, 12, 15, 0.1));
	border-radius: 12px;
	padding: 36px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chatbot-cta__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0;
	color: var(--color-black-20, rgba(11, 12, 15, 0.2));
	transition: color 0.2s;
}

.chatbot-cta__close:hover {
	color: var(--color-black-60, rgba(11, 12, 15, 0.6));
}

.chatbot-cta__close svg {
	width: 16px;
	height: 16px;
}

.chatbot-cta__label {
	font-size: 16px;
	color: #0b0c0f;
	margin: 0;
	text-align: center;
}

.chatbot-cta__label a {
	color: #1556ea;
	text-decoration: underline;
}

.chatbot-cta__label a:hover {
	text-decoration: none;
}

.chatbot-cta__email-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.chatbot-cta__input {
	flex: 1;
	border: 1px solid var(--color-black-10, rgba(11, 12, 15, 0.1));
	border-radius: 8px;
	padding: 12px;
	font-size: 16px;
	font-family: inherit;
	color: var(--color-black, #0b0c0f);
	outline: none;
	transition: border-color 0.2s;
	background: var(--color-white, #fff);
}

.chatbot-cta__input:focus {
	border-color: var(--color-black, #0b0c0f);
}

.chatbot-cta__input::placeholder {
	color: var(--color-black-20, rgba(11, 12, 15, 0.2));
}

.chatbot-cta__submit {
	height: 40px;
	padding: 0 16px;
	border: none;
	border-radius: 50px;
	background: #1556ea;
	color: var(--color-white, #fff);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s;
}

.chatbot-cta__submit:hover {
	background: var(--color-black-60, rgba(11, 12, 15, 0.6));
}

.chatbot-cta__submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.chatbot-cta__divider {
	text-align: center;
	font-size: 12px;
	color: var(--color-black-20, rgba(11, 12, 15, 0.2));
	margin: 0;
}

.chatbot-cta__meeting {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	border: 1px solid #1556ea;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 400;
	color: #fff;
	background: #1556ea;
	text-decoration: none;
	transition: border-color 0.2s, background 0.2s;
}

.chatbot-cta__meeting:hover {
	border-color: #1556ea;
	background: #fff;
	color: #1556ea;
}

.chatbot-cta__meeting svg {
	width: 16px;
	height: 16px;
	stroke: #ffffff;
}

.chatbot-cta__meeting:hover svg {
	stroke:  #1556ea;
}

.chatbot-cta--sent .chatbot-cta__email-row,
.chatbot-cta--sent .chatbot-cta__label {
	display: none;
}

.chatbot-cta__success {
	display: none;
	font-size: 13px;
	color: #16a34a;
	margin: 0;
}

.chatbot-cta--sent .chatbot-cta__success {
	display: block;
}

/* Input Area */
.chatbot-input {
	padding: 16px 24px;
	border-top: 1px solid var(--color-black-10, rgba(11, 12, 15, 0.1));
	flex-shrink: 0;
}

.chatbot-input__row {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--color-black-10, rgba(11, 12, 15, 0.1));
	border-radius: 12px;
	padding: 8px 8px 8px 16px;
	transition: border-color 0.2s;
}

.chatbot-input__row:focus-within {
	border-color: var(--color-black-40, rgba(11, 12, 15, 0.4));
}

.chatbot-input__field {
	flex: 1;
	border: none;
	outline: none;
	resize: none;
	font-size: 14px;
	line-height: 1.4;
	color: var(--color-black, #0b0c0f);
	background: transparent;
	min-height: 24px;
	max-height: 120px;
	padding: 4px 0;
}

.chatbot-input__field::placeholder {
	color: var(--color-black-20, rgba(11, 12, 15, 0.2));
}

.chatbot-input__cta-toggle {
	position: absolute !important;
	bottom: 112px;
	left: calc(50% - 70px);
	width: 140px;
	transform: translateY(100%);
	pointer-events: none;
	opacity: 0;
	transition: all 0.3s ease-in-out;
	padding: 12px 16px!important;
	cursor: pointer;
}

.chatbot-input__cta-toggle--visible {
	transform: translateY(0);
	pointer-events: auto;
	opacity: 1;
}

.chatbot-input__cta-toggle--active {
	transform: translateY(100%) !important;
	pointer-events: none !important;
	opacity: 0 !important;
}

.chatbot-input__cta-toggle:hover {
	color: var(--color-black-60, rgba(11, 12, 15, 0.6));
}

.chatbot-input__cta-toggle svg {
	width: 20px;
	height: 20px;
}

.chatbot-input__limit {
	display: block;
	font-size: 11px;
	color: var(--color-black-20, rgba(11, 12, 15, 0.2));
	margin-top: 4px;
	padding-left: 4px;
}

.chatbot-input__send {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: #1556ea;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.2s, opacity 0.2s;
	border: 1px solid #1556ea;
}

.chatbot-input__send:hover {
	background: #fff;
}

.chatbot-input__send:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.chatbot-input__send svg {
	position: relative;
	left: 2px;
	width: 18px;
	height: 18px;
	fill: var(--color-white, #fff);
}

.chatbot-input__send:hover svg {
	fill: #1556ea;
}

/* Animations */
@keyframes chatbotMsgIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes chatbotDot {

	0%,
	80%,
	100% {
		transform: scale(0.6);
		opacity: 0.4;
	}

	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Responsive */
@media (max-width: 520px) {
	.chatbot-panel {
		width: 100%;
	}

	.chatbot-trigger {
		bottom: 16px;
		right: 16px;
	}

	.chatbot-trigger svg {
		width: 22px;
		height: 22px;
	}

	.chatbot-messages {
		padding: 16px;
	}

	.chatbot-input {
		padding: 12px 16px 16px;
	}

	.chatbot-msg {
		max-width: 92%;
	}
}
