@font-face {
	font-family: "Vazirmatn";
	src: url("../font/Vazirmatn-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Kalameh";
	src: url("../font/Kalameh-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Kalameh";
	src: url("../font/Kalameh-Bold.woff2") format("woff2");
	font-weight: bold;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "YekanBakh";
	src: url("../font/YekanBakh-Regular.woff2") format("woff2");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "YekanBakh";
	src: url("../font/YekanBakh-Bold.woff2") format("woff2");
	font-weight: bold;
	font-style: normal;
	font-display: swap;
}

:root {
	--bc-primary: linear-gradient(135deg, #0084ff 0%, #00c6ff 100%);
	--bc-admin-bg: linear-gradient(135deg, #0084ff 0%, #00c6ff 100%);
	--bc-user-bg: #f0f2f5;
	--bc-text-primary: #1c1e21;
	--bc-admin-text: #ffffff;
	--bc-user-text: #1c1e21;
	--bc-msg-history-bg: #ffffff;
	--bc-wrapper-bg: #ffffff;
	--bc-input-bg: #f0f2f5;
	--bc-input-border: #e0e0e0;
	--bc-font: "Vazirmatn", Tahoma, Arial, sans-serif;
}

.bc-support-wrapper {
	font-family: var(--bc-font) !important;
	max-width: 800px;
	margin: 20px auto;
	padding: 16px;
	color: var(--bc-text-primary);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bc-support-header {
	padding: 12px;
	color: var(--bc-text-primary);
	border-radius: 24px;
	text-align: center;
}

.bc-support-header h3 {
	margin: 0;
	font-size: 1.2rem;
	margin-bottom: 16px !important;
	color: inherit !important;
}

.bc-support-header p {
	margin: 5px 0 0;
	opacity: 0.6;
	font-size: 0.9rem;
}

.bc-message-wrapper {
	font-family: var(--bc-font) !important;
	background: var(--bc-wrapper-bg);
	border-radius: 32px;
	padding: 20px;
	padding-top: 0;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
	position: relative;
}

.bc-message-wrapper::before {
	content: "";
	border-radius: inherit;
	position: absolute;
	inset: 0;
	box-shadow:
		inset 0 2px 2px rgba(0, 0, 0, 0.15),
		inset 0 -2px 2px rgba(0, 0, 0, 0.15);
	z-index: 2;
	pointer-events: none;
}

.bc-message-history {
	height: 350px;
	overflow-y: auto;
	padding-block: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--bc-msg-history-bg);
	border-radius: 12px 12px 0 0;
	margin-bottom: 16px;
	scroll-behavior: smooth;
}

.bc-message-history::-webkit-scrollbar {
	width: 6px;
}

.bc-message-history::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 10px;
}

.bc-msg-item {
	display: flex;
	width: 100%;
	animation: fbFadeIn 0.3s ease-out;
}

@keyframes fbFadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.bc-msg-user {
	justify-content: flex-start;
}

.bc-msg-admin {
	justify-content: flex-end;
}

.bc-msg-bubble {
	max-width: 75%;
	padding: 12px 18px;
	border-radius: 18px;
	position: relative;
	font-size: 0.9rem;
	line-height: 1.6;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.bc-msg-user .bc-msg-bubble {
	background: var(--bc-user-bg);
	color: var(--bc-user-text, #1c1e21);
	border-bottom-right-radius: 4px;
}

.bc-msg-admin .bc-msg-bubble {
	background: var(--bc-admin-bg);
	color: var(--bc-admin-text, #fff);
	border-bottom-left-radius: 4px;
}

.bc-msg-time {
	display: block;
	font-size: 0.625rem;
	opacity: 0.6;
	margin-top: 8px;
	text-align: left;
}

.bc-message-input-area {
	display: flex !important;
	align-items: end !important;
	gap: 8px;
	background: #fff;
	border-radius: 32px;
}

.bc-message-text {
	flex-grow: 1;
	font-family: var(--bc-font) !important;
	font-size: 1rem;
	line-height: 1.5;
	border-radius: 25px !important;
	border: 2px solid var(--bc-input-border) !important;
	padding: 12px 20px !important;
	resize: none !important;
	background: var(--bc-input-bg) !important;
	transition: all 0.3s;
	outline: none;
	field-sizing: content;
	overflow: hidden;
	max-height: 140px;
	width: auto !important;
	box-sizing: border-box !important;
}

/* مرورگرهایی که از field-sizing: content پشتیبانی نمی‌کنند (غیر از کرومیوم ۱۲۳+)
   بدون rows مشخص، textarea را با ارتفاع پیش‌فرض بسیار کوچک نمایش می‌دهند؛
   وقتی این ویژگی پشتیبانی نشود، حداقل یک ارتفاع قابل‌پیش‌بینی با min-height تضمین می‌شود. */
@supports not (field-sizing: content) {
	.bc-message-text {
		overflow-y: auto !important;
		min-height: 48px;
	}
}

.bc-message-text::placeholder {
	font-size: inherit;
	line-height: inherit;
}

.bc-message-text:focus {
	border-color: var(--bc-primary);
}

.bc-send-btn {
	background: var(--bc-primary) !important;
	color: #fff !important;
	border: none !important;
	padding: 0 8px !important;
	width: 120px !important;
	height: 48px !important;
	border-radius: 25px !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px;
	flex-shrink: 0;
	font-family: var(--bc-font) !important;
	font-weight: bold;
	box-shadow: 0 4px 20px -12px #0056ab;
	transition: box-shadow 0.4s ease;
}

.bc-send-btn:hover {
	box-shadow: 0 4px 20px -8px #0056ab;
}

.bc-send-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	box-shadow: 0 4px 20px -8px #848484;
	transition: none;
}

.bc-spinner {
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: bc-spin 1s ease-in-out infinite;
}

@keyframes bc-spin {
	to {
		transform: rotate(360deg);
	}
}

.bc-support-notice {
	padding: 16px 20px;
	font-size: 0.8rem;
	opacity: 0.6;
	text-align: center;
}

.bc-msg-sending .bc-msg-bubble {
	opacity: 0.5;
	transition: opacity 0.3s ease;
}

.bc-msg-failed {
	animation: fbFadeOut 0.4s forwards ease-in !important;
}

@keyframes fbFadeOut {
	from {
		opacity: 1;
		transform: scale(1);
		max-height: 200px;
	}

	to {
		opacity: 0;
		transform: scale(0.8);
		max-height: 0;
		margin: 0;
		padding: 0;
		overflow: hidden;
	}
}

.bc-unread-badge {
	background-color: #ff3b30;
	color: #ffffff;
	font-size: 11px;
	font-weight: bold;
	padding: 2px 8px;
	border-radius: 12px;
	margin-right: 8px;
	display: inline-block;
	vertical-align: middle;
	line-height: 1.4;
	box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
}

.bc-badge-fade-in {
	animation: fbBadgeFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	transform-origin: center right;
}

@keyframes fbBadgeFadeIn {
	from {
		opacity: 0;
		transform: scale(0.6) translateY(2px);
	}

	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.bc_unread_divider {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 20px 0;
	position: relative;
	width: 100%;
	animation: fbFadeIn 0.5s ease-out;
	box-shadow: none;
	border-color: #ddd;
}

.bc_unread_divider::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, #c3c3c3 50%, transparent);
	z-index: 1;
}

.bc_unread_divider_text {
	background: #eee;
	color: #656565;
	font-size: 0.6rem;
	font-weight: bold;
	padding: 4px 8px;
	border-radius: 20px;
	position: relative;
	z-index: 2;
	border: 1px solid #ddd;
}

@media (max-width: 768px) {
	.bc-support-wrapper {
		padding: 8px;
		margin: 8px auto;
	}

	.bc-message-wrapper {
		border-radius: 20px;
		padding: 12px;
		padding-top: 0;
	}

	.bc-message-history {
		height: 300px;
	}

	.bc-msg-bubble {
		max-width: 88%;
		padding: 10px 14px;
		font-size: 0.85rem;
	}

	.bc-message-input-area {
		gap: 6px;
	}

	.bc-message-text {
		font-size: 0.9rem;
		padding: 10px 14px;
	}

	.bc-send-btn {
		width: 48px;
		height: 48px;
		border-radius: 50%;
		padding: 0;
	}

	.bc-btn-text {
		display: none;
	}
}

@media (max-width: 480px) {
	.bc-message-wrapper {
		border-radius: 16px;
	}

	.bc-message-history {
		height: 260px;
	}

	.bc-msg-bubble {
		max-width: 92%;
		font-size: 0.82rem;
	}
}

:root {
	--bc-float-color-start: #0084ff;
	--bc-float-color-end: #00c6ff;
	--bc-float-icon-color: #ffffff;
}

#bc-float-container {
	position: fixed;
	bottom: 24px;
	z-index: 99999;
	font-family: var(--bc-font, Vazirmatn, Tahoma, sans-serif) !important;
}

.bc-float-pos-left {
	left: 24px;
	right: auto;
}

.bc-float-pos-right {
	right: 24px;
	left: auto;
}

.bc-float-chatbox-panel {
	display: none;
	position: absolute;
	bottom: 74px;
	width: 340px;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	flex-direction: column;
	border: 1.5px solid #e5e9f2;
}

.bc-float-pos-left .bc-float-chatbox-panel {
	left: 0;
}

.bc-float-pos-right .bc-float-chatbox-panel {
	right: 0;
}

.bc-float-header {
	background: linear-gradient(135deg, var(--bc-float-color-start) 0%, var(--bc-float-color-end) 100%);
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bc-float-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bc-float-header-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

.bc-float-header-title {
	color: #fff;
	font-weight: 700;
	font-size: 14px;
}

.bc-float-header-subtitle {
	color: rgba(255, 255, 255, 0.75);
	font-size: 11px;
}

.bc-float-close-btn {
	background: rgba(255, 255, 255, 0.15) !important;
	border: none !important;
	border-radius: 50% !important;
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	max-width: none !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: background 0.2s;
	flex-shrink: 0;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1;
	box-shadow: none !important;
}

.bc-float-close-icon {
	color: #ffffff !important;
	font-size: 15px;
	line-height: 1;
	font-family: Arial, sans-serif;
	font-style: normal;
	font-weight: 400;
	display: block;
	margin-top: -1px;
}

.bc-float-message-list {
	height: 280px;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--bc-msg-history-bg, #fff);
	scroll-behavior: smooth;
}

.bc-float-input-row {
	padding: 12px;
	border-top: 1.5px solid #f0f0f0;
	background: #fff;
	display: flex !important;
	flex-direction: row !important;
	gap: 8px;
	align-items: flex-end !important;
}

.bc-float-textarea {
	flex: 1 1 auto !important;
	border: 2px solid var(--bc-input-border, #e0e0e0) !important;
	border-radius: 14px !important;
	padding: 10px 14px !important;
	font-size: 13px;
	font-family: inherit;
	resize: none !important;
	outline: none;
	background: var(--bc-input-bg, #f0f2f5) !important;
	field-sizing: content;
	overflow: hidden;
	max-height: 100px;
	width: auto !important;
	box-sizing: border-box !important;
	transition: border-color 0.2s;
}

@supports not (field-sizing: content) {
	.bc-float-textarea {
		overflow-y: auto !important;
		min-height: 40px;
	}
}

.bc-float-send-btn {
	background: linear-gradient(135deg, var(--bc-float-color-start) 0%, var(--bc-float-color-end) 100%) !important;
	border: none !important;
	border-radius: 14px !important;
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	padding: 0 !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0;
	box-shadow: none !important;
	transition: opacity 0.2s;
}

.bc-float-btn-wrap {
	position: relative;
	display: inline-flex;
}

#bc-float-btn {
	width: 58px !important;
	height: 58px !important;
	min-width: 58px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: linear-gradient(135deg, var(--bc-float-color-start) 0%, var(--bc-float-color-end) 100%) !important;
	border: none !important;
	cursor: pointer;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow: 0 4px 20px rgba(0, 132, 255, 0.4);
	transition: transform 0.3s, box-shadow 0.3s;
	color: var(--bc-float-icon-color);
}

.bc-float-icon-open {
	display: flex;
	align-items: center;
	justify-content: center;
}

.bc-float-icon-close {
	display: none;
	align-items: center;
	justify-content: center;
}

.bc-float-badge {
	display: none;
	position: absolute;
	top: -4px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 20px;
	height: 20px;
	border-radius: 10px;
	padding: 0 5px;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
	pointer-events: none;
}

.bc-float-pos-left .bc-float-badge {
	right: -4px;
	left: auto;
}

.bc-float-pos-right .bc-float-badge {
	left: -4px;
	right: auto;
}

#bc-float-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 28px rgba(0, 132, 255, 0.55);
}

#bc-float-btn:active {
	transform: scale(0.95);
}

#bc-float-chatbox {
	animation: bc-float-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bc-float-slide-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.96);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

#bc-float-message-list::-webkit-scrollbar {
	width: 4px;
}

#bc-float-message-list::-webkit-scrollbar-thumb {
	background: #ddd;
	border-radius: 10px;
}

#bc-float-message-text:focus {
	border-color: var(--bc-float-color-start, #0084ff);
	background: #fff;
}

#bc-float-send-btn:hover {
	opacity: 0.88;
}

