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

#block_finder {
	overflow: visible;

	.inside {
		overflow: visible;
	}
}

#block-finder-form label {
	padding-bottom: 16px;
}

#block-finder-selector,
#post-type-selector {
	display: block;
	margin-bottom: 10px;
	padding: 2px 8px;
	width: 100%;
	max-width: 400px;
}

// Autocomplete wrapper styles
.autocomplete-wrapper {
	position: relative;
	margin-bottom: 1em;
	max-width: 400px;
}

.autocomplete-input {
	width: 100%;
	padding: 6px 8px;
	box-sizing: border-box;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	font-size: 14px;
	background-color: #fff;
	color: #2c3338;
	line-height: 1.5;

	&:focus {
		border-color: #2271b1;
		box-shadow: 0 0 0 1px #2271b1;
		outline: none;
	}

	&::placeholder {
		color: #8c8f94;
		opacity: 1;
	}
}

// Autocomplete dropdown styles
.autocomplete-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background-color: #fff;
	border: 1px solid #8c8f94;
	border-radius: 5px;
	max-height: 200px;
	overflow-y: auto;
	padding: 0;
	list-style: none;
	z-index: 100000;
	display: none;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);

	&.show {
		display: block;
	}
}

.autocomplete-item {
	padding: 12px 14px;
	margin: 0;
	cursor: pointer;
	font-size: 14px;
	color: #2c3338;
	border-bottom: 1px solid #f0f0f1;
	transition: background-color 0.15s ease;

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

	&:hover,
	&.highlighted {
		background-color: #f0f6fc;
		color: #215f91;
	}

	&.no-results {
		cursor: default;
		color: #8c8f94;
		font-style: italic;

		&:hover {
			background-color: transparent;
			color: #8c8f94;
		}
	}
}

// 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 {
	font-size: 13px;
	color: #646970;
	text-decoration: none;
	cursor: pointer;
    padding: 4px 8px;
    background-color: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    transition: background-color 0.15s ease, color 0.15s ease;
    
	&:hover, &.active {
        color: #fff;
        background-color: #2271b1;
        border-color: #2271b1;
	}

	&.active {
		cursor: default;
		pointer-events: 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;
}

// Context indicators
.block-finder-context {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-left: 0 !important;
}

.context-nested {
	font-size: 11px;
	font-style: italic;
	color: #50575e;
	padding: 2px 0;
}

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

	a:last-child {
		border-left: 1px solid #b9b9b9;
		padding-left: 8px;
	}
}

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

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

// Results count badge
.block-finder-count {
	font-weight: 400;
	color: #646970;
	font-size: 13px;
}

// 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-prev,
.block-finder-next {
	min-width: 80px;
}