/* Posticy SEO Tools – only styles that Astra does NOT provide */

/* ---- Form layout ---- */
.pseo-form { margin-bottom: 4px; }

.pseo-field-header {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 6px;
	min-height: 24px;
}

.pseo-input-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-start;
}

/* Textarea for bulk input — override Astra's fixed height */
.pseo-input-row textarea {
	flex: 1;
	min-width: 0;
	min-height: 100px;
	resize: vertical;
	line-height: 1.5;
}

/* Button inside bulk row left-aligns itself */
.pseo-input-row .ast-button,
.pseo-input-row button[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.pseo-input-row .ast-button:disabled,
.pseo-input-row button[type="submit"]:disabled {
	opacity: .65;
	cursor: not-allowed;
}

/* ---- Button + hint row ---- */
.pseo-form-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
	flex-wrap: wrap;
}
.pseo-hint {
	font-size: .82rem;
	color: #888;
	margin-top: 8px;
	margin-bottom: 0;
	margin-left: auto;
}
@media (max-width: 600px) {
	.pseo-form-actions { flex-direction: column; align-items: flex-start; }
	.pseo-hint { margin-left: 0; }
}

/* ---- Submit buttons — flex so spinner sits beside the label ---- */
.pseo-form button[type="submit"] {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
}

/* ---- Spinner (inside submit button) ---- */
.pseo-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pseo-spin .7s linear infinite;
	flex-shrink: 0;
	vertical-align: middle;
}
@keyframes pseo-spin { to { transform: rotate(360deg); } }

/* ---- Alerts ---- */
.pseo-alert {
	padding: 12px 16px;
	border-radius: 4px;
	font-size: .92rem;
	margin-top: 16px;
}
.pseo-alert-error {
	background: #fff5f5;
	border: 1px solid #feb2b2;
	color: #c53030;
}

/* ---- Results header ---- */
.pseo-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 20px 0 10px;
}
.pseo-results-header h3 { margin: 0; }

