/**
 * Top Rank Reviews — front-end button base styles.
 * Per-site values (color, size, position offsets) are injected inline.
 */

.trr-button {
	position: fixed;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	width: var(--trr-size, 56px);
	height: var(--trr-size, 56px);
	padding: 0;
	border-radius: 999px;
	background: var(--trr-bg, #4285F4);
	color: var(--trr-fg, #FFFFFF);
	text-decoration: none;
	line-height: 1;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px) scale(0.96);
	transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

/* Made visible by button.js after the configured delay. */
.trr-button.trr-is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.trr-button:hover,
.trr-button:focus {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
	transform: translateY(-1px) scale(1.02);
	outline: none;
}

.trr-button:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}

/* Centered positions keep the horizontal centering transform. */
.trr-button--center {
	transform: translate(-50%, 8px) scale(0.96);
}

.trr-button--center.trr-is-visible {
	transform: translate(-50%, 0) scale(1);
}

.trr-button--center:hover,
.trr-button--center:focus {
	transform: translate(-50%, -1px) scale(1.02);
}

/* Icon wrapper: a definite square derived from the button size, and never
   allowed to shrink in the flex row. This keeps the icon the right size on
   every screen, including narrow/portrait mobile. */
.trr-button__glyph {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--trr-icon-size, calc(var(--trr-size, 56px) * 0.66));
	height: var(--trr-icon-size, calc(var(--trr-size, 56px) * 0.66));
	color: var(--trr-fg, #FFFFFF);
	line-height: 0;
}

.trr-button__icon {
	display: block;
	width: 100%;
	height: 100%;
}

.trr-button__custom-icon {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.trr-button__text {
	display: none;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	color: var(--trr-fg, #FFFFFF);
}

/* Pill shape when a text label is present. */
.trr-button--has-text {
	width: auto;
	min-width: var(--trr-size, 56px);
	padding: 0 20px 0 16px;
}

.trr-button--has-text .trr-button__text {
	display: inline;
}

/* Reverse the order: text first, then icon. */
.trr-button--reverse {
	flex-direction: row-reverse;
}

.trr-button--has-text.trr-button--reverse {
	padding: 0 16px 0 20px;
}

/* On small screens, collapse long labels back to icon-only. */
@media (max-width: 480px) {
	.trr-button--has-text {
		width: var(--trr-size, 56px);
		min-width: var(--trr-size, 56px);
		padding: 0;
	}
	.trr-button--has-text .trr-button__text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.trr-button {
		transition: opacity 0.2s ease;
		transform: none;
	}
	.trr-button.trr-is-visible {
		transform: none;
	}
	.trr-button--center,
	.trr-button--center.trr-is-visible {
		transform: translateX(-50%);
	}
}

/* ------------------------------------------------------------------ */
/* Attention animations (F2) — applied to the glyph so they never      */
/* interfere with the button's positioning/centering transform.        */
/* ------------------------------------------------------------------ */
.trr-anim-pulse .trr-button__glyph {
	animation: trr-pulse 2s ease-in-out infinite;
}

.trr-anim-bounce .trr-button__glyph {
	animation: trr-bounce 2.2s ease-in-out infinite;
}

.trr-anim-fade .trr-button__glyph {
	animation: trr-breathe 2.6s ease-in-out infinite;
}

@keyframes trr-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.14); }
}

@keyframes trr-bounce {
	0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
	40% { transform: translateY(-5px); }
	60% { transform: translateY(-2px); }
}

@keyframes trr-breathe {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
	.trr-anim-pulse .trr-button__glyph,
	.trr-anim-bounce .trr-button__glyph,
	.trr-anim-fade .trr-button__glyph {
		animation: none;
	}
}
