/* =========================================================
   WIZHY WEB STUDIO — SEO Audit Workbench & Tools Suite
   Loaded strictly on /seo-audit/ and /tools/ (zero homepage impact)
   Supports all 4 themes: light, dark, espresso, lune
   ========================================================= */

body.seo-audit-page,
body.seo-tools-page {
  background-color: var(--bg);
  color: var(--text-primary);
}

.wb-hero {
  padding: 124px 0 40px;
  text-align: center;
}

.wb-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.wb-breadcrumbs a { color: var(--accent-1); font-weight: 600; }

.wb-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-1-soft);
  color: var(--accent-1);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.wb-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.12;
  margin: 0 auto 12px;
  max-width: 780px;
}

.wb-subtitle {
  max-width: 660px;
  margin: 0 auto 26px;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.wb-scan-form {
  display: flex;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
  align-items: center;
}

.wb-scan-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.wb-scan-icon {
  position: absolute;
  left: 18px;
  font-size: 1rem;
  pointer-events: none;
}

.wb-scan-form input {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px 14px 46px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.96rem;
}
.wb-scan-form input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px var(--accent-1-soft);
}

.wb-scan-btn {
  min-height: 52px;
  border-radius: 999px;
  padding: 14px 28px;
  white-space: nowrap;
}

.wb-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.wb-error {
  margin-top: 14px;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 20px;
}

.wb-progress-card {
  max-width: 720px;
  margin: 22px auto 0;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  text-align: left;
}
.wb-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.wb-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 12px;
}
.wb-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--gold));
  transition: width 0.35s var(--ease);
}
.wb-stage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wb-stage-chips span {
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.wb-stage-chips span.active {
  background: var(--accent-1-soft);
  color: var(--accent-1);
  border-color: var(--accent-1);
  font-weight: 700;
}
.wb-stage-chips span.done {
  background: var(--accent-2-soft);
  color: var(--accent-2);
  border-color: var(--accent-2);
}

/* Report Section */
.wb-report-section {
  padding: 12px 0 72px;
}

.wb-card,
.wb-overview-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
}

.wb-overview-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.wb-overview-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 260px;
}

.wb-score-ring {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.wb-score-ring svg { width: 110px; height: 110px; }
.wb-score-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.wb-score-ring .track { stroke: var(--border); }
.wb-score-ring .fill {
  stroke: var(--accent-1);
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s var(--ease);
}
.wb-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wb-score-num strong { font-family: var(--font-display); font-size: 1.85rem; line-height: 1; }
.wb-score-num span { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }

.wb-grade-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wb-grade-badge {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--accent-2-soft);
  color: var(--accent-2);
  border: 1.5px solid var(--accent-2);
}
.wb-grade-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

.wb-overview-meta { flex: 1; min-width: 220px; }
.wb-url-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.wb-url-row h2 { font-size: 1.25rem; word-break: break-all; margin: 0; }
.wb-stack-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.wb-summary-text { color: var(--text-secondary); font-size: 0.94rem; margin-bottom: 10px; }

