#thcc-wrapper {
	all: initial;
	font-family: system-ui, -apple-system, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

#thcc-wrapper *,
#thcc-wrapper *::before,
#thcc-wrapper *::after {
	box-sizing: border-box;
	font-family: inherit;
}

#thcc-wrapper input,
#thcc-wrapper textarea {
	all: unset;
	box-sizing: border-box;
	font-family: inherit;
	display: block;
	width: 100%;
}

#thcc-wrapper input::placeholder,
#thcc-wrapper textarea::placeholder {
	color: #999;
}

#thcc-wrapper button {
	all: unset;
	box-sizing: border-box;
	font-family: inherit;
	cursor: pointer;
}

#thcc-wrapper img {
	max-width: 100%;
	height: auto;
	display: block;
}


/* =========================================================
   FLOATING CHAT BUTTON
========================================================= */

#thcc-wrapper #thcc-chat-button {
	position: fixed;
	z-index: 9999;
	cursor: pointer;
	transition:
		transform .2s ease,
		opacity .2s ease;
}

#thcc-wrapper #thcc-chat-button img {
	display: block;
	height: auto;
}


/* Hover */

#thcc-wrapper #thcc-chat-button:hover {
	transform: scale(1.05);
}


/* Keyboard focus */

#thcc-wrapper #thcc-chat-button:focus-visible {
	outline: 2px solid #25D366;
	outline-offset: 4px;
}


/* =========================================================
   WHATSAPP ICON ATTENTION ANIMATION
========================================================= */

#thcc-wrapper #thcc-chat-button.thcc-attention img {
	animation: thcc-pulse 1.8s ease-in-out infinite;
	transform-origin: center;
}

@keyframes thcc-pulse {

	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(1.08);
		opacity: .88;
	}

}


/* =========================================================
   WELCOME MESSAGE
========================================================= */

#thcc-wrapper #thcc-welcome-message {
	display: none;
	position: fixed;
	z-index: 9998;
	max-width: 260px;
	padding: 11px 14px;
	background: #ffffff;
	color: #222;
	border-radius: 10px;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
	font-size: 13px;
	line-height: 1.45;
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	transition:
		opacity .25s ease,
		transform .25s ease;
}


/* Welcome message visible state */

#thcc-wrapper #thcc-welcome-message.thcc-visible {
	opacity: 1;
	transform: translateY(0);
}


/* Welcome message focus */

#thcc-wrapper #thcc-welcome-message:focus-visible {
	outline: 2px solid #25D366;
	outline-offset: 3px;
}


/* =========================================================
   WELCOME MESSAGE DESKTOP POSITION
========================================================= */

#thcc-wrapper.thcc-position-right #thcc-welcome-message {
	right: var(--thcc-button-side, 20px);
	bottom: calc(
		var(--thcc-button-bottom, 85px) +
		var(--thcc-button-size, 55px) +
		15px
	);
}

#thcc-wrapper.thcc-position-left #thcc-welcome-message {
	left: var(--thcc-button-side, 20px);
	bottom: calc(
		var(--thcc-button-bottom, 85px) +
		var(--thcc-button-size, 55px) +
		15px
	);
}


/* =========================================================
   WELCOME MESSAGE ARROW
========================================================= */

#thcc-wrapper.thcc-position-right #thcc-welcome-message::after {
	content: "";
	position: absolute;
	bottom: -7px;
	right: 22px;
	left: auto;
	width: 14px;
	height: 14px;
	background: #ffffff;
	transform: rotate(45deg);
	z-index: -1;
}

#thcc-wrapper.thcc-position-left #thcc-welcome-message::after {
	content: "";
	position: absolute;
	bottom: -7px;
	left: 22px;
	right: auto;
	width: 14px;
	height: 14px;
	background: #ffffff;
	transform: rotate(45deg);
	z-index: -1;
}


/* Welcome message text */

#thcc-wrapper .thcc-welcome-message-text {
	position: relative;
	z-index: 1;
	display: block;
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}


/* =========================================================
   POPUP
========================================================= */

#thcc-wrapper #thcc-popup {
	display: none;
	position: fixed !important;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
	padding: 18px;
	z-index: 999999 !important;
	font-family: system-ui, -apple-system, sans-serif;
	max-width: 95%;
	max-height: 90vh;
	overflow-y: auto;
	scroll-behavior: smooth;
}


/* =========================================================
   HEADER
========================================================= */

#thcc-wrapper .thcc-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	border-bottom: 1px solid #f1f1f1;
	padding-bottom: 10px;
}

#thcc-wrapper .thcc-header-title {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 2px;
}

#thcc-wrapper .thcc-header-sub {
	font-size: 13px;
	color: #777;
	line-height: 1.4;
	margin-top: 2px;
}


/* =========================================================
   POPUP CLOSE BUTTON
========================================================= */

#thcc-wrapper #thcc-close {
	width: auto;
	min-width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	color: #444;
	cursor: pointer;
	border-radius: 6px;
	transition:
		background .2s ease,
		color .2s ease;
}

