/* =========================================
   1. Shell
========================================= */

.vi-floating-chat {
	--vi-fc-bottom: 1.5rem;
	--vi-fc-right: 1.5rem;
	--vi-fc-gap: 0.75rem;
	--vi-fc-channel-size: 3.5rem;
	--vi-fc-launcher-bg: #84b8e0;
	--vi-fc-launcher-text: #1e306e;
	--vi-fc-launcher-border: #84b8e0;
	--vi-fc-mobile-scale: 0.82;
	--vi-fc-offset-scale: 0.75;
	--vi-fc-item-size: max(2.75rem, calc(var(--vi-fc-channel-size) * var(--vi-fc-mobile-scale)));
	--vi-fc-stack-gap: max(0.5rem, calc(var(--vi-fc-gap) * var(--vi-fc-mobile-scale)));
	--vi-fc-offset-right: max(0.75rem, calc(var(--vi-fc-right) * var(--vi-fc-offset-scale)));
	--vi-fc-offset-bottom: max(0.75rem, calc(var(--vi-fc-bottom) * var(--vi-fc-offset-scale)));
	position: fixed;
	right: var(--vi-fc-offset-right);
	bottom: var(--vi-fc-offset-bottom);
	z-index: 9998;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--vi-fc-stack-gap);
	pointer-events: auto;
}

.vi-floating-chat *,
.vi-floating-chat *::before,
.vi-floating-chat *::after {
	box-sizing: border-box;
}

/* =========================================
   2. Launcher
========================================= */

.vi-floating-chat__launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: max(3rem, calc(var(--vi-fc-item-size) * 0.96));
	padding: 0.625rem 1rem;
	border: 1px solid var(--vi-fc-launcher-border);
	border-radius: 999px;
	background-color: var(--vi-fc-launcher-bg);
	color: var(--vi-fc-launcher-text);
	font-size: 1.3125rem;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 0.625rem 0.9375rem rgba(0, 0, 0, 0.1), 0 0.25rem 0.375rem rgba(0, 0, 0, 0.06);
	cursor: pointer;
	pointer-events: auto;
	backdrop-filter: blur(0.4375rem);
	-webkit-backdrop-filter: blur(0.4375rem);
	transition: all .3s linear;
}

.vi-floating-chat__launcher:hover {
	transform: translateY(-0.1875rem);
	box-shadow: 0 0.875rem 1.5625rem rgba(0, 0, 0, 0.18), 0 0.375rem 0.625rem rgba(0, 0, 0, 0.1);
}

.vi-floating-chat__launcher:focus-visible {
	outline: none;
	box-shadow: 0 0 0 0.1875rem rgba(30, 48, 110, 0.2), 0 0.875rem 1.5625rem rgba(0, 0, 0, 0.18);
}

.vi-floating-chat__launcher-glow {
	display: none;
}

.vi-floating-chat__launcher-icon {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	pointer-events: none;
}

.vi-floating-chat__launcher-icon svg,
.vi-floating-chat__launcher-icon img {
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.vi-floating-chat__launcher-icon img {
	object-fit: contain;
}

.vi-floating-chat__launcher-text {
	position: relative;
	z-index: 1;
	font-size: 14px;
	line-height: 1;
	pointer-events: none;
}

.vi-floating-chat.is-open .vi-floating-chat__launcher {
	transform: translateY(-0.125rem);
}

/* =========================================
   3. Channels
========================================= */

.vi-floating-chat__panel {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--vi-fc-gap);
	position: absolute;
	right: 0;
	bottom: calc(100% + var(--vi-fc-stack-gap));
	opacity: 0;
	visibility: hidden;
	transform: translateY(0.75rem) scale(0.96);
	pointer-events: none;
	transition: all .3s linear;
}

.vi-floating-chat.is-open .vi-floating-chat__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.vi-floating-chat__item {
	--vi-fc-item-bg: #1e88e5;
	--vi-fc-item-color: #ffffff;
	--vi-fc-index: 0;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--vi-fc-item-size);
	height: var(--vi-fc-item-size);
	border-radius: 50%;
	background-color: var(--vi-fc-item-bg);
	color: var(--vi-fc-item-color);
	text-decoration: none;
	box-shadow: 0 0.625rem 1.25rem rgba(15, 23, 42, 0.2);
	transform: translateY(0.5625rem) scale(0.92);
	opacity: 0;
	pointer-events: none;
	transition: all .3s linear;
	transition-delay: calc(var(--vi-fc-index) * 40ms);
}

.vi-floating-chat.is-open .vi-floating-chat__item {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

.vi-floating-chat__item:hover {
	transform: translateY(-0.1875rem) scale(1.06);
	box-shadow: 0 1rem 1.75rem rgba(15, 23, 42, 0.26);
}

.vi-floating-chat__item-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
}

.vi-floating-chat__item-icon svg,
.vi-floating-chat__item-icon img {
	display: block;
	width: 100%;
	height: 100%;
}

.vi-floating-chat__item-icon img {
	object-fit: contain;
}

.vi-floating-chat__tooltip {
	position: absolute;
	right: calc(100% + 0.625rem);
	top: 50%;
	transform: translateY(-50%) translateX(0.375rem);
	padding: 0.4375rem 0.625rem;
	border-radius: 0.5rem;
	background-color: rgba(15, 23, 42, 0.9);
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: all .3s linear;
}

.vi-floating-chat__item:hover .vi-floating-chat__tooltip {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

/* =========================================
   4. Motion
========================================= */

.vi-floating-chat__launcher::after {
	content: "";
	position: absolute;
	inset: -0.3125rem;
	border-radius: inherit;
	border: 0.125rem solid rgba(255, 255, 255, 0.45);
	opacity: 0;
	pointer-events: none;
	animation: vi-floating-chat-pulse 2.4s ease-out infinite;
}

@keyframes vi-floating-chat-pulse {
	0% {
		opacity: 0.7;
		transform: scale(1);
	}

	70% {
		opacity: 0;
		transform: scale(1.12);
	}

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

/* =========================================
   5. Responsive
========================================= */

@media (min-width: 1025px) {
	.vi-floating-chat {
		--vi-fc-mobile-scale: 1;
		--vi-fc-offset-scale: 1;
	}

	.vi-floating-chat__launcher {
		gap: 8px;
		padding: 0.75rem 1.5rem;
	}

	.vi-floating-chat__launcher-icon {
		width: 1.4375rem;
		height: 1.4375rem;
	}

	.vi-floating-chat__launcher-text {
		font-size: 16px;
	}

	.vi-floating-chat__item-icon {
		width: 1.5rem;
		height: 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vi-floating-chat__launcher,
	.vi-floating-chat__launcher::after,
	.vi-floating-chat__panel,
	.vi-floating-chat__item,
	.vi-floating-chat__tooltip {
		animation: none !important;
		transition-duration: 0.01s !important;
	}
}