.wb-totals-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.wb-pill--pass { background: rgba(21, 128, 61, 0.14); color: #15803d; }
.wb-pill--warn { background: rgba(217, 119, 6, 0.14); color: #b45309; }
.wb-pill--err  { background: rgba(220, 38, 38, 0.14); color: #dc2626; }
.wb-pill--tot  { background: var(--surface-2); color: var(--text-secondary); }
html[data-theme="dark"] .wb-pill--pass,
html[data-theme="espresso"] .wb-pill--pass { color: #4ade80; }
html[data-theme="dark"] .wb-pill--warn,
html[data-theme="espresso"] .wb-pill--warn { color: #fbbf24; }
html[data-theme="dark"] .wb-pill--err,
html[data-theme="espresso"] .wb-pill--err { color: #f87171; }

.wb-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wb-overview-actions .btn { min-height: 44px; }

/* 6 Metric Cards */
.wb-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.wb-metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-align: center;
}
.wb-metric-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.wb-metric-box span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Previews & Domain Strength */
.wb-previews-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  margin-bottom: 22px;
}
.wb-previews-grid .wb-card { margin-bottom: 0; }
.wb-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.wb-card__head h3 { font-size: 1.12rem; margin: 0; }

.wb-serp-preview {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.wb-serp-url { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 3px; word-break: break-all; }
.wb-serp-title { font-size: 1.05rem; font-weight: 700; color: #1a0dab; margin-bottom: 4px; }
html[data-theme="dark"] .wb-serp-title,
html[data-theme="espresso"] .wb-serp-title { color: #8ab4f8; }
.wb-serp-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }

.wb-og-preview {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}
.wb-og-img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--border);
}
.wb-og-meta small { font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); }
.wb-og-meta strong { display: block; font-size: 0.9rem; margin: 2px 0; }
.wb-og-meta p { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }

.wb-snapshot-wrap {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: start;
}
.wb-phone-frame {
  border: 3px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wb-phone-frame img { width: 100%; height: 100%; object-fit: cover; }
.wb-phone-placeholder { font-size: 0.76rem; color: var(--text-muted); padding: 12px; text-align: center; }

.wb-domain-box { display: grid; gap: 8px; font-size: 0.88rem; }
.wb-domain-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.wb-mini-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-1-soft);
  color: var(--accent-1);
}

/* Fix These First */
.wb-fixes-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.wb-fixes-head h3 { font-size: 1.2rem; margin: 0 0 2px; }
.wb-muted { color: var(--text-secondary); font-size: 0.88rem; margin: 0; }

.wb-export-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-chip-btn {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
}
.wb-chip-btn:hover { border-color: var(--accent-1); color: var(--accent-1); }

.wb-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.wb-filter-btn {
  min-height: 42px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wb-filter-btn.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: var(--on-accent);
}

.wb-fixes-list { display: grid; gap: 10px; }
.wb-issue-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg);
}
.wb-issue-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.wb-issue-title { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.wb-tag--error { background: rgba(220, 38, 38, 0.14); color: #dc2626; }
.wb-tag--warning { background: rgba(217, 119, 6, 0.14); color: #b45309; }
.wb-tag--pass { background: rgba(21, 128, 61, 0.14); color: #15803d; }
.wb-tag--quick { background: var(--accent-2-soft); color: var(--accent-2); }
html[data-theme="dark"] .wb-tag--error, html[data-theme="espresso"] .wb-tag--error { color: #f87171; }
html[data-theme="dark"] .wb-tag--warning, html[data-theme="espresso"] .wb-tag--warning { color: #fbbf24; }
html[data-theme="dark"] .wb-tag--pass, html[data-theme="espresso"] .wb-tag--pass { color: #4ade80; }

.wb-issue-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wb-fix-drawer {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent-1);
  font-size: 0.85rem;
}
.wb-fix-drawer pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  margin: 6px 0 0;
}

.wb-fixes-more { margin-top: 14px; text-align: center; }

/* 12 Category Tabs */
.wb-cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.wb-cat-tab {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wb-cat-tab.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: var(--on-accent);
}
.wb-cat-badge {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.12);
}

.wb-checks-grid { display: grid; gap: 10px; }
.wb-check-row {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

/* Tables inside On-Page, AI Search, Sitemaps */
.wb-table-wrap { overflow-x: auto; margin-top: 16px; }
.wb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.wb-table th, .wb-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.wb-table th { font-weight: 700; color: var(--text-secondary); background: var(--surface-2); }

/* Core Vitals Dials */
.wb-cwv-dials {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.wb-cwv-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.wb-cwv-card strong { font-family: var(--font-display); font-size: 1.7rem; display: block; color: var(--accent-1); }

/* CTA Banner */
.wb-cta-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--accent-1);
  box-shadow: var(--shadow-card);
}
.wb-cta-banner h3 { margin: 0 0 6px; font-size: 1.35rem; }
.wb-cta-banner p { margin: 0; color: var(--text-secondary); max-width: 600px; }
.wb-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Responsive Mobile-First Breakpoints (360px / 390px / 768px) */
@media (max-width: 960px) {
  .wb-metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wb-previews-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wb-hero { padding: 110px 0 28px; }
  .wb-scan-form { flex-direction: column; }
  .wb-scan-input-wrap, .wb-scan-btn { width: 100%; }
  .wb-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-snapshot-wrap { grid-template-columns: 1fr; }
  .wb-phone-frame { max-width: 180px; margin: 0 auto; }
  .wb-cwv-dials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-overview-actions { width: 100%; }
  .wb-overview-actions .btn { flex: 1; }
}

/* Print / PDF Export */
@media print {
  .navbar, .mobile-menu, .wb-scan-form, .wb-pills, .wb-progress-card,
  .wb-overview-actions, .wb-export-btns, .wb-filter-tabs, .wb-cta-banner,
  .footer, .whatsapp-fab, .back-to-top, .wizhy-chat-fab, .wizhy-chat-window {
    display: none !important;
  }
  body { background: #fff !important; color: #111 !important; }
  .wb-card, .wb-overview-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
}

/* ---------- Tools Hub Grid & Single Tool Controls ---------- */
.th-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.th-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.th-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-1);
}
.th-card--all {
  background: linear-gradient(145deg, var(--accent-1-soft), var(--surface));
  border-color: var(--accent-1);
}
.th-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.th-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-1);
}
.th-time { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.th-card h3 { font-size: 1.15rem; margin: 0 0 8px; }
.th-card p { font-size: 0.88rem; color: var(--text-secondary); margin: 0 0 14px; flex: 1; }
.th-go { font-size: 0.86rem; font-weight: 700; color: var(--accent-1); }

.wb-extra-input,
.wb-extra-select {
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.92rem;
  max-width: 210px;
}
.wb-code-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}
@media (max-width: 960px) {
  .th-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .th-grid { grid-template-columns: 1fr; }
  .wb-extra-input, .wb-extra-select { max-width: 100%; width: 100%; }
}
