:root {
	--chat-primary: #fa4e74;
	--chat-primary-rgb: 250, 78, 116;
	--chat-secondary: #fa8ea4;
	--chat-secondary-rgb: 250, 142, 164;
}

.message-text a {
	text-decoration: underline;
	color: inherit;
	word-break: break-all;
}

.chat-spinner {
	margin: 10px auto 0 auto;
}

.chat-spinner > div {
	width: 10px;
	height: 10px;
	border-radius: 100%;
	display: inline-block;
	-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
	animation: sk-bouncedelay 1.4s infinite ease-in-out both;
	background: rgba(var(--chat-primary-rgb), 0.9);
}

.chat-spinner .bounce1 {
	-webkit-animation-delay: -0.32s;
	animation-delay: -0.32s;
}

.chat-spinner .bounce2 {
	-webkit-animation-delay: -0.16s;
	animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
	0%,
	80%,
	100% {
		-webkit-transform: scale(0);
	}
	40% {
		-webkit-transform: scale(1);
	}
}

@keyframes sk-bouncedelay {
	0%,
	80%,
	100% {
		-webkit-transform: scale(0);
		transform: scale(0);
	}
	40% {
		-webkit-transform: scale(1);
		transform: scale(1);
	}
}

.message-text {
	-webkit-animation: message-animation 3s ease-in-out;
	animation: message-animation 3s ease-in-out;
}

@keyframes message-animation {
	0% {
		-webkit-transform: opacity(0);
		transform: opacity(0);
	}
	100% {
		-webkit-transform: opacity(1);
		transform: opacity(1);
	}
}

/* Existing styles */
.chat-button {
	padding: 3px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 9000;
	border-radius: 100%;
	cursor: pointer;
	background-color: white;
	transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease; /* Smooth transition for hover and fade-in */
}

.chat-button-image {
	border-radius: 100%;
	width: 75px;
	height: 75px;
}

/* Hover effect */
.chat-button:hover {
	transform: scale(1.05); /* Slightly scale up the button */
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Enhance the shadow on hover */
}

.chat-button-fade {
	animation: fadeInScale 0.5s forwards;
	opacity: 0;
	transform: scale(0.9);
}

