/**
 * Keyword difficulty checker — module styles.
 * Shared components (inputs, buttons, table, notices, CTA banner,
 * attribution, tooltips) come from the shared stylesheet; the form grid,
 * summary cards and difficulty pills live here. All selectors are
 * svt-kd- prefixed so the module never interferes with other tools.
 */

/* Match the wide table tools (rank checker / keyword research). */
.svt-wrap[data-tool="keyword-difficulty"] {
	max-width: 1040px;
}

/* ---------- Form: textarea grows, country + button stack beside it ---------- */

/* The shared .svt-form is a flex row — block layout keeps rows full-width. */
.svt-wrap[data-tool="keyword-difficulty"] .svt-kd-form {
	display: block;
}

.svt-kd-grid {
	display: grid;
	grid-template-columns: 1fr 230px;
	gap: 14px;
	align-items: stretch;
}

.svt-kd-textarea {
	width: 100%;
	min-height: 150px;
	resize: vertical;
	line-height: 1.5;
}

.svt-kd-meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 6px;
	font-size: 12.5px;
	color: var(--svt-muted);
}

.svt-kd-counter.is-over {
	color: #a12626;
	font-weight: 700;
}

.svt-kd-side {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* The shared .svt-field flex-grows — keep the button snug under the select. */
.svt-kd-side .svt-field {
	flex: 0 0 auto;
}

.svt-kd-side .svt-select {
	width: 100%;
	cursor: pointer;
}

.svt-kd-submit {
	/* Match the 49px rendered height of the select above it. */
	height: 49px;
	padding-top: 0;
	padding-bottom: 0;
	white-space: nowrap;
}

/* ---------- Summary cards — same design as the backlinks checker ---------- */

.svt-kd-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 22px 0;
}

/* The value and label sit tight together as one group, centred in the
   card both ways. Cards share a min-height so the row stays even. */
.svt-kd-card {
	background: var(--svt-tile);
	border: 2px solid var(--svt-border);
	border-radius: var(--svt-radius-sm);
	padding: 16px 18px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-height: 118px;
}

.svt-kd-cardnum {
	font-size: 26px;
	font-weight: 800;
	color: var(--svt-text);
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.svt-kd-carddetail {
	font-size: 14px;
	font-weight: 600;
	color: var(--svt-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.svt-kd-cardlabel {
	font-size: 12px;
	color: var(--svt-muted);
	line-height: 1.3;
}

/* Quick-win / toughest cards show a pill as the headline value. */
.svt-kd-card .svt-kd-pill {
	font-size: 15px;
}

/* ---------- Toolbar + table ---------- */

.svt-kd-toolbar {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 14px;
}

.svt-kd-toolbar .svt-kd-export {
	height: 47px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.svt-kd-cell-kw {
	font-weight: 600;
	color: var(--svt-text);
}

/* Difficulty pills: the band label is text, colour only reinforces. */
.svt-kd-pill {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.svt-kd-pill strong {
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.svt-kd-pill.is-easy {
	background: #e2f7e9;
	color: #14683a;
}

.svt-kd-pill.is-mod {
	background: #e8f0fe;
	color: #1d4fd7;
}

.svt-kd-pill.is-diff {
	background: #fff4dc;
	color: #8a5a00;
}

.svt-kd-pill.is-hard {
	background: #ffe9d9;
	color: #9c4a00;
}

.svt-kd-pill.is-vhard {
	background: #fde8e8;
	color: #a12626;
}

.svt-kd-nodata {
	color: var(--svt-muted);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Per-keyword deep link into the Keyword Research Tool. */
.svt-kd-th {
	display: inline-block;
	padding: 12px 14px;
}

.svt-kd-cell-act {
	text-align: right;
	white-space: nowrap;
}

.svt-kd-research {
	display: inline-block;
	padding: 6px 13px;
	border: 2px solid var(--svt-border);
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--svt-primary);
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.svt-kd-research:hover {
	border-color: var(--svt-primary);
	background: var(--svt-tile);
	text-decoration: none;
}

/* ---------- Interpretation footer ---------- */

.svt-kd-note {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--svt-muted);
	line-height: 1.55;
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
	.svt-kd-grid {
		grid-template-columns: 1fr;
	}

	.svt-kd-cards {
		grid-template-columns: 1fr;
	}

	.svt-kd-toolbar .svt-kd-export {
		flex: 1 1 100%;
		justify-content: center;
	}
}
