/**
 * MTWhatsapp Frontend Stylesheet
 * Ultra-lightweight, responsive, zero-dependency CSS.
 */

:root {
	--mtwa-bg: #25D366;
	--mtwa-icon-color: #FFFFFF;
	--mtwa-offset-x: 20px;
	--mtwa-offset-y: 20px;
	--mtwa-size: 60px;
	--mtwa-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
	--mtwa-shadow-hover: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* Floating Container Fixed Base */
.mtwa-floating-container {
	position: fixed;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	pointer-events: auto;
	box-sizing: border-box;
}

/* 6 Floating Positions */
.mtwa-floating-container.mtwa-pos-bottom-right {
	bottom: var(--mtwa-offset-y);
	right: var(--mtwa-offset-x);
	align-items: flex-end;
}

.mtwa-floating-container.mtwa-pos-bottom-left {
	bottom: var(--mtwa-offset-y);
	left: var(--mtwa-offset-x);
	align-items: flex-start;
}

.mtwa-floating-container.mtwa-pos-bottom-center {
	bottom: var(--mtwa-offset-y);
	left: 50%;
	transform: translateX(-50%);
	align-items: center;
}

.mtwa-floating-container.mtwa-pos-top-right {
	top: var(--mtwa-offset-y);
	right: var(--mtwa-offset-x);
	flex-direction: column-reverse;
	align-items: flex-end;
}

.mtwa-floating-container.mtwa-pos-top-left {
	top: var(--mtwa-offset-y);
	left: var(--mtwa-offset-x);
	flex-direction: column-reverse;
	align-items: flex-start;
}

.mtwa-floating-container.mtwa-pos-top-center {
	top: var(--mtwa-offset-y);
	left: 50%;
	transform: translateX(-50%);
	flex-direction: column-reverse;
	align-items: center;
}

/* Floating WhatsApp Button */
.mtwa-float-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--mtwa-size);
	height: var(--mtwa-size);
	background: var(--mtwa-bg);
	border-radius: 50%;
	box-shadow: var(--mtwa-shadow);
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	cursor: pointer;
	outline: none;
}

.mtwa-float-btn:hover,
.mtwa-float-btn:focus {
	transform: scale(1.08);
	box-shadow: var(--mtwa-shadow-hover);
}

.mtwa-icon-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
}

.mtwa-svg-icon {
	display: block;
	transition: transform 0.3s ease;
}

/* Animations */
/* 1. Pulse Animation */
.mtwa-anim-pulse .mtwa-float-btn {
	animation: mtwaPulse 2s infinite;
}

@keyframes mtwaPulse {
	0% {
		box-shadow: 0 0 0 0 var(--mtwa-shadow-pulse, rgba(37, 211, 102, 0.7));
	}
	70% {
		box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}
}

/* 2. Bounce Animation */
.mtwa-anim-bounce .mtwa-float-btn {
	animation: mtwaBounce 2.5s infinite;
}

@keyframes mtwaBounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-12px);
	}
	60% {
		transform: translateY(-6px);
	}
}

/* 3. Subtle Float Animation */
.mtwa-anim-float .mtwa-float-btn {
	animation: mtwaFloat 3s ease-in-out infinite;
}

@keyframes mtwaFloat {
	0% {
		transform: translateY(0px);
	}
	50% {
		transform: translateY(-8px);
	}
	100% {
		transform: translateY(0px);
	}
}

/* Online Badge Pulsing Effect */
.mtwa-online-pulse {
	transform-origin: center;
	animation: mtwaDotPulse 1.8s ease-in-out infinite;
}

@keyframes mtwaDotPulse {
	0% {
		r: 4px;
		opacity: 0.8;
	}
	100% {
		r: 8px;
		opacity: 0;
	}
}

/* Tooltip Box Styles */
.mtwa-tooltip-box {
	position: relative;
	background: #ffffff;
	color: #1d2327;
	padding: 12px 16px;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.4;
	margin-bottom: 12px;
	max-width: 260px;
	word-wrap: break-word;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	display: flex;
	align-items: center;
	gap: 10px;
}

.mtwa-pos-top-right .mtwa-tooltip-box,
.mtwa-pos-top-left .mtwa-tooltip-box,
.mtwa-pos-top-center .mtwa-tooltip-box {
	margin-bottom: 0;
	margin-top: 12px;
}

.mtwa-tooltip-box.mtwa-show {
	opacity: 1;
	transform: translateY(0);
}

.mtwa-tooltip-text {
	flex: 1;
	font-weight: 500;
}

.mtwa-tooltip-close {
	background: none;
	border: none;
	color: #8c8f94;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	border-radius: 50%;
	transition: color 0.2s ease;
}

.mtwa-tooltip-close:hover {
	color: #1d2327;
}

/* Tooltip Arrow */
.mtwa-pos-bottom-right .mtwa-tooltip-box::after {
	content: "";
	position: absolute;
	bottom: -6px;
	right: 22px;
	width: 12px;
	height: 12px;
	background: #ffffff;
	transform: rotate(45deg);
	box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.05);
}

.mtwa-pos-bottom-left .mtwa-tooltip-box::after {
	content: "";
	position: absolute;
	bottom: -6px;
	left: 22px;
	width: 12px;
	height: 12px;
	background: #ffffff;
	transform: rotate(45deg);
	box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.05);
}

/* Shortcode Inline Styles */
.mtwa-shortcode-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	border-radius: 50px;
	text-decoration: none;
	font-weight: 600;
	font-family: inherit;
	font-size: 15px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
	transition: all 0.25s ease;
}

.mtwa-shortcode-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
	opacity: 0.95;
}

.mtwa-shortcode-icon {
	display: flex;
	align-items: center;
}

/* Responsive Mobile Adjustments */
@media (max-width: 480px) {
	:root {
		--mtwa-size: 54px;
		--mtwa-offset-x: 15px;
		--mtwa-offset-y: 15px;
	}
	.mtwa-tooltip-box {
		max-width: 210px;
		font-size: 13px;
	}
}
