/* Viber Floating Call Button – front-end styles. All selectors are prefixed with .vfcb to avoid touching the theme. */

.vfcb {
	--vfcb-size-base: 68px;
	--vfcb-size: var(--vfcb-size-base);
	--vfcb-color: #7360f2;
	--vfcb-x: 20px;
	--vfcb-y: 20px;
	--vfcb-ring-gap: calc(var(--vfcb-size) * 0.045);
	--vfcb-ring: calc(var(--vfcb-size) * 0.035);

	position: fixed;
	z-index: 99990;
	bottom: calc(var(--vfcb-y) + env(safe-area-inset-bottom, 0px));
	width: var(--vfcb-size);
	height: var(--vfcb-size);
	margin: 0;
	padding: 0;
	line-height: 1;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	pointer-events: none; /* only the button and panel catch clicks */
}

.vfcb--left {
	left: calc(var(--vfcb-x) + env(safe-area-inset-left, 0px));
}

.vfcb--right {
	right: calc(var(--vfcb-x) + env(safe-area-inset-right, 0px));
}

.vfcb *,
.vfcb *::before,
.vfcb *::after {
	box-sizing: border-box;
}

/* Button: purple disc + white gap + outer purple ring (double ring) + soft shadow. */
.vfcb .vfcb__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--vfcb-color);
	color: #fff;
	text-decoration: none;
	box-shadow:
		0 0 0 var(--vfcb-ring-gap) #fff,
		0 0 0 calc(var(--vfcb-ring-gap) + var(--vfcb-ring)) var(--vfcb-color),
		0 6px 18px rgba(30, 20, 80, 0.32),
		0 2px 5px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Thin inner ring, inside the disc. */
.vfcb .vfcb__btn::before {
	content: "";
	position: absolute;
	inset: calc(var(--vfcb-size) * 0.09);
	border: max(1.5px, calc(var(--vfcb-size) * 0.026)) solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	pointer-events: none;
}

.vfcb .vfcb__btn:hover {
	transform: scale(1.06);
}

.vfcb .vfcb__btn:active {
	transform: scale(0.96);
}

.vfcb .vfcb__btn:focus {
	outline: none;
}

.vfcb .vfcb__btn:focus-visible {
	outline: 3px solid #1a1a1a;
	outline-offset: calc(var(--vfcb-ring-gap) + var(--vfcb-ring) + 3px);
}

.vfcb .vfcb__face {
	position: relative;
	display: flex;
	width: 46%;
	height: 46%;
}

.vfcb .vfcb__icon {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	fill: none;
	overflow: visible;
}

/* Pulse: a soft ring that expands behind the button. */
.vfcb--pulse .vfcb__btn::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--vfcb-color);
	opacity: 0;
	animation: vfcb-pulse 2.6s ease-out infinite;
	pointer-events: none;
}

@keyframes vfcb-pulse {
	0% { transform: scale(1); opacity: 0.45; }
	70% { transform: scale(1.55); opacity: 0; }
	100% { transform: scale(1.55); opacity: 0; }
}

/* Tooltip */
.vfcb .vfcb__tooltip {
	position: absolute;
	top: 50%;
	display: none;
	padding: 8px 12px;
	border-radius: 8px;
	background: #1f1d2b;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	opacity: 0;
	transform: translateY(-50%);
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.vfcb--tooltip .vfcb__tooltip {
	display: block;
}

.vfcb--left .vfcb__tooltip {
	left: calc(100% + var(--vfcb-ring-gap) + var(--vfcb-ring) + 12px);
}

.vfcb--right .vfcb__tooltip {
	right: calc(100% + var(--vfcb-ring-gap) + var(--vfcb-ring) + 12px);
}

.vfcb--tooltip .vfcb__btn:focus-visible + .vfcb__tooltip {
	opacity: 1;
}

@media (hover: hover) {
	.vfcb--tooltip .vfcb__btn:hover + .vfcb__tooltip {
		opacity: 1;
	}
}

.vfcb.is-open .vfcb__tooltip {
	opacity: 0 !important;
}

/* Fallback panel */
.vfcb .vfcb__panel {
	position: absolute;
	bottom: calc(100% + 18px);
	width: min(300px, calc(100vw - 2 * var(--vfcb-x)));
	padding: 16px 16px 12px;
	border-radius: 14px;
	background: #fff;
	color: #1f1d2b;
	text-align: left;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
	pointer-events: auto;
}

.vfcb .vfcb__panel[hidden] {
	display: none;
}

.vfcb--left .vfcb__panel {
	left: 0;
}

.vfcb--right .vfcb__panel {
	right: 0;
}

.vfcb .vfcb__title {
	margin: 0 24px 6px 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.vfcb .vfcb__text {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.4;
	color: #4a4858;
}

.vfcb .vfcb__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vfcb .vfcb__action {
	display: block;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #d9d6ea;
	border-radius: 10px;
	background: #fff;
	color: #1f1d2b;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.vfcb .vfcb__action:hover {
	border-color: var(--vfcb-color);
}

.vfcb .vfcb__action--primary {
	border-color: var(--vfcb-color);
	background: var(--vfcb-color);
	color: #fff;
}

.vfcb .vfcb__action:focus-visible,
.vfcb .vfcb__close:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

.vfcb .vfcb__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #4a4858;
	font-size: 22px;
	line-height: 32px;
	cursor: pointer;
}

.vfcb .vfcb__close:hover {
	background: #f1effa;
}

.vfcb .vfcb__status {
	min-height: 1em;
	margin: 8px 0 0;
	font-size: 13px;
	color: #2e7d32;
}

/* Small phones: slightly smaller, never wider than 15% of the viewport. */
@media (max-width: 480px) {
	.vfcb {
		--vfcb-size: max(44px, min(calc(var(--vfcb-size-base) * 0.9), 15vw));
	}
}

@media (max-width: 767px) {
	.vfcb.vfcb--hide-mobile {
		display: none !important;
	}

	.vfcb .vfcb__tooltip {
		display: none !important;
	}
}

@media (min-width: 768px) {
	.vfcb.vfcb--hide-desktop {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vfcb .vfcb__btn,
	.vfcb .vfcb__tooltip {
		transition: none;
	}

	.vfcb--pulse .vfcb__btn::after {
		animation: none;
		display: none;
	}

	.vfcb .vfcb__btn:hover,
	.vfcb .vfcb__btn:active {
		transform: none;
	}
}

@media print {
	.vfcb {
		display: none !important;
	}
}

/* Admin preview: static, inside the settings page. */
.vfcb.vfcb--preview {
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	z-index: 1;
}
