// Override WordPress dashboard overflow to allow dropdowns to extend
#dashboard-widgets-wrap {
	overflow: visible;
}

#block_finder {
	overflow: visible;

	.inside {
		overflow: visible;
	}
}

#block-finder-selector-root,
.block-finder-post-type-section {
	margin: 0 0 16px;
}

// Reliable hide that beats user-agent + wp-admin fieldset styling.
.block-finder-hidden {
	display: none !important;
}

// Filter groups (sources + statuses share the same shape)
.block-finder-sources,
.block-finder-statuses {
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	padding: 12px 14px 14px;
	margin: 0 0 16px;
}

.block-finder-sources legend,
.block-finder-statuses legend {
	color: #2c3338;
	font-size: 13px;
	font-weight: 500;
	padding: 0 4px;
}

.block-finder-source-option,
.block-finder-status-option {
	align-items: center;
	color: #2c3338;
	display: inline-flex;
	font-size: 13px;
	gap: 4px;
	margin-right: 12px;
}

.block-finder-source-option input[type='checkbox'],
.block-finder-status-option input[type='checkbox'] {
	margin: 0;
}

// Empty state styles
.block-finder-empty-state {
	padding: 24px 12px;
	text-align: center;
	color: #646970;

	p {
		margin: 0;
	}
}

// No results state
.block-finder-no-results {
	padding: 24px 12px;
	text-align: center;
	color: #646970;

	p {
		margin: 0;
	}

	strong {
		color: #2c3338;
	}
}

// Loading skeleton styles
.block-finder-loading {
	padding: 0;
}

.skeleton-header {
	height: 24px;
	background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
	background-size: 200% 100%;
	animation: skeleton-pulse 1.5s ease-in-out infinite;
	border-radius: 4px;
	margin: 14px 12px;
	width: 60%;
}

.skeleton-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.skeleton-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 12px;
	border-bottom: 1px dotted #b9b9b9;

	&:last-child {
		border-bottom: none;
	}
}

.skeleton-text {
	height: 16px;
	background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
	background-size: 200% 100%;
	animation: skeleton-pulse 1.5s ease-in-out infinite;
	border-radius: 4px;
	width: 45%;
}

.skeleton-actions {
	height: 16px;
	background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
	background-size: 200% 100%;
	animation: skeleton-pulse 1.5s ease-in-out infinite;
	border-radius: 4px;
	width: 80px;
}

@keyframes skeleton-pulse {

	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

#block-finder-results {
	background-color: #f2f2f2;
	margin-top: 15px;
}

#block-finder-results h3 {
	font-weight: 700;
	border-bottom: 1px solid #b9b9b9;
	padding: 14px 12px;
	margin: 0;
}

// Filter links
.block-finder-filters {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px;
	background-color: #fff;
	border-bottom: 1px solid #c3c4c7;
}

.block-finder-filter-link {
	color: #2271b1;
	cursor: pointer;
	font-size: 13px;
	text-decoration: none;

	&:hover {
		color: #135e96;
		text-decoration: underline;
	}

	&.active {
		color: #1d2327;
		cursor: default;
		font-weight: 600;
		pointer-events: none;
		text-decoration: none;
	}
}

.block-finder-filter-sep {
	color: #c3c4c7;
	font-size: 13px;
}

#block-finder-results ul {
	list-style-type: none;
	padding: 0;
	margin: 0;
}

#block-finder-results li {
	display: flex;
	gap: 8px;
	padding: 14px 12px;
	margin-bottom: 0;
	border-bottom: 1px dotted #b9b9b9;
	align-items: flex-start;
}

#block-finder-results li:last-child {
	border-bottom: none;
}

// Result content wrapper
.block-finder-result-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.block-finder-result-title {
	font-weight: 500;
	color: #1d2327;
}

// Per-result meta line: instance count + nested count
.block-finder-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	color: #50575e;
}

.block-finder-meta-item {
	white-space: nowrap;
}

.block-finder-meta-sep {
	color: #c3c4c7;
}

.block-finder-meta-status {
	font-style: italic;
}

// Result actions
.block-finder-result-actions {
	margin-left: auto;
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;

	// Only add the divider when there are two action links (Edit + View).
	a + a {
		border-left: 1px solid #b9b9b9;
		padding-left: 8px;
	}
}

// #block-finder-results a {
// 	font-weight: 500;
// 	color: #0073aa;
// 	text-decoration: none;

// 	&:hover {
// 		text-decoration: underline;
// 	}
// }

// Pagination styles
.block-finder-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px;
	background-color: #fff;
	border-top: 1px solid #c3c4c7;
}

.block-finder-page-info {
	color: #646970;
	font-size: 13px;
}

.block-finder-page-buttons {
	display: flex;
	gap: 8px;
}

.block-finder-page-link {
	background: none;
	border: 0;
	box-shadow: none;
	color: #2271b1;
	cursor: pointer;
	font-size: 13px;
	padding: 0;

	&:hover {
		color: #135e96;
		text-decoration: underline;
	}

	&:focus {
		outline: 2px solid #2271b1;
		outline-offset: 2px;
	}
}