/* Elephanta floating WhatsApp button */

.elephanta-wa {
	position: fixed;
	z-index: var(--wa-z, 9999);
	display: block;
	line-height: 1;
	animation: elephanta-wa-in .45s cubic-bezier(.2, .9, .3, 1.2) var(--wa-delay, 0s) both;
}

.elephanta-wa *,
.elephanta-wa *::before,
.elephanta-wa *::after {
	box-sizing: border-box;
}

/* Position, size and label behaviour come from per-device variables printed
 * with the button (desktop, tablet and mobile media queries). */
.elephanta-wa {
	top: auto;
	right: 24px;
	bottom: 24px;
	left: auto;
	margin-top: var(--wa-mt, 0px);
}

body.admin-bar .elephanta-wa {
	--wa-adminbar: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .elephanta-wa {
		--wa-adminbar: 46px;
	}
}

.elephanta-wa__link {
	display: inline-flex;
	flex-direction: var(--wa-dir, row);
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none !important;
	outline: 0;
}

/* Button */
.elephanta-wa__btn {
	position: relative;
	display: grid;
	flex: 0 0 auto;
	width: var(--wa-size, 60px);
	height: var(--wa-size, 60px);
	border-radius: var(--wa-radius, 50%);
	box-shadow: var(--wa-shadow, none);
	background: var(--wa-bg, #25d366);
	color: var(--wa-color, #fff);
	place-items: center;
	transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.elephanta-wa__icon {
	position: relative;
	z-index: 1;
	display: grid;
	width: var(--wa-icon, 55%);
	height: var(--wa-icon, 55%);
	place-items: center;
}

.elephanta-wa__icon svg,
.elephanta-wa__icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.elephanta-wa__link:hover .elephanta-wa__btn,
.elephanta-wa__link:focus-visible .elephanta-wa__btn {
	background: var(--wa-hover, #1ebe5b);
}

.elephanta-wa__link:focus-visible .elephanta-wa__btn {
	outline: 3px solid var(--wa-hover, #1ebe5b);
	outline-offset: 3px;
}

/* Label */
.elephanta-wa__label {
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--wa-label-bg, #fff);
	box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .3);
	color: var(--wa-label-color, #11162e);
	font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	white-space: nowrap;
	transition: opacity .25s ease, transform .25s ease;
}

/* Attention animations and hover effects are printed per device with the button. */
.elephanta-wa__link:hover .elephanta-wa__btn { animation-play-state: paused; }

@keyframes elephanta-wa-in {
	from { opacity: 0; transform: scale(.6); }
	to { opacity: 1; transform: none; }
}

@keyframes elephanta-wa-pulse {
	0% { opacity: .55; transform: scale(1); }
	80%, 100% { opacity: 0; transform: scale(1.6); }
}

@keyframes elephanta-wa-bounce {
	0%, 60%, 100% { transform: translateY(0); }
	20% { transform: translateY(-10px); }
	40% { transform: translateY(-4px); }
}

@keyframes elephanta-wa-shake {
	0%, 70%, 100% { transform: rotate(0); }
	74%, 82%, 90% { transform: rotate(-10deg); }
	78%, 86%, 94% { transform: rotate(10deg); }
}

@keyframes elephanta-wa-ring {
	0%, 50%, 100% { transform: rotate(0); }
	5%, 15%, 25% { transform: rotate(-18deg); }
	10%, 20%, 30% { transform: rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
	.elephanta-wa,
	.elephanta-wa *,
	.elephanta-wa *::before {
		animation: none !important;
		transition: none !important;
	}
}

/* Settings-screen preview: contained in the mock browser instead of the viewport */
.elephanta-wa--preview {
	position: absolute;
	z-index: 5;
}
