/**
 * ThinkRank SEO Quick Edit modal (post list).
 *
 * Hand-authored, so it lives in static/ (assets/ is wiped on every build).
 * Values mirror the design tokens in src/admin/styles/_variables.scss —
 * the admin app's compiled CSS is not enqueued on edit.php, so the tokens
 * are restated here as literals:
 *   primary #4451FF · text #1D1D1D / #535353 / #5A5C5E
 *   borders #D5D5DD / #E2E6F1 · bg #F8F8FB · error #921C13
 *   radius 6px / 8px
 *
 * @package ThinkRank
 * @since 1.27.1
 */

/* Trigger button in the column cell (pushed to the cell's right edge) */
.thinkrank-qe-trigger {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: #a5aaac;
	cursor: pointer;
	transition: all 0.15s ease;
}

.thinkrank-qe-trigger:hover,
.thinkrank-qe-trigger:focus {
	color: #4451ff;
	background: #f0f1ff;
	border-color: #d5d8ff;
	outline: none;
}

/* Overlay */
.thinkrank-qe-overlay {
	position: fixed;
	inset: 0;
	z-index: 100100; /* above #wpadminbar (99999) */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(29, 29, 29, 0.55);
	animation: thinkrank-qe-fade 0.12s ease-out;
}

@keyframes thinkrank-qe-fade {

	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* Modal card */
.thinkrank-qe-modal {
	width: 560px;
	max-width: 100%;
	max-height: min(85vh, 720px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 50px rgba(29, 29, 29, 0.25);
	animation: thinkrank-qe-pop 0.14s ease-out;
	font-size: 13px;
}

@keyframes thinkrank-qe-pop {

	from {
		opacity: 0;
		transform: translateY(6px) scale(0.985);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* Header */
.thinkrank-qe-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 24px;
	border-bottom: 1px solid #e2e6f1;
}

.thinkrank-qe-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: #1d1d1d;
}

.thinkrank-qe-post-title {
	margin: 3px 0 0;
	font-size: 12px;
	color: #5a5c5e;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}

.thinkrank-qe-close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	margin-top: 1px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: #5a5c5e;
	cursor: pointer;
	transition: all 0.15s ease;
}

.thinkrank-qe-close:hover,
.thinkrank-qe-close:focus {
	background: #f1f1f5;
	color: #1d1d1d;
	outline: none;
}

/* Body */
.thinkrank-qe-body {
	padding: 20px 24px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.thinkrank-qe-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.thinkrank-qe-field-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.thinkrank-qe-label {
	font-size: 13px;
	font-weight: 600;
	color: #1d1d1d;
}

.thinkrank-qe-counter {
	font-size: 12px;
	color: #5a5c5e;
	font-variant-numeric: tabular-nums;
}

.thinkrank-qe-counter.is-over {
	color: #921c13;
	font-weight: 600;
}

.thinkrank-qe-input {
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.5;
	color: #1d1d1d;
	background: #fff;
	border: 1px solid #d5d5dd;
	border-radius: 6px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.thinkrank-qe-input::placeholder {
	color: #8c8f94;
}

.thinkrank-qe-input:focus {
	border-color: #4451ff;
	box-shadow: 0 0 0 2px rgba(68, 81, 255, 0.18);
	outline: none;
}

textarea.thinkrank-qe-input {
	resize: vertical;
	min-height: 68px;
}

.thinkrank-qe-help {
	margin: 0;
	font-size: 12px;
	line-height: 1.45;
	color: #5a5c5e;
}

.thinkrank-qe-error {
	margin: 0;
	padding: 8px 12px;
	font-size: 12px;
	color: #921c13;
	background: #fef3f2;
	border: 1px solid rgba(146, 28, 19, 0.2);
	border-radius: 6px;
}

/* Loading state */
.thinkrank-qe-loading {
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.thinkrank-qe-loading::after {
	content: "";
	width: 22px;
	height: 22px;
	border: 2.5px solid #e2e6f1;
	border-top-color: #4451ff;
	border-radius: 50%;
	animation: thinkrank-qe-spin 0.7s linear infinite;
}

@keyframes thinkrank-qe-spin {

	to {
		transform: rotate(360deg);
	}
}

/* Footer */
.thinkrank-qe-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 24px;
	border-top: 1px solid #e2e6f1;
	background: #f8f8fb;
	border-radius: 0 0 8px 8px;
}

.thinkrank-qe-edit-link {
	font-size: 12px;
	color: #5a5c5e;
	text-decoration: none;
}

.thinkrank-qe-edit-link:hover,
.thinkrank-qe-edit-link:focus {
	color: #4451ff;
	text-decoration: underline;
}

.thinkrank-qe-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.thinkrank-qe-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.15s ease;
}

.thinkrank-qe-btn:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(68, 81, 255, 0.25);
}

.thinkrank-qe-btn-ghost {
	background: #fff;
	border-color: #d5d5dd;
	color: #1d1d1d;
}

.thinkrank-qe-btn-ghost:hover {
	background: #f1f1f5;
}

.thinkrank-qe-btn-primary {
	background: #4451ff;
	color: #fff;
}

.thinkrank-qe-btn-primary:hover {
	background: #3743e0;
}

.thinkrank-qe-btn-primary:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Small screens: WP switches to its stacked list at 782px */
@media screen and (max-width: 600px) {

	.thinkrank-qe-overlay {
		padding: 12px;
		align-items: flex-end;
	}

	.thinkrank-qe-modal {
		max-height: 92vh;
	}
}
