/* ===========================================================
   SEO Vantage - Main Stylesheet
   =========================================================== */

:root {
	--sv-bg: #f7f8fb;
	--sv-surface: #ffffff;
	--sv-surface-alt: #f1f3f9;
	--sv-border: #e4e7ef;
	--sv-text: #171a2b;
	--sv-text-muted: #636b84;
	--sv-primary: #4f46e5;
	--sv-primary-dark: #4338ca;
	--sv-primary-light: #eef0ff;
	--sv-accent: #06b6d4;
	--sv-success: #16a34a;
	--sv-success-bg: #ecfdf3;
	--sv-error: #dc2626;
	--sv-error-bg: #fef2f2;
	--sv-radius: 14px;
	--sv-radius-sm: 8px;
	--sv-shadow: 0 1px 2px rgba(23,26,43,0.04), 0 8px 24px -8px rgba(23,26,43,0.10);
	--sv-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--sv-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
	--sv-bg: #0f1120;
	--sv-surface: #171a2e;
	--sv-surface-alt: #1e2138;
	--sv-border: #2a2e4a;
	--sv-text: #eef0f9;
	--sv-text-muted: #9aa0bf;
	--sv-primary: #818cf8;
	--sv-primary-dark: #6366f1;
	--sv-primary-light: #262a4a;
	--sv-success-bg: #0d2818;
	--sv-error-bg: #2a1414;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--sv-font);
	background: var(--sv-bg);
	color: var(--sv-text);
	-webkit-font-smoothing: antialiased;
	line-height: 1.6;
	transition: background 0.2s ease, color 0.2s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
p { margin: 0 0 1em; color: var(--sv-text-muted); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--sv-surface);
	border-bottom: 1px solid var(--sv-border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.site-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; flex-shrink: 0; }
.logo-mark { width: 30px; height: 30px; color: var(--sv-primary); }
.logo-mark svg { width: 100%; height: 100%; }
.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; font-weight: 600; color: var(--sv-text-muted); }
.main-nav a:hover { background: var(--sv-surface-alt); color: var(--sv-text); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.tool-search input {
	border: 1px solid var(--sv-border); background: var(--sv-surface-alt); border-radius: 999px;
	padding: 8px 14px; font-size: 0.85rem; width: 190px; color: var(--sv-text);
}
.theme-toggle, .nav-toggle {
	border: 1px solid var(--sv-border); background: var(--sv-surface-alt); border-radius: 999px;
	width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; color: var(--sv-text); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--sv-text); border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border-radius: 10px; padding: 10px 18px; font-size: 0.9rem; font-weight: 700;
	cursor: pointer; border: 1px solid transparent; font-family: inherit;
}
.btn-primary { background: var(--sv-primary); color: #fff; }
.btn-primary:hover { background: var(--sv-primary-dark); }
.btn-ghost { background: var(--sv-surface-alt); color: var(--sv-text); border-color: var(--sv-border); }
.btn-ghost:hover { background: var(--sv-primary-light); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sv-primary); background: var(--sv-primary-light); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: 2.6rem; letter-spacing: -0.02em; }
.text-gradient { background: linear-gradient(90deg, var(--sv-primary), var(--sv-accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.05rem; max-width: 560px; margin: 0 auto 32px; }
.hero-search { display: flex; max-width: 520px; margin: 0 auto; gap: 8px; background: var(--sv-surface); border: 1px solid var(--sv-border); padding: 6px; border-radius: 999px; box-shadow: var(--sv-shadow); }
.hero-search input { flex: 1; border: none; background: transparent; padding: 10px 16px; font-size: 0.95rem; color: var(--sv-text); outline: none; }
.hero-search button { border-radius: 999px; border: none; background: var(--sv-primary); color: #fff; padding: 0 22px; font-weight: 700; cursor: pointer; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 40px; }
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats strong { font-size: 1.5rem; color: var(--sv-text); }
.hero-stats span { font-size: 0.82rem; color: var(--sv-text-muted); }

/* ---------- Sections ---------- */
.section-title { font-size: 1.6rem; text-align: center; margin-bottom: 28px; }
.section-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-head-row .section-title { margin-bottom: 0; }
.link-arrow { font-weight: 700; color: var(--sv-primary); font-size: 0.9rem; }
.categories-section, .tools-section, .why-section, .all-tools-section, .related-tools-section { padding: 48px 0; }

/* ---------- Category Grid ---------- */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.category-card {
	background: var(--sv-surface); border: 1px solid var(--sv-border); border-radius: var(--sv-radius);
	padding: 24px; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--sv-shadow); }
.cat-icon { width: 36px; height: 36px; color: var(--sv-primary); margin-bottom: 14px; display: block; }
.cat-icon svg { width: 100%; height: 100%; }
.category-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.category-card p { font-size: 0.86rem; margin-bottom: 12px; }
.cat-count { font-size: 0.82rem; font-weight: 700; color: var(--sv-primary); }

/* ---------- Tool Grid / Cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool-card {
	background: var(--sv-surface); border: 1px solid var(--sv-border); border-radius: var(--sv-radius);
	padding: 20px; transition: transform 0.15s ease, box-shadow 0.15s ease; position: relative;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--sv-shadow); border-color: var(--sv-primary); }
.tool-card-icon { width: 28px; height: 28px; color: var(--sv-primary); margin-bottom: 10px; display: block; }
.tool-card-icon svg { width: 100%; height: 100%; }
.tool-card h3 { font-size: 0.98rem; margin-bottom: 6px; }
.tool-card p { font-size: 0.82rem; margin-bottom: 0; }
.tool-card-tag { display: inline-block; margin-top: 10px; font-size: 0.72rem; font-weight: 700; color: var(--sv-primary); background: var(--sv-primary-light); padding: 3px 9px; border-radius: 999px; }

/* ---------- Why Section ---------- */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.why-card { background: var(--sv-surface); border: 1px solid var(--sv-border); border-radius: var(--sv-radius); padding: 22px; }
.why-card h3 { font-size: 1rem; margin-bottom: 6px; color: var(--sv-primary); }
.why-card p { font-size: 0.86rem; margin: 0; }

/* ---------- Page Hero (inner pages) ---------- */
.page-hero { padding: 48px 0 28px; text-align: center; border-bottom: 1px solid var(--sv-border); }
.page-hero h1 { font-size: 2rem; }
.page-hero p { max-width: 600px; margin: 0 auto; }
.tool-hero { padding: 32px 0 18px; }
.tool-hero h1 { font-size: 1.8rem; margin-top: 10px; }
.tool-hero-desc { max-width: 680px; }
.breadcrumb { font-size: 0.8rem; color: var(--sv-text-muted); }
.breadcrumb a { color: var(--sv-text-muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--sv-primary); }
.breadcrumb span { color: var(--sv-text); font-weight: 600; }

/* ---------- Filter Bar (All Tools) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
#tool-filter-input { flex: 1; min-width: 220px; border: 1px solid var(--sv-border); background: var(--sv-surface); border-radius: 10px; padding: 11px 16px; font-size: 0.92rem; color: var(--sv-text); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--sv-border); background: var(--sv-surface); color: var(--sv-text-muted); padding: 8px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.pill.active, .pill:hover { background: var(--sv-primary); color: #fff; border-color: var(--sv-primary); }
.no-results-msg { text-align: center; color: var(--sv-text-muted); padding: 40px 0; }

/* ---------- Tool App (shared UI) ---------- */
.tool-app-section { padding: 10px 0 40px; }
.tool-app-card { background: var(--sv-surface); border: 1px solid var(--sv-border); border-radius: var(--sv-radius); padding: 28px; box-shadow: var(--sv-shadow); }
.tool-intro { margin-bottom: 20px; }
.tool-field { margin-bottom: 16px; }
.tool-field label { display: block; font-size: 0.84rem; font-weight: 700; margin-bottom: 6px; color: var(--sv-text); }
.tool-input, .tool-textarea {
	width: 100%; border: 1px solid var(--sv-border); background: var(--sv-surface-alt); color: var(--sv-text);
	border-radius: var(--sv-radius-sm); padding: 11px 14px; font-size: 0.92rem; font-family: inherit; resize: vertical;
}
.tool-input:focus, .tool-textarea:focus { outline: none; border-color: var(--sv-primary); }
.tool-code { font-family: var(--sv-font-mono); font-size: 0.82rem; }
.tool-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 20px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.88rem; }
.tool-loading, .tool-missing { color: var(--sv-text-muted); font-style: italic; }

.tool-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.stat-box { background: var(--sv-surface-alt); border: 1px solid var(--sv-border); border-radius: var(--sv-radius-sm); padding: 14px; text-align: center; }
.stat-value { display: block; font-size: 1.35rem; font-weight: 800; color: var(--sv-primary); }
.stat-label { display: block; font-size: 0.76rem; color: var(--sv-text-muted); margin-top: 4px; }

.tool-output { margin-top: 6px; }
.output-subtitle { font-size: 1rem; margin: 22px 0 10px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.tool-table th, .tool-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--sv-border); }
.tool-table th { color: var(--sv-text-muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
.tool-list li { padding: 6px 0; border-bottom: 1px dashed var(--sv-border); font-size: 0.88rem; }
.tool-list li:last-child { border-bottom: none; }
.tool-msg { font-size: 0.86rem; color: var(--sv-text-muted); margin-top: 10px; }
.tool-msg-success { color: var(--sv-success); font-weight: 600; }
.tool-msg-error { color: var(--sv-error); font-weight: 600; }
.fail-text { color: var(--sv-error); font-weight: 700; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { background: var(--sv-primary-light); color: var(--sv-primary); border-radius: 999px; padding: 6px 12px; font-size: 0.82rem; font-weight: 600; }
.tag-pill b { margin-left: 4px; font-weight: 800; }

.cluster-card { background: var(--sv-surface-alt); border: 1px solid var(--sv-border); border-radius: var(--sv-radius-sm); padding: 16px; margin-bottom: 14px; }
.cluster-card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.muted { color: var(--sv-text-muted); font-weight: 400; }

.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 0.9rem; border-bottom: 1px dashed var(--sv-border); }
.checklist li:last-child { border-bottom: none; }
.check-icon { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; }
.checklist li.pass .check-icon { background: var(--sv-success-bg); color: var(--sv-success); }
.checklist li.fail .check-icon { background: var(--sv-error-bg); color: var(--sv-error); }

.score-ring-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.score-ring {
	width: 110px; height: 110px; border-radius: 50%; border: 8px solid var(--sv-primary-light);
	display: flex; align-items: center; justify-content: center; flex-direction: column;
	font-size: 1.8rem; font-weight: 800; color: var(--sv-primary); position: relative;
}
.score-ring span { font-size: 0.72rem; font-weight: 600; color: var(--sv-text-muted); }

.serp-preview { background: var(--sv-surface-alt); border: 1px solid var(--sv-border); border-radius: var(--sv-radius-sm); padding: 16px; }
.serp-url { color: #1a0dab; font-size: 0.82rem; margin-bottom: 2px; }
[data-theme="dark"] .serp-url { color: #8ab4f8; }
.serp-title { color: #1a0dab; font-size: 1.1rem; margin-bottom: 4px; }
[data-theme="dark"] .serp-title { color: #8ab4f8; }
.serp-desc { color: var(--sv-text-muted); font-size: 0.86rem; }

.dynamic-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.dynamic-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Static Pages ---------- */
.static-page-section { padding: 40px 0 60px; }
.page-content { font-size: 1rem; }
.contact-form { margin-top: 24px; max-width: 480px; }
.not-found-hero { padding: 90px 0; }

/* ---------- Static Page Content (headings from Privacy/Terms/Disclaimer/About) ---------- */
.page-content h2 { font-size: 1.2rem; margin: 28px 0 10px; color: var(--sv-text); }
.page-content h2:first-child { margin-top: 0; }
.page-content a { color: var(--sv-primary); font-weight: 600; text-decoration: underline; }
.contact-email-line { margin: 18px 0 24px; font-size: 0.95rem; }
.sv-hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
	background: var(--sv-surface); border-top: 1px solid var(--sv-border);
	box-shadow: 0 -6px 24px rgba(0,0,0,0.08);
}
.cookie-banner-inner {
	max-width: 1180px; margin: 0 auto; padding: 16px 24px;
	display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.cookie-banner-inner p { margin: 0; font-size: 0.85rem; color: var(--sv-text-muted); flex: 1; min-width: 240px; }
.cookie-banner-inner a { color: var(--sv-primary); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--sv-surface); border-top: 1px solid var(--sv-border); margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding: 48px 24px; }
.footer-brand p { font-size: 0.86rem; margin-top: 12px; }
.footer-col h4 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 14px; color: var(--sv-text-muted); }
.footer-col ul li { margin-bottom: 9px; }
.footer-col a { font-size: 0.88rem; color: var(--sv-text); }
.footer-col a:hover { color: var(--sv-primary); }
.footer-bottom { border-top: 1px solid var(--sv-border); padding: 18px 0; text-align: center; font-size: 0.8rem; color: var(--sv-text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.category-grid, .why-grid { grid-template-columns: repeat(2, 1fr); }
	.tool-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-inner { grid-template-columns: 1fr 1fr; }
	.tool-search { display: none; }
}
@media (max-width: 760px) {
	.main-nav { position: fixed; top: 68px; left: 0; right: 0; background: var(--sv-surface); border-bottom: 1px solid var(--sv-border); max-height: 0; overflow: hidden; transition: max-height 0.2s ease; }
	.main-nav.open { max-height: 480px; overflow-y: auto; }
	.main-nav ul { flex-direction: column; padding: 10px 24px 20px; }
	.nav-toggle { display: flex; }
	.hero h1 { font-size: 1.9rem; }
	.hero-stats { gap: 24px; }
	.tool-two-col, .dynamic-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.category-grid, .why-grid, .tool-grid { grid-template-columns: 1fr; }
	.footer-inner { grid-template-columns: 1fr; }
	.hero { padding: 48px 0 36px; }
}
