/* Photo Top 10 Ranker - frontend styles */

.ppr-ranker,
.ppr-leaderboard {
	max-width: 700px;
	margin: 2em 0;
	font-size: 15px;
}

.ppr-notice {
	padding: 12px 16px;
	background: #f6f6f6;
	border-left: 4px solid #999;
}

.ppr-debug-id {
	margin-top: 6px;
	font-size: 0.75em;
	color: #b26a00;
	background: #fff8e6;
	border: 1px dashed #e0b13d;
	padding: 4px 8px;
	border-radius: 3px;
	display: inline-block;
}

.ppr-hint {
	color: #666;
	font-size: 0.85em;
	margin-top: -0.5em;
}

.ppr-hint--top {
	margin-top: 0;
	margin-bottom: 1em;
}

.ppr-toggle-btn {
	padding: 10px 18px;
	background: #fff;
	color: #2271b1;
	border: 2px solid #2271b1;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1em;
	font-weight: 600;
	margin-bottom: 1em;
}

.ppr-toggle-btn:hover {
	background: #eaf2fa;
}

.ppr-toggle-btn:disabled {
	color: #999;
	border-color: #ccc;
	cursor: not-allowed;
	background: #f6f6f6;
}

.ppr-admin-tools {
	margin: 0 0 1.2em;
	padding: 12px 14px;
	background: #fff8e6;
	border: 1px dashed #e0b13d;
	border-radius: 4px;
}

.ppr-admin-reorder-btn {
	border-color: #b26a00;
	color: #b26a00;
	margin-right: 8px;
}

.ppr-admin-reorder-btn:hover {
	background: #ffe9b8;
}

.ppr-admin-reset-btn {
	border-color: #999;
	color: #666;
	font-size: 0.9em;
	padding: 8px 14px;
}

.ppr-admin-reset-btn:hover {
	background: #eee;
}

/* Badge overlay wrapped around a live gallery photo (e.g. one rendered by
   Minimalio) so it can be clicked to add/remove without altering that
   plugin's own markup beyond this thin wrapper. The badge itself is
   hidden by default -- it only appears on photos that are actually part
   of the current ranking (.ppr-gallery-wrap.is-used), never on every
   photo in the gallery. */
.ppr-gallery-wrap {
	position: relative;
	display: inline-block;
	line-height: 0;
	cursor: pointer;
}

.ppr-gallery-wrap.is-used img {
	outline: 3px solid #2271b1;
	outline-offset: -3px;
}

.ppr-gallery-wrap.is-voted-elsewhere img {
	outline: 3px dashed #999;
	outline-offset: -3px;
	opacity: 0.7;
}

.ppr-gallery-badge {
	display: none;
	position: absolute;
	top: 6px;
	right: 6px;
	background: #2271b1;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	padding: 4px 7px;
	border-radius: 3px;
	pointer-events: none;
	z-index: 5;
}

.ppr-gallery-wrap.is-used .ppr-gallery-badge {
	display: inline-block;
}

.ppr-slots {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ppr-slot {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 64px;
	padding: 6px 10px;
	border: 2px dashed #ccc;
	border-radius: 4px;
	background: #fafafa;
}

.ppr-slot.is-filled {
	border-style: solid;
	border-color: #ddd;
	background: #fff;
}

.ppr-slot.is-dragging {
	opacity: 0.5;
	border-color: #2271b1;
	background: #eaf2fa;
}

.ppr-slot--placeholder {
	color: #999;
	font-style: italic;
	font-size: 0.9em;
	justify-content: center;
	cursor: default;
}

.ppr-slot__handle {
	flex-shrink: 0;
	width: 1.4em;
	text-align: center;
	color: #999;
	cursor: grab;
	font-size: 1.1em;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.ppr-slot__handle:hover {
	color: #2271b1;
}

.ppr-slot__handle:active {
	cursor: grabbing;
}

.ppr-slot__rank {
	font-weight: 700;
	width: 1.5em;
	text-align: center;
	color: #444;
	flex-shrink: 0;
}

.ppr-slot__thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 3px;
	flex-shrink: 0;
	background: #eee;
	cursor: pointer;
}

.ppr-slot__title {
	flex: 1;
	font-size: 0.9em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #333;
}

.ppr-slot__controls {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.ppr-slot__controls button {
	background: none;
	border: 1px solid #ccc;
	border-radius: 3px;
	cursor: pointer;
	line-height: 1;
	padding: 4px 6px;
}

.ppr-slot__controls button:hover {
	background: #f0f0f0;
}

.ppr-slot__controls button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.ppr-save-btn {
	margin-top: 14px;
	padding: 10px 20px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 1em;
}

.ppr-save-btn:hover {
	background: #135e96;
}

.ppr-save-btn:disabled {
	background: #999;
	cursor: not-allowed;
}

.ppr-status {
	min-height: 1.2em;
	font-size: 0.9em;
}

.ppr-status.is-success {
	color: #1a7a1a;
}

.ppr-status.is-error {
	color: #c0392b;
}

/* Leaderboard */

.ppr-leaderboard__meta {
	color: #666;
	font-size: 0.85em;
}

.ppr-leaderboard__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ppr-leaderboard__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 10px;
	border: 1px solid #eee;
	border-radius: 4px;
}

.ppr-leaderboard__rank {
	font-weight: 700;
	width: 1.8em;
	text-align: center;
	color: #444;
}

.ppr-leaderboard__thumb {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 3px;
	background: #eee;
}

.ppr-leaderboard__text {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ppr-leaderboard__title {
	font-size: 0.95em;
	color: #333;
}

.ppr-leaderboard__group {
	font-size: 0.8em;
	color: #2271b1;
	text-decoration: none;
}

.ppr-leaderboard__group:hover {
	text-decoration: underline;
}

.ppr-leaderboard__score {
	font-size: 0.85em;
	color: #666;
	white-space: nowrap;
}

/* Full-size photo lightbox -- shared by the gallery and the "Your Top N"
   list. Hidden by default; JS toggles the .is-open class. */

.ppr-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
}

.ppr-lightbox.is-open {
	display: flex;
}

body.ppr-lightbox-open {
	overflow: hidden;
}

.ppr-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.ppr-lightbox__content {
	position: relative;
	z-index: 1;
	max-width: 92vw;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ppr-lightbox__img {
	max-width: 92vw;
	max-height: 82vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ppr-lightbox__caption {
	color: #fff;
	margin-top: 12px;
	font-size: 0.95em;
	text-align: center;
	max-width: 80vw;
}

.ppr-lightbox__close {
	position: absolute;
	top: -40px;
	right: -8px;
	background: none;
	border: none;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.ppr-lightbox__close:hover {
	opacity: 0.7;
}
