/* Admin Styles for WP Loupe */

/* Dashboard */
.wp-loupe-dashboard {
	display: grid;
	gap: 20px;
	max-width: 900px;
}

.wp-loupe-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 16px 20px;
}

.wp-loupe-card h3 {
	margin-top: 0;
}

.wp-loupe-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
}

.wp-loupe-badge.is-ready {
	background: #ecf7ed;
	color: #1e6b25;
}

.wp-loupe-badge.is-warning {
	background: #fcf3e6;
	color: #8a5300;
}

.wp-loupe-progress {
	margin-top: 12px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.wp-loupe-progress progress {
	width: 320px;
	height: 18px;
}

.wp-loupe-status-table td:first-child {
	width: 40%;
}

.wp-loupe-health-table {
	margin-top: 10px;
}

.hidden {
	display: none;
}

/* Post type picker */
.wp-loupe-post-types {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 6px 20px;
	max-width: 640px;
	margin: 0;
	padding: 0;
	border: 0;
}

.wp-loupe-post-type-option {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Field Tables */
.wp-loupe-post-type-fields {
	margin-bottom: 1em;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 0 12px;
}

.wp-loupe-post-type-fields > summary {
	cursor: pointer;
	font-weight: 600;
	padding: 10px 0;
	margin: 0;
}

.wp-loupe-fields-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.5em;
	margin-bottom: 1em;
}

.wp-loupe-fields-table th,
.wp-loupe-fields-table td {
	padding: 8px;
	text-align: left;
	vertical-align: middle;
}

.wp-loupe-fields-table th {
	font-weight: bold;
}

.wp-loupe-fields-table td {
	border-bottom: 1px solid #f0f0f0;
}

.wp-loupe-fields-table td:first-child {
	width: 15%;
}

.wp-loupe-fields-table input[type="number"] {
	width: 70px;
}

.wp-loupe-fields-table select {
	min-width: 120px;
}

.wp-loupe-fields-table tr:nth-child(even) {
	background-color: #f9f9f9;
}

.wp-loupe-fields-table tr:hover {
	background-color: #f5f5f5;
}

/* Non-sortable field styling */
.non-sortable-field {
	position: relative;
}

.sortable-wrapper {
	display: flex;
	align-items: center;
}

.non-sortable-field .dashicons {
	color: #999;
	cursor: help;
}

/* Tooltip styling */
.non-sortable-field {
	position: relative;
}

.non-sortable-field:hover::after {
	content: 'Only scalar fields (strings, numbers) can be sortable. Arrays and complex fields cannot be used for sorting.';
	position: absolute;
	bottom: 100%;
	left: 0;
	background-color: #333;
	color: #fff;
	padding: 5px 10px;
	border-radius: 3px;
	font-size: 12px;
	white-space: nowrap;
	z-index: 10;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Disabled inputs */
input[type="checkbox"]:disabled+.dashicons {
	opacity: 0.7;
}

/* Reindex button */
#wp-loupe-reindex-button {
	margin-left: 10px;
}

/* Settings sections */
.wp-loupe-settings-section {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #eee;
}

.wp-loupe-settings-section:last-child {
	border-bottom: none;
}

/* Admin form */
.wp-loupe-form .form-table th {
	width: 250px;
}

/* Make disabled checkboxes visually distinct */
input[type="checkbox"]:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Style for fields that cannot be sortable */
tr:has(td.non-sortable-field) {
	background-color: #fcfcfc;
}

/* Tab styling */
.nav-tab-wrapper {
	margin-bottom: 20px;
}

.wp-loupe-tab-content {
	display: none;
}

.wp-loupe-tab-content.active {
	display: block;
}

/* MCP Settings UI */
.wp-loupe-panel-box {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 14px 16px;
	margin: 0 0 18px;
}

.wp-loupe-panel-box legend,
.wp-loupe-settings-block-title {
	font-weight: 600;
}

.wp-loupe-inline-help {
	color: #555;
	line-height: 1.4;
}

.wp-loupe-scope-badge {
	display: inline-block;
	background: #f0f6fc;
	border: 1px solid #c3d3e4;
	color: #063c5f;
	padding: 2px 6px;
	margin: 0 4px 4px 0;
	border-radius: 3px;
	font-size: 11px;
	line-height: 1.4;
}

.wp-loupe-expired {
	color: #b32d2e;
	font-weight: 600;
}

.wp-loupe-flex-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.wp-loupe-ttl-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.wp-loupe-token-filter {
	margin: 15px 0;
}

.wp-loupe-small-sep {
	margin-top: 8px;
}

.wp-loupe-sticky-actions {
	margin-top: 12px;
}