/**
 * WP Floating Contact Buttons - Frontend Styles
 * Ultra-lightweight, high performance, zero external fonts.
 */

:root {
	--wfcb-side-offset: 20px;
	--wfcb-bottom-offset: 25px;
	--wfcb-main-color: #e60000;
	--wfcb-btn-size: 54px;
	--wfcb-item-size: 46px;
	--wfcb-transition: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   Base Floating Container - Strictly Centered Column
   ========================================================================== */
#wfcb-floating-widget.wfcb-widget {
	position: fixed !important;
	z-index: 99999 !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important; /* Đảm bảo tất cả icon luôn thẳng hàng 1 đường dọc */
	justify-content: flex-end !important;
	width: var(--wfcb-btn-size) !important;
	max-width: var(--wfcb-btn-size) !important;
	gap: 12px !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
	-webkit-font-smoothing: antialiased;
	pointer-events: auto;
}

#wfcb-floating-widget *,
#wfcb-floating-widget *::before,
#wfcb-floating-widget *::after {
	box-sizing: border-box !important;
}

/* Position: Bottom Right */
#wfcb-floating-widget.wfcb-pos-bottom-right {
	right: var(--wfcb-side-offset) !important;
	left: auto !important;
	bottom: var(--wfcb-bottom-offset) !important;
}

/* Position: Bottom Left */
#wfcb-floating-widget.wfcb-pos-bottom-left {
	left: var(--wfcb-side-offset) !important;
	right: auto !important;
	bottom: var(--wfcb-bottom-offset) !important;
}

/* ==========================================================================
   Main Trigger Button (Speed Dial)
   ========================================================================== */
#wfcb-floating-widget .wfcb-main-btn {
	position: relative !important;
	width: var(--wfcb-btn-size) !important;
	height: var(--wfcb-btn-size) !important;
	min-width: var(--wfcb-btn-size) !important;
	min-height: var(--wfcb-btn-size) !important;
	border-radius: 50% !important;
	background-color: var(--wfcb-main-color) !important;
	color: #ffffff !important;
	border: none !important;
	outline: none !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 auto !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28) !important;
	transition: transform 0.25s ease, box-shadow 0.25s ease !important;
	user-select: none !important;
	-webkit-tap-highlight-color: transparent !important;
	flex-shrink: 0 !important;
}

#wfcb-floating-widget .wfcb-main-btn:hover {
	transform: scale(1.08) !important;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.36) !important;
}

#wfcb-floating-widget .wfcb-main-btn:active {
	transform: scale(0.95) !important;
}

#wfcb-floating-widget .wfcb-main-btn .wfcb-icon-open,
#wfcb-floating-widget .wfcb-main-btn .wfcb-icon-close {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease !important;
}

#wfcb-floating-widget .wfcb-main-btn .wfcb-icon-close {
	opacity: 0 !important;
	transform: translate(-50%, -50%) rotate(-90deg) scale(0.6) !important;
	pointer-events: none !important;
}

#wfcb-floating-widget.is-open .wfcb-main-btn .wfcb-icon-open {
	opacity: 0 !important;
	transform: translate(-50%, -50%) rotate(90deg) scale(0.6) !important;
	pointer-events: none !important;
}

#wfcb-floating-widget.is-open .wfcb-main-btn .wfcb-icon-close {
	opacity: 1 !important;
	transform: translate(-50%, -50%) rotate(0deg) scale(1) !important;
	pointer-events: auto !important;
}

/* ==========================================================================
   Animations: Pulse Radar & Phone Shake
   ========================================================================== */
#wfcb-floating-widget .wfcb-pulse-radar {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	border-radius: 50% !important;
	background: inherit !important;
	opacity: 0.8 !important;
	pointer-events: none !important;
	animation: wfcb-pulse 2.2s infinite cubic-bezier(0.24, 0, 0.38, 1) !important;
	z-index: -1 !important;
}

#wfcb-floating-widget .wfcb-pulse-delay {
	animation-delay: 0.9s !important;
}

@keyframes wfcb-pulse {
	0% {
		transform: scale(1);
		opacity: 0.75;
	}
	50% {
		opacity: 0.35;
	}
	100% {
		transform: scale(1.85);
		opacity: 0;
	}
}

/* Natural Periodic Phone Shake (shakes for 0.8s, then rests 2.2s) */
#wfcb-floating-widget .wfcb-has-shake,
#wfcb-floating-widget .wfcb-item-shake {
	animation: wfcb-periodic-shake 3.2s infinite ease-in-out !important;
}

@keyframes wfcb-periodic-shake {
	0%, 25%, 100% {
		transform: rotate(0deg);
	}
	2%, 6%, 10%, 14%, 18% {
		transform: rotate(-10deg);
	}
	4%, 8%, 12%, 16%, 20% {
		transform: rotate(10deg);
	}
	22% {
		transform: rotate(0deg);
	}
}

/* ==========================================================================
   Items List & Buttons - Strictly Centered Vertical Column
   ========================================================================== */
#wfcb-floating-widget .wfcb-items-container {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important; /* Thẳng hàng tuyệt đối */
	justify-content: center !important;
	width: 100% !important;
	gap: 12px !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

/* Speed Dial Closed State */
#wfcb-floating-widget.wfcb-layout-speed-dial .wfcb-items-container {
	opacity: 0 !important;
	pointer-events: none !important;
	transform: translateY(16px) !important;
	transition: opacity 0.25s ease, transform 0.25s var(--wfcb-transition) !important;
}