.pseo-results-meta {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pseo-badge {
	font-size: .78rem;
	background: #eef2ff;
	color: #4f46e5;
	padding: 3px 10px;
	border-radius: 99px;
	font-weight: 600;
	white-space: nowrap;
}

/* ---- Results table ---- */
.pseo-table-wrap { overflow-x: auto; }

.pseo-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .92rem;
}
.pseo-table th {
	text-align: left;
	padding: 10px 12px;
	background: #f8faff;
	border-bottom: 2px solid #e0e4f0;
	font-weight: 600;
	color: #4a5568;
	white-space: nowrap;
}
.pseo-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #f0f0f5;
	vertical-align: middle;
}
.pseo-table tr:last-child td { border-bottom: none; }
.pseo-table tr:hover td { background: #fafbff; }

/* ---- Score badges ---- */
.pseo-score {
	display: inline-block;
	min-width: 38px;
	padding: 3px 8px;
	border-radius: 4px;
	font-weight: 700;
	font-size: .95rem;
	text-align: center;
	margin-right: 6px;
}
.pseo-score-da   { background: #fff3cd; color: #856404; }
.pseo-score-pa   { background: #d1ecf1; color: #0c5460; }
.pseo-score-dr   { background: #ede0ff; color: #5a2c91; }
.pseo-score-as   { background: #d4edda; color: #155724; }
.pseo-score-spam { background: #f8d7da; color: #721c24; }

.pseo-rank   { font-weight: 600; }
.pseo-domain { font-weight: 600; word-break: break-all; }

/* ---- Mini progress bar ---- */
.pseo-bar {
	display: inline-block;
	vertical-align: middle;
	width: 70px;
	height: 5px;
	background: #e9ecef;
	border-radius: 99px;
	overflow: hidden;
}
.pseo-bar-fill {
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, #f6d365, #fda085);
	transition: width .6s ease;
}
.pseo-bar-blue   { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.pseo-bar-purple { background: linear-gradient(90deg, #a18cd1, #fbc2eb); }

/* ---- Responsive ---- */
@media (max-width: 600px) {
	.pseo-input-row { flex-direction: column; }
	.pseo-input-row .ast-button,
	.pseo-input-row button[type="submit"] { width: 100%; justify-content: center; }
	.pseo-bar { width: 48px; }
}

/* ---- Backlink checker layout ---- */
.pseo-wrap--backlink .pseo-bl-subtitle { color: #666; margin-top: 0; }
.pseo-bl-form      { margin-bottom: 4px; }
.pseo-bl-input-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.pseo-bl-input-label { font-weight: 600; white-space: nowrap; color: #1d2327; }
.pseo-bl-domain-field { flex: 1; min-width: 220px; max-width: 440px; padding: 0 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; box-sizing: border-box; }
.pseo-bl-btn       { white-space: nowrap; align-self: stretch; }

/* Compact switch bar (replaces form when auto-triggered from URL) */
.pseo-bl-switch {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: #f8faff;
	border: 1px solid #e0e4f0;
	border-radius: 6px;
	margin-bottom: 4px;
	font-size: .92rem;
}
.pseo-bl-switch-label { color: #666; }
.pseo-bl-switch-domain { color: #1d2327; }
.pseo-bl-switch-btn {
	margin-left: auto;
	background: none;
	border: 1px solid #c3c8d4;
	border-radius: 4px;
	padding: 4px 12px;
	font-size: .82rem;
	color: #4f46e5;
	cursor: pointer;
	white-space: nowrap;
}
.pseo-bl-switch-btn:hover { background: #eef2ff; border-color: #4f46e5; }

/* Backlink results header */
.pseo-bl-results-title { margin: 0 0 4px; font-size: 1rem; }
.pseo-bl-count     { font-size: 12px; color: #666; }

/* Backlink table columns */
.pseo-table--backlink { min-width: 960px; }
.pseo-th-center, .pseo-td-center { text-align: center !important; }

/* Availability column — price + Buy icon / Request button */
.pseo-bl-td-avail    { white-space: nowrap; min-width: 130px; }
.pseo-bl-avail-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.pseo-bl-price       { font-size: .9rem; font-weight: 600; color: #1d2327; white-space: nowrap; }
.pseo-bl-cart-btn    { display: flex; align-items: center; color: #2271b1; text-decoration: none !important; flex-shrink: 0; }
.pseo-bl-cart-btn:hover { color: #135e96; }
.pseo-bl-request-btn { display: inline-block; padding: 4px 10px; background: #f0f0f1; color: #1d2327 !important; font-size: .8rem; font-weight: 600; border-radius: 4px; text-decoration: none !important; border: 1px solid #c3c4c7; white-space: nowrap; }
.pseo-bl-request-btn:hover { background: #e0e0e0; }

/* Backlink domain column */
.pseo-bl-td-domain a { color: #2271b1; text-decoration: none; font-weight: 500; }
.pseo-bl-td-domain a:hover { text-decoration: underline; }

/* Backlink URL + Links To columns */
.pseo-bl-td-url-from,
.pseo-bl-td-linksto  { max-width: 280px; }
.pseo-bl-td-url-from a,
.pseo-bl-td-linksto a { color: #555; font-size: .82rem; word-break: break-all; text-decoration: none; display: block; }
.pseo-bl-td-url-from a:hover,
.pseo-bl-td-linksto a:hover { text-decoration: underline; }

/* Backlink pill badges */
.pseo-badge-pill   { display: inline-block; min-width: 34px; padding: 3px 8px; border-radius: 20px; font-size: .82rem; font-weight: 700; text-align: center; }
.pseo-badge-dr     { background: #ede9fe; color: #6d28d9; }

/* DoFollow indicator */
.pseo-bl-dofollow  { font-size: .8rem; font-weight: 600; }
.pseo-df-yes       { color: #166534; }
.pseo-df-no        { color: #b91c1c; }
.pseo-df-unknown   { color: #999; }

/* =====================================================
   Responsive — tablet (≤ 768 px)
   ===================================================== */
@media (max-width: 768px) {
	.pseo-results-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	.pseo-table th,
	.pseo-table td { padding: 8px 10px; }
	.pseo-table    { font-size: .86rem; }
}

/* =====================================================
   Responsive — mobile (≤ 600 px)
   ===================================================== */
@media (max-width: 600px) {
	/* Bulk-tool textarea — full width */
	.pseo-input-row textarea { width: 100%; }

	/* Backlink input row — stack vertically */
	.pseo-bl-input-row  { flex-direction: column; align-items: stretch; }
	.pseo-bl-domain-field { max-width: 100%; width: 100%; }
	.pseo-bl-btn        { width: 100%; justify-content: center; }

	/* Backlink switch bar — allow wrapping */
	.pseo-bl-switch     { flex-wrap: wrap; }
	.pseo-bl-switch-btn { margin-left: 0; margin-top: 4px; }

	/* Field-header badge — left-align on narrow screens */
	.pseo-field-header  { justify-content: flex-start; }

	/* Form-actions hint — full line */
	.pseo-form-actions  { gap: 8px; }

	/* Score bars */
	.pseo-bar           { width: 40px; }

	/* Results table font */
	.pseo-table         { font-size: .8rem; }
	.pseo-table th,
	.pseo-table td      { padding: 7px 8px; }
}
