/* ============================================================
   Free Backlink Generator - Stylesheet
   Clean, modern, responsive SEO-tool design.
   Minimal CSS for fast loading & strong PageSpeed.
   ============================================================ */

:root {
  --brand: #2563eb;
  --brand-dark: #1e4fd6;
  --brand-soft: #eff4ff;
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand span { color: var(--brand); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; list-style: none; }
.nav-links a { color: var(--text); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--brand); text-decoration: none; }

/* ---------- Hero / Tool ---------- */
.hero { padding: 48px 0 24px; }
.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.5px;
  text-align: center;
}
.hero .tagline {
  text-align: center; color: var(--muted); max-width: 640px;
  margin: 12px auto 0; font-size: 17px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 28px auto 0;
  max-width: 860px;
}
.tool-card label { font-weight: 600; font-size: 15px; display: block; margin-bottom: 8px; }
.help-text { color: var(--muted); font-size: 13px; margin-top: 6px; }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .field-row { grid-template-columns: 1fr; } }

.mode-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn-mode {
  flex: 1 1 auto;
  font-family: var(--font);
  border: 2px solid var(--brand);
  color: var(--brand);
  background: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}
.btn-mode:hover { background: var(--brand-soft); }
.btn-mode.primary {
  background: var(--brand); color: #fff;
}
.btn-mode.primary:hover { background: var(--brand-dark); }
.btn-mode:disabled, .btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.select-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.select-wrap select {
  padding: 9px 12px; font-size: 14px; font-family: var(--font);
  border: 2px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
.select-wrap select:focus { border-color: var(--brand); outline: none; }

.url-row { display: flex; gap: 12px; flex-wrap: wrap; }
.url-input-wrap { flex: 1 1 320px; position: relative; }

.url-input {
  width: 100%;
  padding: 15px 16px;
  font-size: 17px;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
}
.url-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.btn {
  font-family: var(--font);
  border: none; cursor: pointer;
  font-weight: 600; font-size: 16px;
  padding: 15px 22px;
  border-radius: 12px;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand); color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #9db8f5; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f9fafb; color: var(--text); }

.url-error { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 20px; font-weight: 500; }

/* ---------- Progress ---------- */
.progress-panel { display: none; margin-top: 22px; }
.progress-panel.active { display: block; }
.progress-steps { list-style: none; margin-top: 16px; }
.progress-steps li {
  padding: 8px 0; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
  font-size: 15px;
}
.progress-steps li .ic {
  width: 20px; text-align: center; display: inline-block; flex: 0 0 20px;
}
.progress-steps li.done { color: var(--text); }
.progress-steps li.done .ic { color: var(--green); }
.progress-steps li.active { color: var(--text); font-weight: 600; }
.progress-steps li.active .ic { color: var(--brand); }
.progress-steps li.pending .ic { color: #cbd5e1; }
.progress-title { font-weight: 700; font-size: 17px; }
.progress-complete { display: none; margin-top: 14px; font-weight: 600; color: var(--green); }
.progress-complete.active { display: block; }
.progress-count { color: var(--text); }

/* Spinner */
.spinner {
  width: 34px; height: 34px; border: 4px solid var(--brand-soft);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Results ---------- */
.results-section { display: none; margin-top: 40px; }
.results-section.active { display: block; }

.results-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 16px;
}
.results-head h2 { font-size: 24px; font-weight: 800; }
.results-meta { color: var(--muted); font-size: 14px; }

/* ---------- Dashboard (report header) ---------- */
.report-head {
  background: var(--brand-soft); border: 1px solid #dbe7ff;
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px;
}
.report-head h2 { font-size: 20px; font-weight: 800; }
.report-head .report-target { color: var(--muted); font-size: 14px; margin-top: 4px; }
.report-head .report-keywords { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-top: 16px;
}
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px;
}
.stat-card .stat-num { font-size: 26px; font-weight: 800; color: var(--brand); }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.spam-note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.spam-warn { color: var(--amber); font-weight: 600; }

/* ---------- Advanced controls (filters + sort) ---------- */
.controls-bar { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.control-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.control-group .group-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font);
  transition: all .15s; white-space: nowrap;
}
.chip.small { padding: 5px 10px; font-size: 12px; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sort-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.sort-wrap select {
  padding: 8px 12px; font-size: 13px; font-family: var(--font);
  border: 2px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
.sort-wrap select:focus { border-color: var(--brand); outline: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 14px; }
thead th {
  text-align: left; background: #f9fafb; padding: 12px 14px;
  font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td .badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-type { background: var(--brand-soft); color: var(--brand-dark); }
.badge-dir { background: #fef3c7; color: var(--amber); }
.badge-blog { background: #dcfce7; color: var(--green); }
.badge-res { background: #e0e7ff; color: #4338ca; }
.badge-prof { background: #ede9fe; color: #6d28d9; }
.rel-ok { color: var(--green); font-weight: 600; }
.rel-mid { color: var(--amber); font-weight: 600; }
.rel-low { color: var(--muted); }
.status-ok { color: var(--green); }
.status-err { color: var(--red); }
.status-unk { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.actions a, .actions button {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 5px 10px; margin: 2px 2px 2px 0;
}
.btn-mini {
  background: #f3f4f6; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-family: var(--font); font-weight: 500;
}
.btn-mini:hover { background: #e5e7eb; }
.btn-mini.copied { background: #dcfce7; color: var(--green); border-color: #bbf7d0; }

/* Spam score badges: verified vs not-available */
.spam-verified { color: var(--green); font-weight: 600; }
.spam-verified .src { display:block; font-size: 11px; color: var(--muted); font-weight: 500; }
.spam-na { color: var(--muted); }
.auth-metric { color: var(--muted); }
.auth-metric .src { display:block; font-size: 11px; color: #9ca3af; }

.export-bar { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.anti-spam-note {
  display: none; align-items: flex-start; gap: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d;
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 20px 0;
}
.anti-spam-note.active { display: flex; }

.notice {
  display: none; align-items: flex-start; gap: 10px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 20px 0;
}
.notice.active { display: flex; }

.empty-state { text-align: center; padding: 40px 18px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }

/* ---------- Content sections ---------- */
.info-sections { margin: 56px 0; }
.info-section { margin-bottom: 40px; }
.info-section h2 { font-size: 26px; font-weight: 800; margin-bottom: 14px; }
.info-section h3 { font-size: 19px; font-weight: 700; margin: 18px 0 8px; }
.info-section p, .info-section li { color: #374151; }
.info-section ul, .info-section ol { padding-left: 22px; margin: 10px 0; }
.info-section li { margin: 6px 0; }

.warn-box {
  background: #fffbeb; border: 1px solid #fde68a; color: #78350f;
  border-radius: 10px; padding: 14px 16px; margin: 18px 0; font-size: 14px;
}

.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item h3 { cursor: pointer; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.faq-item h3::after { content: "+"; font-size: 22px; color: var(--brand); }
.faq-item.open h3::after { content: "–"; }
.faq-item .faq-a { display: none; color: #374151; padding-top: 8px; }
.faq-item.open .faq-a { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 60px; padding: 32px 0;
  background: #f9fafb;
}
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 18px; color: var(--muted); font-size: 13px; }
.anti-spam { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------- Page hero (about/contact etc.) ---------- */
.page-hero { padding: 40px 0 10px; }
.page-hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; }
.page-hero p { color: var(--muted); margin-top: 8px; max-width: 700px; }
.prose { max-width: 760px; }
.prose h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; }
.prose h3 { font-size: 18px; font-weight: 700; margin: 20px 0 8px; }
.prose p, .prose li { color: #374151; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0; }
.prose li { margin: 6px 0; }

.contact-form { max-width: 560px; margin-top: 24px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 2px solid var(--border); border-radius: 10px; font-family: var(--font);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--brand); outline: none; }
.form-note { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { padding: 32px 0 12px; }
  .tool-card { padding: 20px; }
  .url-row { flex-direction: column; }
  .btn { width: 100%; }
  .brand { font-size: 16px; }
  .nav { height: auto; padding: 12px 0; flex-direction: column; gap: 10px; }
  .nav-links { gap: 16px; }
  .results-head { flex-direction: column; align-items: flex-start; }
  .filter-bar { width: 100%; }
  .footer-top { flex-direction: column; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
