/* SEO Toolkit Pro — frontend styles */

.stp-tool {
	--stp-accent: #2563eb;
	--stp-accent-dark: #1d4ed8;
	--stp-bg: #ffffff;
	--stp-surface: #f8fafc;
	--stp-border: #e2e8f0;
	--stp-text: #0f172a;
	--stp-text-muted: #64748b;
	--stp-error: #dc2626;
	--stp-warn-bg: #fef3c7;
	--stp-warn-text: #92400e;
	--stp-radius: 14px;

	box-sizing: border-box;
	max-width: 760px;
	margin: 1.5rem auto;
	padding: 1.75rem;
	background: var(--stp-bg);
	border: 1px solid var(--stp-border);
	border-radius: var(--stp-radius);
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--stp-text);
}

.stp-tool *, .stp-tool *::before, .stp-tool *::after { box-sizing: border-box; }

@media (prefers-color-scheme: dark) {
	.stp-tool {
		--stp-bg: #0f172a;
		--stp-surface: #1e293b;
		--stp-border: #334155;
		--stp-text: #f1f5f9;
		--stp-text-muted: #94a3b8;
	}
}

.stp-tool-header { margin-bottom: 1.25rem; }
.stp-tool-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 0.35rem; }
.stp-tool-desc { color: var(--stp-text-muted); font-size: 0.92rem; margin: 0; }

.stp-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.25rem; }
.stp-field-textarea { grid-column: 1 / -1; }
.stp-field { display: flex; flex-direction: column; gap: 0.35rem; }
.stp-field label { font-size: 0.85rem; font-weight: 600; }

.stp-input {
	width: 100%;
	border: 1px solid var(--stp-border);
	border-radius: 8px;
	background: var(--stp-surface);
	padding: 0.6rem 0.7rem;
	font-size: 0.95rem;
	color: var(--stp-text);
	font-family: inherit;
}
.stp-input:focus { outline: none; border-color: var(--stp-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stp-accent) 20%, transparent); }
textarea.stp-input { resize: vertical; }
.stp-field-help { font-size: 0.76rem; color: var(--stp-text-muted); }
.stp-field-error { color: var(--stp-error); font-size: 0.78rem; min-height: 1em; }

.stp-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.stp-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 0.65rem 1.25rem;
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.05s ease, background 0.15s ease;
	text-decoration: none;
	display: inline-block;
}
.stp-btn:active { transform: translateY(1px); }
.stp-btn-primary { background: var(--stp-accent); color: #fff; }
.stp-btn-primary:hover { background: var(--stp-accent-dark); }
.stp-btn-ghost { background: transparent; color: var(--stp-text-muted); border-color: var(--stp-border); }
.stp-btn-ghost:hover { background: var(--stp-surface); }
.stp-btn-outline { background: transparent; border-color: var(--stp-border); color: var(--stp-text); font-size: 0.82rem; padding: 0.5rem 0.9rem; margin-top: 0.75rem; }
.stp-btn-outline:hover { background: var(--stp-surface); border-color: var(--stp-accent); }

.stp-progress { margin-top: 1.5rem; }
.stp-progress-bar { height: 6px; border-radius: 999px; background: var(--stp-surface); overflow: hidden; }
.stp-progress-fill { height: 100%; width: 40%; background: var(--stp-accent); border-radius: 999px; animation: stp-indeterminate 1.1s ease-in-out infinite; }
@keyframes stp-indeterminate { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

.stp-output-wrap { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--stp-border); }
.stp-output-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.stp-output-title { font-size: 1.05rem; margin: 0; }

.stp-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.stp-stat-item { background: var(--stp-surface); border: 1px solid var(--stp-border); border-radius: 10px; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.stp-stat-label { font-size: 0.76rem; color: var(--stp-text-muted); }
.stp-stat-value { font-size: 1.1rem; font-weight: 700; color: var(--stp-accent); }

.stp-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.stp-table-results { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.stp-table-results th, .stp-table-results td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--stp-border); text-align: left; }
.stp-table-results thead th { color: var(--stp-text-muted); font-weight: 600; background: var(--stp-surface); }
.stp-table-results tbody tr:hover { background: var(--stp-surface); }

.stp-code-block {
	background: var(--stp-surface);
	border: 1px solid var(--stp-border);
	border-radius: 10px;
	padding: 1rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.82rem;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-x: auto;
}

.stp-slug-output {
	background: var(--stp-surface);
	border: 1px solid var(--stp-border);
	border-radius: 10px;
	padding: 1rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1rem;
	font-weight: 600;
	color: var(--stp-accent);
	word-break: break-all;
}

.stp-serp-preview {
	background: var(--stp-bg);
	border: 1px solid var(--stp-border);
	border-radius: 10px;
	padding: 1rem 1.1rem;
	font-family: arial, sans-serif;
}
.stp-serp-url { font-size: 0.82rem; color: #4d5156; margin-bottom: 0.2rem; }
.stp-serp-title { font-size: 1.15rem; color: #1a0dab; margin-bottom: 0.25rem; line-height: 1.3; }
.stp-serp-desc { font-size: 0.88rem; color: #4d5156; line-height: 1.4; }
.stp-char-count { font-size: 0.78rem; color: var(--stp-text-muted); margin-top: 0.75rem; }
.stp-char-warn { color: var(--stp-error); }
.stp-char-ok { color: #16a34a; }

.stp-notice { padding: 0.85rem 1rem; border-radius: 8px; background: var(--stp-surface); font-size: 0.88rem; }
.stp-notice-warning { background: var(--stp-warn-bg); color: var(--stp-warn-text); }

/* Master selector */
.stp-master { max-width: 760px; margin: 0 auto; }
.stp-master-select-wrap { margin-bottom: 1rem; }
.stp-master-label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.stp-master-select { width: 100%; max-width: 420px; padding: 0.65rem 0.8rem; border-radius: 8px; border: 1px solid #e2e8f0; font-size: 0.95rem; }

/* SEO index / tool page */
.stp-container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }
.stp-index-title { font-size: 2rem; margin-bottom: 0.5rem; }
.stp-index-sub { color: #64748b; margin-bottom: 2rem; }
.stp-index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.stp-index-card { display: block; padding: 1.25rem; border: 1px solid #e2e8f0; border-radius: 12px; text-decoration: none; color: inherit; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.stp-index-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,0.08); transform: translateY(-2px); }
.stp-index-card h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.stp-index-card p { font-size: 0.88rem; color: #64748b; margin: 0; }
.stp-tool-article-header { margin-bottom: 1rem; }
.stp-tool-back { margin-top: 1.5rem; }

@media (max-width: 480px) {
	.stp-tool { padding: 1.1rem; }
	.stp-actions { flex-direction: column; }
	.stp-actions .stp-btn { width: 100%; }
}
