/* Busy + retry feedback for social write actions (like, save, comment vote). */

/* Loading state — set via aria-busy by social-feedback.js setBusy(). */
.custom-like-btn[aria-busy='true'],
.engagement-btn--like .custom-like-btn[aria-busy='true'],
.custom-save-btn[aria-busy='true'],
.engagement-btn--save .custom-save-btn[aria-busy='true'],
.vote-btn[aria-busy='true'] {
	position: relative;
	overflow: hidden;
	cursor: progress;
}

.custom-like-btn[aria-busy='true'] > *,
.custom-save-btn[aria-busy='true'] > *,
.vote-btn[aria-busy='true'] > * {
	opacity: 0.25;
}

.custom-like-btn[aria-busy='true']::after,
.custom-save-btn[aria-busy='true']::after,
.vote-btn[aria-busy='true']::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	opacity: 0.85;
	animation: leemeenal-social-spin 0.6s linear infinite;
}

@keyframes leemeenal-social-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.custom-like-btn[aria-busy='true']::after,
	.custom-save-btn[aria-busy='true']::after,
	.vote-btn[aria-busy='true']::after {
		animation-duration: 2s;
	}
}

/* Retry notice */
.social-notice {
	position: fixed;
	z-index: 10000;
	bottom: 20px;
	inset-inline-start: 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: min(420px, calc(100vw - 40px));
	padding: 12px 16px;
	border: 1px solid var(--chip-border, #3a3a3a);
	border-radius: 10px;
	background: var(--chip-bg, #272727);
	color: var(--chip-fg, #ffffff);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.6;
}

body.light-mode .social-notice {
	border-color: var(--chip-border, #d5dbe1);
	background: var(--chip-bg, #ffffff);
	color: var(--chip-fg, #0f0f21);
}

.social-notice[hidden] {
	display: none;
}

.social-notice__text {
	flex: 1 1 auto;
}

.social-notice__retry {
	flex: 0 0 auto;
	padding: 6px 12px;
	border: 0;
	border-radius: 6px;
	background: var(--lm-accent, #0d0dff);
	color: #ffffff;
	font: inherit;
	cursor: pointer;
}

.social-notice__retry:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.social-notice__close {
	flex: 0 0 auto;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	opacity: 0.7;
	cursor: pointer;
}

.social-notice__close:hover {
	opacity: 1;
}