#thcc-wrapper #thcc-close:hover {
	background: #f5f5f5;
	color: #111;
}

#thcc-wrapper #thcc-close:focus-visible {
	outline: 2px solid #25D366;
	outline-offset: 2px;
}


/* =========================================================
   STATUS
========================================================= */

#thcc-wrapper #thcc-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	line-height: 1.4;
	margin: 8px 0 12px;
}

#thcc-wrapper .thcc-status-dot {
	width: 7px;
	height: 7px;
	background: #28c76f;
	border-radius: 50%;
	margin-top: 1px;
	flex: 0 0 7px;
}

#thcc-wrapper #thcc-status strong {
	font-weight: 600;
	margin-right: 2px;
}

#thcc-wrapper .thcc-status-sub {
	font-size: 12px;
	color: #777;
	margin-left: 2px;
	line-height: 1.4;
}


/* =========================================================
   INPUTS
========================================================= */

#thcc-wrapper #thcc-popup input,
#thcc-wrapper #thcc-popup textarea {
	width: 100%;
	padding: 10px;
	margin-bottom: 8px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
	transition:
		border-color .2s ease,
		box-shadow .2s ease;
}

#thcc-wrapper #thcc-popup input:focus,
#thcc-wrapper #thcc-popup textarea:focus {
	border-color: #25D366;
	outline: none;
	box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.12);
}

#thcc-wrapper #thcc-popup textarea {
	min-height: 90px;
	resize: vertical;
}


/* =========================================================
   SEND BUTTON
========================================================= */

/*
 * IMPORTANT:
 * Scope this only to #thcc-send.
 * The previous selector:
 *
 * #thcc-wrapper #thcc-popup button
 *
 * also affected the popup close button.
 */

#thcc-wrapper #thcc-popup #thcc-send {
	width: 100%;
	background: #25D366;
	color: #fff;
	border: none;
	padding: 11px;
	font-size: 15px;
	line-height: 1.4;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	transition:
		background .2s ease,
		transform .2s ease,
		box-shadow .2s ease;
	text-align: center;
	display: block;
}

#thcc-wrapper #thcc-popup #thcc-send:hover {
	background: #1ebe5d;
	transform: translateY(-1px);
}

#thcc-wrapper #thcc-popup #thcc-send:focus-visible {
	outline: 2px solid #25D366;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.15);
}


/* =========================================================
   FOOTER
========================================================= */

#thcc-wrapper .thcc-footer {
	font-size: 11px;
	color: #777;
	margin-top: 8px;
	text-align: center;
	line-height: 1.4;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

	#thcc-wrapper #thcc-popup {
		width: 92% !important;
		left: 4% !important;
		right: 4% !important;
		bottom: 95px !important;
		max-width: 92%;
		max-height: 85vh;
	}


	#thcc-wrapper #thcc-chat-button {
		bottom: var(--thcc-mobile-bottom, 95px);
	}


	#thcc-wrapper #thcc-chat-button img {
		width: var(--thcc-mobile-size, 65px);
	}


	/* Right position */

	#thcc-wrapper.thcc-position-right #thcc-chat-button {
		right: var(--thcc-mobile-side, 15px);
		left: auto;
	}


	#thcc-wrapper.thcc-position-right #thcc-welcome-message {
		right: var(--thcc-mobile-side, 15px);
		left: auto;
		bottom: calc(
			var(--thcc-mobile-bottom, 95px) +
			var(--thcc-mobile-size, 65px) +
			15px
		);
	}


	/* Left position */

	#thcc-wrapper.thcc-position-left #thcc-chat-button {
		left: var(--thcc-mobile-side, 15px);
		right: auto;
	}


	#thcc-wrapper.thcc-position-left #thcc-welcome-message {
		left: var(--thcc-mobile-side, 15px);
		right: auto;
		bottom: calc(
			var(--thcc-mobile-bottom, 95px) +
			var(--thcc-mobile-size, 65px) +
			15px
		);
	}


	/* Keep welcome message inside viewport */

	#thcc-wrapper #thcc-welcome-message {
		max-width: calc(100vw - 100px);
	}

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

	#thcc-wrapper #thcc-status {
		flex-wrap: wrap;
		align-items: flex-start;
	}


	#thcc-wrapper .thcc-status-sub {
		width: 100%;
		margin-left: 13px;
		margin-top: 2px;
	}


	#thcc-wrapper #thcc-welcome-message {
		font-size: 12px;
		padding: 10px 12px;
		max-width: calc(100vw - 90px);
	}

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

	#thcc-wrapper #thcc-chat-button.thcc-attention img {
		animation: none;
	}

	#thcc-wrapper #thcc-welcome-message {
		transition: none;
	}

	#thcc-wrapper #thcc-chat-button {
		transition: none;
	}

	#thcc-wrapper #thcc-popup #thcc-send {
		transition: none;
	}

}