/* Animation class */
@keyframes fadeInScale {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.chat-box {
	max-width: 100vw;
	max-height: 100vh;
	width: 300px;
	height: 400px;
	background-color: #fafbff;
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
	position: fixed;
	z-index: 9001;
	bottom: 20px;
	right: 20px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	border-radius: 5px;
	visibility: hidden;
	opacity: 0;
	transform: scale(0.8);
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.chat-box.open {
	visibility: visible;
	opacity: 1;
	transform: scale(1);
}

.chat-header {
	background: linear-gradient(
		to right,
		var(--chat-primary),
		var(--chat-secondary)
	);
	color: white;
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 100px;
	box-shadow: 0 0 15px rgba(var(--chat-primary-rgb), 0.45);
	position: relative;
	padding: 0 12px;
}

.chat-header-icon {
	align-self: baseline;
}

.chat-title {
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.chat-title img {
	width: 60px;
	height: 60px;
	border-radius: 100%;
	margin-right: 10px;
}

.chat-title-info {
	display: flex;
	flex-direction: column;
	text-align: left;
	line-height: 1.15;
}

.chat-title-name {
	font-size: 1.15rem;
	font-weight: 400;
}

.chat-title-text {
	font-size: 13px;
	opacity: 0.9;
	margin-top: 2px;
}

.chat-close {
	background-color: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	margin-right: -13px;
	align-self: baseline;
	position: relative;
	top: 3px;
}

.chat-footer {
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
	display: flex;
	padding: 7px 12px;
	align-items: center;
	justify-content: space-between;
	height: 55px;
	min-height: 55px;
	background-color: white;
}

.chat-send {
	width: 40px;
	height: 40px;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: white;
	border: none;
	border-radius: 100%;
	transition: box-shadow 0.2s ease-in-out;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.07);
}

.chat-send:disabled {
	background-color: white !important;
}

.chat-send svg {
	width: 20px;
	height: 20px;
	color: var(--chat-primary);
	transition: color 0.3s ease-in-out;
	margin-left: -3px;
	margin-bottom: -3px;
}

.chat-send:hover {
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.14);
}

.chat-input {
	font-family: "Quicksand", sans-serif;
	color: #222;
	caret-color: var(--chat-primary);
	letter-spacing: 1px;
	flex-grow: 1;
	resize: none;
	overflow-y: auto;
	max-height: 45px;
	border: none;
	font-size: 0.875rem;
	line-height: 1.1;
	margin-right: 5px;
	padding-right: 10px;
	box-sizing: content-box;
}

.chat-input:focus {
	outline: none;
}

.chat-input::-webkit-scrollbar {
	width: 3px;
	border-radius: 2px;
}

.chat-input::-webkit-scrollbar-track {
	background: #d7d7d7;
	border-radius: 10px;
}

.chat-input::-webkit-scrollbar-thumb {
	background-color: var(--chat-primary);
	border-radius: 0;
	border: none;
}

.chat-input::placeholder {
	color: #999;
	letter-spacing: 1px;
}

.chat-dialog {
	flex-grow: 1;
	overflow-y: auto;
	padding: 12px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

.chat-dialog::-webkit-scrollbar {
	width: 4px;
}

.chat-dialog::-webkit-scrollbar-track {
	background: #d7d7d7;
	border-radius: 10px;
}

.chat-dialog::-webkit-scrollbar-thumb {
	background-color: var(--chat-secondary);
	border-radius: 0;
	border: none;
}

/* General message text styles */
.message-text {
	padding: 10px 15px;
	margin: 4px 0;
	max-width: 80%;
	position: relative;
	display: block;
	border-radius: 10px;
	animation: fadeInScale 0.2s ease-in-out;
	font-size: 0.875rem;
	line-height: 1.1;
	letter-spacing: 0.2px;
}

.message-text-left {
	background: linear-gradient(
		to right,
		var(--chat-primary),
		var(--chat-secondary)
	);
	color: white;
	border-radius: 0 10px 10px 10px;
	margin-right: auto;
	box-shadow: 0 4px 10px rgba(var(--chat-primary-rgb), 0.4);
}

.message-text-right {
	background-color: white;
	color: var(--chat-primary);
	border-radius: 10px 0 10px 10px;
	margin-left: auto;
	box-shadow: 0 4px 10px rgba(var(--chat-primary-rgb), 0.15);
}

@keyframes fadeInScale {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.chat-popup {
	position: absolute;
	right: 99px;
	bottom: 10px;
	width: 170px;
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
	background: #fafbff;
	padding: 20px;
	color: #222;
	font-weight: 500;
	line-height: 1.1;
	border-radius: 10px;
	animation: fadeInScale 0.3s ease-in-out;
	letter-spacing: 0.5px;
}

.chat-popup::after {
	content: "";
	position: absolute;
	right: -10px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-left: 10px solid #fafbff;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
}

.chat-popup-close {
	position: absolute;
	top: 0;
	right: -3px;
	background: none;
	border: none;
	color: #666;
	font-size: 1.5rem;
	cursor: pointer;
}

.chat-remove {
	position: absolute;
	top: -4px;
	right: -4px;
	background: none;
	border: none;
	color: #333;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
	line-height: 1;
}

.chat-remove svg {
	width: 20px;
	height: 20px;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.chat-remove:hover {
	opacity: 0.7;
}

.chat-message-profile {
	width: 28px;
	height: 28px;
	border-radius: 100%;
	margin-right: auto;
	border: 3px solid white;
}

/* Pre-chat contact gate form (matches the small-font aesthetic above) */
.chat-contact-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: auto 0;
	padding: 4px;
	animation: fadeInScale 0.3s ease-in-out;
}

.chat-contact-intro {
	color: #222;
	font-size: 0.875rem;
	line-height: 1.35;
	letter-spacing: 0.2px;
	margin-bottom: 2px;
}

.chat-contact-input {
	font-family: "Quicksand", sans-serif;
	color: #222;
	caret-color: var(--chat-primary);
	letter-spacing: 0.5px;
	font-size: 0.875rem;
	padding: 9px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background-color: white;
	box-sizing: border-box;
	width: 100%;
}

.chat-contact-input:focus {
	outline: none;
	border-color: var(--chat-primary);
}

.chat-contact-input::placeholder {
	color: #999;
}

.chat-contact-error {
	color: #c0392b;
	font-size: 0.78rem;
	line-height: 1.3;
	min-height: 1px;
}

.chat-contact-submit {
	background: linear-gradient(
		to right,
		var(--chat-primary),
		var(--chat-secondary)
	);
	color: white;
	border: none;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 0.875rem;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: box-shadow 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.chat-contact-submit:hover {
	box-shadow: 0 4px 12px rgba(var(--chat-primary-rgb), 0.3);
}

.chat-contact-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.chat-input:disabled {
	background-color: #f3f3f3;
	cursor: not-allowed;
}