#bc-float-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#bc-float-close:hover {
	background: rgba(255, 255, 255, 0.28) !important;
}

@media (max-width: 768px) {
	#bc-float-container {
		bottom: 16px !important;
	}

	.bc-float-chatbox-panel {
		width: calc(100vw - 32px) !important;
		max-height: calc(100vh - 120px);
		border-radius: 18px !important;
	}

	#bc-float-message-list {
		height: calc(100vh - 280px) !important;
		max-height: 380px;
	}
}

@media (max-width: 480px) {
	#bc-float-container {
		bottom: 12px !important;
	}

	.bc-float-chatbox-panel {
		width: calc(100vw - 24px) !important;
		max-height: calc(100vh - 100px);
		border-radius: 16px !important;
	}

	#bc-float-message-list {
		height: calc(100vh - 260px) !important;
		max-height: 340px;
	}

	#bc-float-btn {
		width: 52px !important;
		height: 52px !important;
	}

	.bc-float-chatbox-panel {
		bottom: 68px;
	}
}

#bc-float-badge {
	animation: bc-badge-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bc-badge-pop {
	from {
		opacity: 0;
		transform: scale(0.5);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes bc-float-pulse {
	0% {
		box-shadow: 0 4px 20px rgba(0, 132, 255, 0.4);
	}

	50% {
		box-shadow: 0 4px 28px rgba(0, 132, 255, 0.65);
	}

	100% {
		box-shadow: 0 4px 20px rgba(0, 132, 255, 0.4);
	}
}

#bc-float-btn.bc-float-idle {
	animation: bc-float-pulse 3s ease-in-out infinite;
}

@keyframes bc-float-shake {
	0% {
		transform: rotate(0deg) scale(1);
	}

	10% {
		transform: rotate(-12deg) scale(1.08);
	}

	20% {
		transform: rotate(10deg) scale(1.08);
	}

	30% {
		transform: rotate(-10deg) scale(1.05);
	}

	40% {
		transform: rotate(8deg) scale(1.05);
	}

	50% {
		transform: rotate(-6deg) scale(1.02);
	}

	60% {
		transform: rotate(4deg) scale(1.02);
	}

	70% {
		transform: rotate(-2deg) scale(1);
	}

	80% {
		transform: rotate(1deg) scale(1);
	}

	100% {
		transform: rotate(0deg) scale(1);
	}
}

#bc-float-btn.bc-float-shake {
	animation: bc-float-shake 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

#bc-toast-container {
	position: fixed;
	bottom: 24px;
	left: 24px;
	top: auto;
	transform: none;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	pointer-events: none;
	font-family: var(--bc-font, "Vazirmatn", Tahoma, sans-serif) !important;
}

