/**
 * PClasting Custom - Floating contact button
 * Author: Behnood Rahbari
 */

.pcc-fab {
	position: fixed;
	bottom: var(--pcc-bottom, 20px);
	z-index: var(--pcc-z, 99990);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	font-family: inherit;
	line-height: 1;
	direction: rtl;
}

.pcc-fab--right { right: var(--pcc-side, 20px); }
.pcc-fab--left  { left: var(--pcc-side, 20px); }

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

/* ---------- منوی کانال‌ها ---------- */
.pcc-fab__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: 10px;
}

.pcc-fab__menu::before { content: none; }

.pcc-fab__row {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pcc-fab__item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--pcc-item, 48px);
	height: var(--pcc-item, 48px);
	border-radius: 50%;
	background: var(--pcc-ch, var(--pcc-main, #0f766e));
	color: var(--pcc-icon, #fff);
	box-shadow: 0 6px 18px -6px rgba(2, 8, 23, .45);
	text-decoration: none;
	opacity: 0;
	transform: translateY(14px) scale(.5);
	pointer-events: none;
	visibility: hidden;
	transition:
		opacity .22s ease,
		transform .28s cubic-bezier(.34, 1.56, .64, 1),
		box-shadow .2s ease,
		visibility 0s linear .3s;
}

.pcc-fab[data-open="true"] .pcc-fab__item {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	visibility: visible;
	transition-delay: var(--pcc-delay, 0ms), var(--pcc-delay, 0ms), 0s, 0s;
}

.pcc-fab__item:hover,
.pcc-fab__item:focus-visible {
	transform: translateY(0) scale(1.08);
	box-shadow: 0 10px 24px -6px rgba(2, 8, 23, .55);
	color: var(--pcc-icon, #fff);
}

.pcc-fab__item:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.pcc-fab__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 55%;
	height: 55%;
}

.pcc-fab__icon svg,
.pcc-fab__icon img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

/* ---------- برچسب کنار آیکون ---------- */
.pcc-fab__label {
	position: absolute;
	top: 50%;
	transform: translateY(-50%) scale(.9);
	white-space: nowrap;
	background: var(--pcc-tip-bg, #0b1120);
	color: var(--pcc-tip-color, #fff);
	font-size: 13px;
	font-weight: 600;
	padding: 7px 12px;
	border-radius: 8px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
	box-shadow: 0 6px 16px -8px rgba(2, 8, 23, .6);
	unicode-bidi: plaintext;
}

.pcc-fab--right .pcc-fab__label { right: calc(100% + 12px); transform-origin: right center; }
.pcc-fab--left  .pcc-fab__label { left:  calc(100% + 12px); transform-origin: left center; }

.pcc-fab__label::after {
	content: "";
	position: absolute;
	top: 50%;
	margin-top: -5px;
	border: 5px solid transparent;
}

.pcc-fab--right .pcc-fab__label::after {
	left: -10px;
	border-left-color: var(--pcc-tip-bg, #0b1120);
}

.pcc-fab--left .pcc-fab__label::after {
	right: -10px;
	border-right-color: var(--pcc-tip-bg, #0b1120);
}

.pcc-fab__item:hover .pcc-fab__label,
.pcc-fab__item:focus-visible .pcc-fab__label,
.pcc-fab--labels .pcc-fab__label {
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.pcc-fab--labels .pcc-fab__label { transition-delay: var(--pcc-delay, 0ms); }

/* ---------- دکمه اصلی ---------- */
.pcc-fab__toggle {
	position: relative;
	width: var(--pcc-size, 60px);
	height: var(--pcc-size, 60px);
	border: 0;
	border-radius: 50%;
	background: var(--pcc-bg, #0f766e);
	color: var(--pcc-icon, #fff);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: 0 10px 26px -8px rgba(2, 8, 23, .6);
	transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
	-webkit-tap-highlight-color: transparent;
}

.pcc-fab__toggle:hover { transform: scale(1.06); }
.pcc-fab__toggle:active { transform: scale(.96); }

.pcc-fab__toggle:focus-visible {
	outline: 3px solid var(--pcc-main, #0f766e);
	outline-offset: 4px;
}

.pcc-fab__toggle-icon {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48%;
	height: 48%;
	transition: opacity .2s ease, transform .3s ease;
}

.pcc-fab__toggle-icon svg { width: 100%; height: 100%; display: block; }

.pcc-fab__toggle-icon--close {
	opacity: 0;
	transform: rotate(-90deg) scale(.6);
}

.pcc-fab[data-open="true"] .pcc-fab__toggle-icon--main {
	opacity: 0;
	transform: rotate(90deg) scale(.6);
}

.pcc-fab[data-open="true"] .pcc-fab__toggle-icon--close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

/* ---------- انیمیشن‌ها ---------- */
.pcc-anim-pulse .pcc-fab__toggle::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--pcc-main, #0f766e);
	opacity: .55;
	z-index: -1;
	animation: pcc-pulse 2.4s ease-out infinite;
}

@keyframes pcc-pulse {
	0%   { transform: scale(1);   opacity: .5; }
	70%  { transform: scale(1.6); opacity: 0; }
	100% { transform: scale(1.6); opacity: 0; }
}

.pcc-anim-bounce .pcc-fab__toggle { animation: pcc-bounce 2.6s ease-in-out infinite; }

@keyframes pcc-bounce {
	0%, 82%, 100% { transform: translateY(0); }
	88%           { transform: translateY(-8px); }
	94%           { transform: translateY(-3px); }
}

.pcc-anim-shake .pcc-fab__toggle-icon--main { animation: pcc-shake 3s ease-in-out infinite; transform-origin: 50% 60%; }

@keyframes pcc-shake {
	0%, 70%, 100%          { transform: rotate(0); }
	73%, 79%, 85%          { transform: rotate(-14deg); }
	76%, 82%, 88%          { transform: rotate(14deg); }
}

.pcc-fab[data-open="true"] .pcc-fab__toggle::before,
.pcc-fab[data-open="true"] .pcc-fab__toggle,
.pcc-fab[data-open="true"] .pcc-fab__toggle-icon--main {
	animation: none;
}

/* ---------- حباب پیام ---------- */
.pcc-fab__bubble {
	position: absolute;
	bottom: calc(var(--pcc-size, 60px) + 14px);
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 230px;
	background: #fff;
	color: #0b1120;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.7;
	padding: 10px 14px;
	border-radius: 14px;
	box-shadow: 0 12px 30px -10px rgba(2, 8, 23, .45);
	animation: pcc-bubble-in .35s cubic-bezier(.34, 1.56, .64, 1) both;
}

.pcc-fab--right .pcc-fab__bubble { right: 0; border-bottom-right-radius: 4px; }
.pcc-fab--left  .pcc-fab__bubble { left: 0;  border-bottom-left-radius: 4px; }

.pcc-fab[data-open="true"] .pcc-fab__bubble { display: none; }

@keyframes pcc-bubble-in {
	from { opacity: 0; transform: translateY(10px) scale(.9); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pcc-fab__bubble-close {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(2, 8, 23, .08);
	color: #0b1120;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pcc-fab__bubble-close svg { width: 10px; height: 10px; }
.pcc-fab__bubble-close:hover { background: rgba(2, 8, 23, .16); }

/* ---------- پیام کپی ---------- */
.pcc-fab__toast {
	position: absolute;
	bottom: calc(var(--pcc-size, 60px) + 14px);
	background: var(--pcc-tip-bg, #0b1120);
	color: var(--pcc-tip-color, #fff);
	font-size: 13px;
	font-weight: 600;
	padding: 9px 14px;
	border-radius: 10px;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}

.pcc-fab--right .pcc-fab__toast { right: 0; }
.pcc-fab--left  .pcc-fab__toast { left: 0; }

.pcc-fab__toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ---------- موبایل ---------- */
@media (max-width: 480px) {
	.pcc-fab__label {
		font-size: 12px;
		padding: 6px 10px;
	}
	.pcc-fab__bubble { max-width: 190px; font-size: 12px; }
}

/* ---------- احترام به تنظیم کاهش انیمیشن ---------- */
@media (prefers-reduced-motion: reduce) {
	.pcc-fab *,
	.pcc-fab *::before,
	.pcc-fab *::after {
		animation: none !important;
		transition-duration: .01ms !important;
	}
}

/* ---------- چاپ ---------- */
@media print {
	.pcc-fab { display: none !important; }
}
