/* LearnDash Course Reviews — star display, input widget, completion modal. */

.ldcr-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	line-height: 1;
}

/* Read-only star: grey background star + clipped gold fill on top (for halves). */
.ldcr-star {
	position: relative;
	display: inline-block;
	width: 16px;
	height: 16px;
}

.ldcr-star .ldcr-star-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 16px;
	height: 16px;
}

.ldcr-star .ldcr-star-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 16px;
	overflow: hidden;
}

.ldcr-star .ldcr-star-fill .ldcr-star-fg {
	display: block;
	width: 16px;
	height: 16px;
}

.ldcr-star-bg path {
	fill: #d8d8d8;
	stroke: #d8d8d8;
	stroke-width: 2.4;
	stroke-linejoin: round;
}

.ldcr-star-fg path {
	fill: #f5a623;
	stroke: #f5a623;
	stroke-width: 2.4;
	stroke-linejoin: round;
}

.ldcr-stars-count {
	margin-left: 6px;
	font-size: 12px;
	color: #666;
}

/* Editable input widget */
.ldcr-widget {
	margin: 10px 0;
	position: relative;
	/* anchor for the absolutely positioned thanks message */
}

.ldcr-widget-prompt {
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
}

.ldcr-stars--input .ldcr-star-btn,
.ldcr-stars--input .ldcr-star-btn:hover,
.ldcr-stars--input .ldcr-star-btn:focus,
.ldcr-stars--input .ldcr-star-btn:active {
	cursor: pointer;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 0 2px;
	margin: 0;
	line-height: 0;
	-webkit-appearance: none;
	appearance: none;
}

.ldcr-stars--input .ldcr-star-icon {
	display: block;
	width: 22px;
	height: 22px;
	transition: transform 0.12s ease;
}

.ldcr-stars--input .ldcr-star-icon path {
	fill: #d8d8d8;
	stroke: #d8d8d8;
	stroke-width: 2.4;
	stroke-linejoin: round;
	transition: fill 0.12s ease, stroke 0.12s ease;
}

/* Committed selection */
.ldcr-stars--input .ldcr-star-btn.is-on .ldcr-star-icon path {
	fill: #f5a623;
	stroke: #f5a623;
}

/* Live hover/focus preview: brighter gold + a slight pop on the lit stars */
.ldcr-stars--input.is-previewing .ldcr-star-btn.is-on .ldcr-star-icon {
	transform: scale(1.12);
}

.ldcr-stars--input.is-previewing .ldcr-star-btn.is-on .ldcr-star-icon path {
	fill: #ffb733;
	stroke: #ffb733;
}

/* Absolutely positioned just under the stars, out of normal flow, so showing /
   hiding it never shifts the surrounding layout. */
/* Card strip — one row, two stories: faded ghost fill = course average,
   solid gold stars = the viewer's own rating (hollow = not rated yet). */
.ldcr-stars--card .ldcr-star-btn {
	position: relative;
	display: inline-block;
	padding: 0 2px;
	background: none;
	border: 0;
	line-height: 0;
}

.ldcr-stars--card .ldcr-star-btn .ldcr-star-icon {
	position: relative;
	/* paint above the ghost */
	display: block;
	width: 16px;
	height: 16px;
}

/* Own-rating layer: hollow outline until selected, solid gold when on. */
.ldcr-stars--card .ldcr-star-btn .ldcr-star-icon path {
	fill: transparent;
	stroke: #c4c4c4;
}

.ldcr-stars--card .ldcr-star-btn.is-on .ldcr-star-icon path {
	fill: #f5a623;
	stroke: #f5a623;
}

/* Ghost (average) layer, behind the outline star. */
.ldcr-stars--card .ldcr-star-ghost {
	position: absolute;
	top: 0;
	left: 2px;
	width: 16px;
	height: 16px;
	opacity: 0.7;
	pointer-events: none;
}

.ldcr-stars--card .ldcr-star-ghost .ldcr-star-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 16px;
	overflow: hidden;
}

.ldcr-stars--card .ldcr-star-ghost .ldcr-star-fg {
	display: block;
	width: 16px;
	height: 16px;
}

.ldcr-widget-msg {
	position: absolute;
	top: 100%;
	left: 0;
	margin-top: -4px;
	white-space: nowrap;
	font-size: 12px;
	color: #2e7d32;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.ldcr-widget-msg.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Celebratory pop of the lit stars right after a rating is committed,
   staggered left to right. */
@keyframes ldcr-pop {
	0% {
		transform: scale(1);
	}

	45% {
		transform: scale(1.35);
	}

	100% {
		transform: scale(1);
	}
}

.ldcr-stars--input.ldcr-burst .ldcr-star-btn.is-on .ldcr-star-icon {
	animation: ldcr-pop 0.4s ease;
}

.ldcr-stars--input.ldcr-burst .ldcr-star-btn:nth-child(2) .ldcr-star-icon {
	animation-delay: 0.05s;
}

.ldcr-stars--input.ldcr-burst .ldcr-star-btn:nth-child(3) .ldcr-star-icon {
	animation-delay: 0.1s;
}

.ldcr-stars--input.ldcr-burst .ldcr-star-btn:nth-child(4) .ldcr-star-icon {
	animation-delay: 0.15s;
}

.ldcr-stars--input.ldcr-burst .ldcr-star-btn:nth-child(5) .ldcr-star-icon {
	animation-delay: 0.2s;
}

/* Completion modal */
.ldcr-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(5, 5, 34, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}

.ldcr-modal {
	background: #fff;
	border-radius: 12px;
	padding: 28px 32px;
	max-width: 380px;
	width: 90%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ldcr-modal h3 {
	margin: 0 0 6px;
	font-size: 18px;
}

.ldcr-modal p {
	margin: 0 0 16px;
	color: #555;
	font-size: 14px;
}

.ldcr-modal .ldcr-stars--input {
	display: flex;
	justify-content: center;
}

.ldcr-modal .ldcr-stars--input .ldcr-star-icon {
	width: 32px;
	height: 32px;
}

.ldcr-modal-dismiss {
	display: block;
	margin: 14px auto 0;
	background: none;
	border: 0;
	color: #888;
	font-size: 13px;
	cursor: pointer;
	text-decoration: underline;
}

/* Card placement — stars share the meta row, pushed to the right. */
.uic-lp-card-meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.uic-lp-card-rating {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.ldgrid-rating {
	margin: 4px 0;
}