.bc-toast {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	border-radius: 14px;
	min-width: 260px;
	max-width: 420px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
	pointer-events: all;
	animation: bc-toast-in 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	direction: rtl;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
}

.bc-toast.bc-toast-hiding {
	animation: bc-toast-out 0.3s ease-in forwards;
}

.bc-toast-success {
	background: #f0fdf4;
	border: 1.5px solid #86efac;
	color: #15803d;
}

.bc-toast-error {
	background: #fef2f2;
	border: 1.5px solid #fca5a5;
	color: #b91c1c;
}

.bc-toast-warning {
	background: #fffbeb;
	border: 1.5px solid #fcd34d;
	color: #92400e;
}

.bc-toast-info {
	background: #f0f9ff;
	border: 1.5px solid #7dd3fc;
	color: #0369a1;
}

.bc-toast-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bc-toast-msg {
	flex: 1;
}

@keyframes bc-toast-in {
	from {
		opacity: 0;
		transform: translateY(-14px) scale(0.95);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes bc-toast-out {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}

	to {
		opacity: 0;
		transform: translateY(-10px) scale(0.95);
	}
}

#bc-confirm-overlay {
	position: fixed;
	inset: 0;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	animation: bc-overlay-in 0.22s ease forwards;
	font-family: var(--bc-font, "Vazirmatn", Tahoma, sans-serif) !important;
	direction: rtl;
}

