/*******************************************************************************
KUDOS WIDGET - Simplified for Tufte Theme
*******************************************************************************/

/* Hide on mobile */
@media only screen and (max-width: 800px) {
	figure.kudo {
		display: none;
	}
}

/* Widget container - fixed bottom-right */
figure.kudo {
	position: fixed;
	right: 15px;
	bottom: 5px;
	text-align: center;
	margin-bottom: 5px;
	margin-right: 7px;
	z-index: 20;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.5s ease, transform 0.5s ease;
	transform: scale(0.8);
}

figure.kudo:hover {
	opacity: 1;
	transform: scale(1);
}

/* Outer circle container */
div.opening {
	background-color: #fffff8;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	margin: 0 auto;
	border: 3px solid #000;
	position: relative;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
	div.opening {
		background-color: #151515;
		border-color: #ddd;
	}
}

/* Inner circle (the clickable dot) */
div.opening div.circle {
	background-color: #000;
	width: 42px;
	height: 42px;
	margin-left: -21px;
	margin-top: -21px;
	border-radius: 50%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: scale(0.3);
	transition: all 1s ease-out;
}

@media (prefers-color-scheme: dark) {
	div.opening div.circle {
		background-color: #ddd;
	}
}

/* Active state (while holding) */
.kudo.active div.opening {
	border-color: #4CAF50;
}

.kudo.active div.opening div.circle {
	transform: scale(1);
	background-color: #4CAF50;
}

/* Completed state (after kudos given) */
.kudo.complete div.opening {
	border-color: #4CAF50;
	background-color: #fffff8;
}

.kudo.complete div.opening div.circle {
	background-color: #fffff8;
	transform: scale(0.85);
	animation: kudos-bounce 1s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (prefers-color-scheme: dark) {
	.kudo.complete div.opening {
		background-color: #151515;
	}

	.kudo.complete div.opening div.circle {
		background-color: #151515;
	}
}

.kudo.complete div.opening div.circle::before {
	content: "👏";
	font-size: 26px;
	line-height: 1;
}

/* Bounce animation */
@keyframes kudos-bounce {
	0% { transform: scale(1.2); }
	50% { transform: scale(1.5); }
	70% { transform: scale(0.7); }
	85% { transform: scale(1); }
	100% { transform: scale(0.9); }
}

/* Link overrides - prevent all underlines/borders */
a.kudobject {
	text-decoration: none !important;
	border: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	background-image: none !important;
}

a.kudobject:hover,
a.kudobject:focus,
a.kudobject:active {
	text-decoration: none !important;
	border: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	background-image: none !important;
	background: none !important;
}

/* Count and text */
a.count {
	text-decoration: none !important;
	border: none !important;
	border-bottom: none !important;
	display: block;
	margin-top: 8px;
}

a.count:hover,
a.count:focus,
a.count:active {
	text-decoration: none !important;
	border: none !important;
	border-bottom: none !important;
	background: none !important;
}

/* Override any Tufte link styles */
figure.kudo a.count,
figure.kudo a.count:hover,
figure.kudo a.count:focus,
figure.kudo a.count:active,
figure.kudo a.count:visited {
	text-decoration: none !important;
	border: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	background-image: none !important;
}

/* Import Raleway font */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@600;700;800&display=swap');

a.count span {
	display: block;
	width: auto;
	font-family: "Raleway", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
	color: #000;
	font-weight: 800;
	line-height: 13px;
	margin-top: 5px;
	text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
	a.count span {
		color: #ddd;
	}
}

a.count span.num {
	font-size: 18px;
}

a.count span.txt {
	font-size: 13px;
	margin-top: 7px;
}

/* Text variations */
a.count span.donot {
	display: none;
	font-size: 14px;
	margin-top: 7px;
}

a.count span.thanks {
	display: none;
	font-size: 13px;
	margin-top: 7px;
}

figure.kudo:hover span.txt,
figure.kudo span.donot {
	display: none;
}

figure.kudo:hover span.donot {
	display: block;
}

/* When complete, always show thanks (even on hover) */
.kudo.complete span.txt,
.kudo.complete span.donot {
	display: none !important;
}

.kudo.complete span.thanks {
	display: block !important;
	color: #4CAF50;
}

/* When complete, always full opacity */
.kudo.complete {
	opacity: 1 !important;
}
