/**
 * FloatChat – Chat Button - Public Styles
 *
 * @package FloatChatButton
 * @since   1.0.0
 */

/* ============================================================
   WRAPPER
   ============================================================ */
.fcb-button-wrap {
	position: fixed;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	--fcb-bg: #25D366;
	--fcb-icon: #ffffff;
}

.fcb-pos-bottom_left {
	align-items: flex-start;
}

/* ============================================================
   BUTTON
   ============================================================ */
.fcb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: var(--fcb-bg);
	color: var(--fcb-icon);
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	transition: transform .2s, box-shadow .2s;
	cursor: pointer;
	border: none;
	outline: none;
	position: relative;
}

.fcb-button:hover,
.fcb-button:focus {
	transform: scale(1.08);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .30);
	text-decoration: none;
}

.fcb-button:focus-visible {
	outline: 3px solid var(--fcb-bg);
	outline-offset: 3px;
}

/* ============================================================
   ICON
   ============================================================ */
.fcb-icon {
	width: 28px;
	height: 28px;
	fill: var(--fcb-icon);
	flex-shrink: 0;
}

/* ============================================================
   ICON + TEXT STYLE
   ============================================================ */
.fcb-has-text .fcb-button {
	width: auto;
	border-radius: 50px;
	padding: 0 18px;
}

.fcb-btn-text {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--fcb-icon);
	white-space: nowrap;
}

/* ============================================================
   TOOLTIP
   ============================================================ */
.fcb-tooltip {
	position: absolute;
	bottom: calc(100% + 10px);
	right: 0;
	background: #1a202c;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .2s, transform .2s;
	z-index: 1;
}

.fcb-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	right: 18px;
	border: 5px solid transparent;
	border-top-color: #1a202c;
}

.fcb-pos-bottom_left .fcb-tooltip {
	right: auto;
	left: 0;
}

.fcb-pos-bottom_left .fcb-tooltip::after {
	right: auto;
	left: 18px;
}

.fcb-button-wrap:hover .fcb-tooltip,
.fcb-button:focus ~ .fcb-tooltip {
	opacity: 1;
	transform: translateY(0);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Fade In */
.fcb-anim-fade_in .fcb-button {
	animation: fcb-fadeIn .6s ease both;
}

@keyframes fcb-fadeIn {
	from { opacity: 0; transform: scale(.6); }
	to   { opacity: 1; transform: scale(1); }
}

/* Pulse (rings) */
.fcb-anim-pulse .fcb-button::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--fcb-bg);
	opacity: .5;
	animation: fcb-pulse 2s ease-out infinite;
	z-index: -1;
}

.fcb-has-text .fcb-button::before {
	border-radius: 50px;
}

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

/* Bounce */
.fcb-anim-bounce .fcb-button {
	animation: fcb-bounce 1.4s ease infinite;
}

@keyframes fcb-bounce {
	0%, 100% { transform: translateY(0); }
	40%       { transform: translateY(-12px); }
	60%       { transform: translateY(-6px); }
}

/* Shake */
.fcb-anim-shake .fcb-button {
	animation: fcb-shake 3s ease infinite;
}

@keyframes fcb-shake {
	0%, 90%, 100% { transform: rotate(0deg); }
	92%           { transform: rotate(-10deg); }
	94%           { transform: rotate(10deg); }
	96%           { transform: rotate(-8deg); }
	98%           { transform: rotate(8deg); }
}

/* ============================================================
   DEVICE VISIBILITY (via JS classes added to body)
   ============================================================ */
body.fcb-hide-desktop .fcb-button-wrap { display: none; }

@media (max-width: 1024px) {
	body.fcb-hide-tablet .fcb-button-wrap { display: none; }
}

@media (max-width: 480px) {
	body.fcb-hide-mobile .fcb-button-wrap { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
	.fcb-button,
	.fcb-button::before,
	.fcb-tooltip {
		animation: none !important;
		transition: none !important;
	}
}
