/**
 * WP Avoid Slow — Admin Settings Page Styles.
 *
 * Loaded only on the plugin's own admin page via wp_enqueue_style().
 *
 * @package WP_Avoid_Slow
 */

/* ── Page shell ───────────────────────────────────────────────────────────── */

.wps-wrap {
	max-width: 780px;
}

.wps-hero {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 16px 0 4px;
}

.wps-hero h1 {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
}

.wps-tagline {
	color: #50575e;
	font-size: 13px;
	margin: 0 0 20px;
}

.wps-tagline strong {
	color: #1d2327;
}

.wps-count {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	color: #2271b1;
	background: #f0f6fc;
	border: 1px solid #c5d9ed;
	border-radius: 100px;
	padding: 2px 10px;
}

.wps-hero .wps-reset-form {
	margin-left: auto;
}

/* ── Settings table overrides ─────────────────────────────────────────────── */

#wps-form .form-table th {
	width: 220px;
	padding: 16px 10px 16px 0;
	font-size: 13px;
	font-weight: 600;
	vertical-align: top;
	padding-top: 20px;
}

#wps-form .form-table td {
	padding: 12px 10px;
	vertical-align: top;
}

#wps-form .form-table tr {
	border-bottom: 1px solid #f0f0f1;
}

#wps-form .form-table tr:last-child {
	border-bottom: none;
}

.wps-section-intro {
	color: #50575e;
	font-size: 13px;
	margin: 0 0 8px;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */

.wps-field-row {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.wps-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
	margin-top: 1px;
	cursor: pointer;
}

.wps-switch input {
	/* Visually hidden but still keyboard-accessible */
	position: absolute;
	opacity: 0;
	width: 44px;
	height: 24px;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

.wps-track {
	position: absolute;
	inset: 0;
	background: #c3c4c7;
	border-radius: 12px;
	transition: background 0.2s ease;
}

.wps-track::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: left 0.2s ease;
}

.wps-switch input:checked + .wps-track {
	background: #2271b1;
}

.wps-switch input:checked + .wps-track::after {
	left: 23px;
}

.wps-switch input:focus-visible + .wps-track {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* ── Field body ───────────────────────────────────────────────────────────── */

.wps-field-body {
	flex: 1;
}

.wps-description {
	margin: 2px 0 6px;
	font-size: 13px;
	color: #50575e;
}

.wps-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.wps-badge {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 100px;
	line-height: 1.6;
}

.wps-badge--savings {
	background: #edfaef;
	color: #1a7e2e;
	border: 1px solid #b8e6c1;
}

.wps-badge--warning {
	background: #fef8ee;
	color: #996800;
	border: 1px solid #f5d479;
}

.wps-badge--new {
	background: #f0f0ff;
	color: #3858e9;
	border: 1px solid #c2c8f8;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.wps-badge--wp-required {
	background: #f6f7f7;
	color: #787c82;
	border: 1px solid #dcdcde;
}

.wps-badge--wp-config {
	background: #f0f6fc;
	color: #0969da;
	border: 1px solid #b6d4fe;
}

/* ── Disabled (version-gated) row ─────────────────────────────────────────── */

.wps-field-row--disabled {
	opacity: 0.55;
}

.wps-field-row--disabled .wps-switch {
	cursor: not-allowed;
}

/* ── Locked (controlled by wp-config.php) row ────────────────────────────── */

.wps-field-row--locked .wps-switch {
	cursor: not-allowed;
}

.wps-field-row--disabled input:disabled + .wps-track {
	background: #dcdde1;
	cursor: not-allowed;
}

/* ── Search / filter ──────────────────────────────────────────────────────── */

.wps-search-wrap {
	margin: 0 0 16px;
}

.wps-search {
	width: 100%;
	max-width: 360px;
	padding: 7px 12px 7px 34px;
	font-size: 13px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2387888c' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
	box-shadow: none;
	color: #1d2327;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.wps-search::placeholder {
	color: #87888c;
}

/* ── Save button ──────────────────────────────────────────────────────────── */

#wps-form .submit {
	padding-left: 0;
}

#wps-form .button-primary {
	min-width: 130px;
}