/* Speed Dial Opened State */
#wfcb-floating-widget.wfcb-layout-speed-dial.is-open .wfcb-items-container {
	opacity: 1 !important;
	pointer-events: auto !important;
	transform: translateY(0) !important;
}

/* Stacked Layout Always Visible */
#wfcb-floating-widget.wfcb-layout-stacked .wfcb-items-container {
	opacity: 1 !important;
	pointer-events: auto !important;
}

/* Item Wrapper - Standardized Width to keep axis centered */
#wfcb-floating-widget .wfcb-item {
	position: relative !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: var(--wfcb-btn-size) !important;
	height: var(--wfcb-item-size) !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Channel Button */
#wfcb-floating-widget .wfcb-btn {
	position: relative !important;
	width: var(--wfcb-item-size) !important;
	height: var(--wfcb-item-size) !important;
	min-width: var(--wfcb-item-size) !important;
	min-height: var(--wfcb-item-size) !important;
	border-radius: 50% !important;
	color: #ffffff !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-decoration: none !important;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22) !important;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease !important;
	-webkit-tap-highlight-color: transparent !important;
	margin: 0 auto !important;
	padding: 0 !important;
	border: none !important;
	line-height: 1 !important;
}

#wfcb-floating-widget .wfcb-btn:hover {
	transform: scale(1.14) !important;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32) !important;
	color: #ffffff !important;
}

#wfcb-floating-widget .wfcb-btn:active {
	transform: scale(0.95) !important;
}

#wfcb-floating-widget .wfcb-btn svg {
	display: block !important;
	margin: 0 auto !important;
}

/* ==========================================================================
   Tooltips / Labels - Absolutely Positioned to NOT push buttons
   ========================================================================== */
#wfcb-floating-widget .wfcb-tooltip {
	position: absolute !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	background: rgba(17, 24, 39, 0.92) !important;
	color: #ffffff !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	padding: 6px 12px !important;
	border-radius: 6px !important;
	white-space: nowrap !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
	pointer-events: none !important;
	backdrop-filter: blur(4px) !important;
	-webkit-backdrop-filter: blur(4px) !important;
	z-index: 999999 !important;
}

/* Tooltip on Right Side Widget -> Displays to the LEFT */
#wfcb-floating-widget.wfcb-pos-bottom-right .wfcb-tooltip {
	right: calc(100% + 12px) !important;
	left: auto !important;
}

/* Tooltip on Left Side Widget -> Displays to the RIGHT */
#wfcb-floating-widget.wfcb-pos-bottom-left .wfcb-tooltip {
	left: calc(100% + 12px) !important;
	right: auto !important;
}

/* Hover Mode */
#wfcb-floating-widget.wfcb-labels-hover.wfcb-pos-bottom-right .wfcb-tooltip {
	opacity: 0 !important;
	visibility: hidden !important;
	transform: translateY(-50%) translateX(8px) !important;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s !important;
}

#wfcb-floating-widget.wfcb-labels-hover.wfcb-pos-bottom-left .wfcb-tooltip {
	opacity: 0 !important;
	visibility: hidden !important;
	transform: translateY(-50%) translateX(-8px) !important;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s !important;
}

#wfcb-floating-widget.wfcb-labels-hover .wfcb-item:hover .wfcb-tooltip {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(-50%) translateX(0) !important;
}

/* Always Mode */
#wfcb-floating-widget.wfcb-labels-always .wfcb-tooltip {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(-50%) translateX(0) !important;
}

/* None Mode */
#wfcb-floating-widget.wfcb-labels-none .wfcb-tooltip {
	display: none !important;
}

/* ==========================================================================
   Mobile Bottom Bar
   ========================================================================== */
.wfcb-mobile-bar {
	position: fixed !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 99998 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-around !important;
	background: rgba(255, 255, 255, 0.95) !important;
	backdrop-filter: blur(12px) !important;
	-webkit-backdrop-filter: blur(12px) !important;
	border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
	box-shadow: 0 -3px 16px rgba(0, 0, 0, 0.08) !important;
	padding: 8px 12px !important;
	padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
	box-sizing: border-box !important;
}

.wfcb-bar-item {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	text-decoration: none !important;
	color: #374151 !important;
	flex: 1 !important;
	gap: 4px !important;
	transition: transform 0.15s ease, color 0.15s ease !important;
	-webkit-tap-highlight-color: transparent !important;
}

.wfcb-bar-item:active {
	transform: scale(0.92) !important;
}

.wfcb-bar-icon {
	width: 38px !important;
	height: 38px !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #ffffff !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}

.wfcb-bar-text {
	font-size: 11px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	color: #1f2937 !important;
	text-align: center !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	max-width: 90px !important;
}

/* Desktop: Hide Mobile Bar */
@media (min-width: 768px) {
	.wfcb-mobile-bar {
		display: none !important;
	}
}

/* ==========================================================================
   Responsive: Ẩn tuyệt đối nút dọc trên điện thoại (Mobile)
   ========================================================================== */
@media screen and (max-width: 820px), screen and (max-device-width: 820px) {
	#wfcb-floating-widget,
	.wfcb-widget {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		pointer-events: none !important;
		width: 0 !important;
		height: 0 !important;
		overflow: hidden !important;
	}
}

/* Print Hide */
@media print {
	#wfcb-floating-widget,
	.wfcb-mobile-bar {
		display: none !important;
	}
}
