/**
 * Floating Action Widgets - Frontend Stylesheet
 */

:root {
	--fw-bottom-offset: 20px;
	--fw-side-offset: 20px;
	--fw-spacing: 15px;
	--fw-size: 54px;
}

/* Floating Container */
.fw-container {
	position: fixed;
	bottom: var(--fw-bottom-offset);
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: var(--fw-spacing);
	z-index: 999999;
	pointer-events: none;
}

.fw-position-left {
	left: var(--fw-side-offset);
}

.fw-position-right {
	right: var(--fw-side-offset);
}

/* Base Widget Button */
.fw-widget-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--fw-size);
	height: var(--fw-size);
	border-radius: 50%;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	text-decoration: none !important;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.2s ease;
	position: relative;
	pointer-events: auto;
}

/* Icon style */
.fw-widget-btn svg {
	width: 45%;
	height: 45%;
	fill: currentColor;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hover effects */
.fw-widget-btn:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.fw-widget-btn:hover svg {
	transform: scale(1.1) rotate(5deg);
}

/* Active/Press effect */
.fw-widget-btn:active {
	transform: scale(0.95);
}

/* Tooltip Styles */
.fw-tooltip {
	position: absolute;
	background: #1e293b;
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	pointer-events: none;
}

/* Left Position Tooltip -> appears to the Right */
.fw-position-left .fw-tooltip {
	left: calc(var(--fw-size) + 12px);
	transform: translateX(-10px);
}

/* Right Position Tooltip -> appears to the Left */
.fw-position-right .fw-tooltip {
	right: calc(var(--fw-size) + 12px);
	transform: translateX(10px);
}

/* Hover triggers tooltip display */
.fw-widget-btn:hover .fw-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

/* Tooltip arrow/triangle */
.fw-tooltip::after {
	content: '';
	position: absolute;
	top: 50%;
	margin-top: -5px;
	border-width: 5px;
	border-style: solid;
}

.fw-position-left .fw-tooltip::after {
	right: 100%;
	border-color: transparent #1e293b transparent transparent;
}

.fw-position-right .fw-tooltip::after {
	left: 100%;
	border-color: transparent transparent transparent #1e293b;
}

/* Soft Attention Grabber Ripple Animation */
.fw-pulse {
	animation: fw-ripple-anim 2s infinite;
}

@keyframes fw-ripple-anim {
	0% {
		box-shadow: 0 0 0 0 rgba(var(--fw-ripple-rgb, 7, 94, 84), 0.5), 0 4px 15px rgba(0, 0, 0, 0.15);
	}
	70% {
		box-shadow: 0 0 0 12px rgba(var(--fw-ripple-rgb, 7, 94, 84), 0), 0 4px 15px rgba(0, 0, 0, 0.15);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(var(--fw-ripple-rgb, 7, 94, 84), 0), 0 4px 15px rgba(0, 0, 0, 0.15);
	}
}

/* Fade-in Entrance Animation for Widgets */
@keyframes fw-entrance {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.8);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.fw-widget-btn {
	animation: fw-entrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Stagger entrance animations */
.fw-widget-btn:nth-child(1) { animation-delay: 0.1s; }
.fw-widget-btn:nth-child(2) { animation-delay: 0.2s; }
.fw-widget-btn:nth-child(3) { animation-delay: 0.3s; }
.fw-widget-btn:nth-child(4) { animation-delay: 0.4s; }
.fw-widget-btn:nth-child(5) { animation-delay: 0.5s; }

/* Responsive adjustments */
@media (max-width: 480px) {
	:root {
		--fw-bottom-offset: 15px;
		--fw-side-offset: 15px;
		--fw-spacing: 12px;
		--fw-size: 48px;
	}
	.fw-tooltip {
		display: none; /* Hide tooltips on mobile to avoid screen overlap/clutter */
	}
}