#bc-confirm-overlay.bc-overlay-hiding {
	animation: bc-overlay-out 0.2s ease forwards;
}

.bc-confirm-card {
	background: #fff;
	border-radius: 20px;
	padding: 32px 28px 24px;
	max-width: 380px;
	width: calc(100% - 48px);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	animation: bc-card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	text-align: center;
}

.bc-confirm-icon-wrap {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bc-confirm-icon-wrap.bc-confirm-icon-danger {
	background: #fef2f2;
}

.bc-confirm-icon-wrap.bc-confirm-icon-warning {
	background: #fffbeb;
}

.bc-confirm-title {
	font-size: 16px;
	font-weight: 700;
	color: #1c1e21;
	margin: 0;
	line-height: 1.5;
}

.bc-confirm-desc {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
	line-height: 1.7;
}

.bc-confirm-actions {
	display: flex;
	gap: 10px;
	width: 100%;
	margin-top: 4px;
}

.bc-confirm-btn-cancel {
	flex: 1;
	padding: 11px 16px;
	border-radius: 12px;
	border: 2px solid #e5e9f2;
	background: #f9fafb;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.18s, border-color 0.18s;
}

.bc-confirm-btn-cancel:hover {
	background: #f3f4f6;
	border-color: #d1d5db;
}

.bc-confirm-btn-ok {
	flex: 1;
	padding: 11px 16px;
	border-radius: 12px;
	border: none;
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.18s;
}

.bc-confirm-btn-ok:hover {
	opacity: 0.9;
}

@keyframes bc-overlay-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes bc-overlay-out {
	from {
		opacity: 1;
	}

	to {
		opacity: 0;
	}
}

@keyframes bc-card-in {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(16px);
	}

	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}
