/* ═══════════════════════════════════════════════════════════════════════
   IndexCraft SEO · AEO · GEO · E-E-A-T Audit Tool — Stylesheet
   Theme: Purple (#6F42C1) + Dark (#4A2B5E)
═══════════════════════════════════════════════════════════════════════ */

:root {
  --purple:      #6F42C1;
  --purple-dark: #4A2B5E;
  --purple-mid:  #8a2be2;
  --purple-light:#f3eeff;
  --purple-50:   rgba(111,66,193,0.08);
  --success:     #198754;
  --warning:     #e6a817;
  --danger:      #dc3545;
  --info:        #0ea5e9;
  --border:      #e2d9f3;
  --text:        #1e1b2e;
  --muted:       #6c757d;
  --radius:      12px;
  --shadow:      0 4px 20px rgba(111,66,193,0.1);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  background: #f8f5ff;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar-custom {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
  padding: 12px 0;
  box-shadow: 0 2px 15px rgba(74,43,94,.4);
}
.navbar-custom .navbar-brand img { height: 38px; }
.navbar-custom .nav-link {
  color: rgba(255,255,255,.85) !important;
  font-weight: 500; font-size: 14px;
  padding: 6px 14px !important;
  border-radius: 6px;
  transition: all .2s;
}
.navbar-custom .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.15);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 60%, #a855f7 100%);
  color: #fff;
  padding: 56px 20px 48px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.hero-section::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-section h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700; margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
  position: relative; z-index: 1;
}
.hero-section p {
  font-size: 15px; color: rgba(255,255,255,.85);
  max-width: 680px; margin: 0 auto;
  position: relative; z-index: 1;
}

/* ── Module Tags in Hero ──────────────────────────────────────────────── */
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; position: relative; z-index: 1; }
.hero-tag {
  background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 500;
}

/* ── Input Box ────────────────────────────────────────────────────────── */
.box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.form-label { font-weight: 600; font-size: 13px; color: var(--purple-dark); margin-bottom: 6px; }
.form-control {
  border: 1px solid #d1c4e9;
  border-radius: 8px; padding: 10px 14px;
  font-size: 14px; font-family: 'Poppins', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(111,66,193,.15);
  outline: none;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-run {
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  color: #fff; border: none; border-radius: 8px;
  padding: 10px 28px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; font-family: 'Poppins', sans-serif;
  box-shadow: 0 4px 14px rgba(111,66,193,.35);
}
.btn-run:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(111,66,193,.45); }
.btn-run:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.btn-clr {
  background: #fff; color: var(--muted);
  border: 1px solid #d1c4e9; border-radius: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all .2s; font-family: 'Poppins', sans-serif;
}
.btn-clr:hover { border-color: var(--purple); color: var(--purple); }

.btn-exp {
  background: #fff; color: var(--purple);
  border: 2px solid var(--purple); border-radius: 8px;
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s; font-family: 'Poppins', sans-serif;
  white-space: nowrap;
}
.btn-exp:hover { background: var(--purple); color: #fff; }

/* ── Error ────────────────────────────────────────────────────────────── */
.errmsg {
  display: none; background: #fff5f5;
  border: 1px solid #fecaca; border-left: 4px solid var(--danger);
  border-radius: 8px; padding: 10px 14px; color: #991b1b;
  font-size: 13px; margin-top: 12px;
}

/* ── Progress ─────────────────────────────────────────────────────────── */
.pw { display: none; margin-top: 16px; }
.pbar-bg {
  height: 8px; background: #e8d8f5; border-radius: 999px; overflow: hidden;
}
.pbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--purple-mid));
  border-radius: 999px; transition: width .4s ease;
}
.status-txt { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Score Banner ─────────────────────────────────────────────────────── */
.score-banner {
  background: linear-gradient(135deg, #fff 0%, var(--purple-light) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.score-circle {
  width: 110px; height: 110px; border-radius: 50%;
  border: 6px solid var(--purple); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #fff; flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(111,66,193,.2);
}
.score-circle span:first-child { font-size: 34px; font-weight: 700; color: var(--purple-dark); line-height: 1; }
.sc-lbl { font-size: 11px; color: var(--muted); font-weight: 500; }
.score-circle.good { border-color: var(--success); }
.score-circle.good span:first-child { color: var(--success); }
.score-circle.mod  { border-color: var(--warning); }
.score-circle.mod  span:first-child { color: var(--warning); }
.score-circle.poor { border-color: var(--danger); }
.score-circle.poor span:first-child { color: var(--danger); }

/* ── Summary Grid ─────────────────────────────────────────────────────── */
.sum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.sum-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-align: center; cursor: pointer;
  transition: all .2s; box-shadow: 0 2px 8px rgba(111,66,193,.06);
}
.sum-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--purple); }
.sum-card .s-icon { font-size: 22px; margin-bottom: 8px; }
.sum-mini-circle {
  width: 60px; height: 60px; border-radius: 50%;
  border: 4px solid; display: flex; align-items: center; justify-content: center;
  margin: 8px auto; font-size: 17px; font-weight: 700; background: #fff;
}
.sum-mini-circle.good { border-color: var(--success); color: var(--success); }
.sum-mini-circle.mod  { border-color: var(--warning); color: var(--warning); }
.sum-mini-circle.poor { border-color: var(--danger);  color: var(--danger);  }
.sum-name { font-size: 12px; color: var(--muted); font-weight: 500; }
.sum-badges { display: flex; gap: 6px; justify-content: center; margin-top: 6px; font-size: 11px; }
.sb-pass { color: var(--success); }
.sb-fail { color: var(--danger); }
.sb-warn { color: var(--warning); }

/* ── Audit Tabs ───────────────────────────────────────────────────────── */
.audit-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px;
  margin-bottom: 16px; box-shadow: 0 2px 8px rgba(111,66,193,.06);
  scrollbar-width: none;
}
.audit-tabs::-webkit-scrollbar { display: none; }

.atab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: all .15s; font-family: 'Poppins', sans-serif;
}
.atab:hover { color: var(--purple); background: var(--purple-50); }
.atab.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-mid));
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(111,66,193,.3);
}
.atab .ts { font-size: 11px; background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 6px; }
.atab:not(.active) .ts { background: var(--purple-50); color: var(--purple); }

/* ── Tab Panels ───────────────────────────────────────────────────────── */
.tpanel { display: none; }
.tpanel.active { display: block; }

/* ── Category Panel Header ────────────────────────────────────────────── */
.cat-panel {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: 0 2px 8px rgba(111,66,193,.06);
}
.cat-panel-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; flex-wrap: wrap; gap: 12px;
}
.cat-panel-hdr h2 { font-size: 18px; font-weight: 700; color: var(--purple-dark); margin: 0; }
.cat-desc { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.checks-summary { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.cs-pass { color: var(--success); font-size: 13px; font-weight: 500; }
.cs-fail { color: var(--danger);  font-size: 13px; font-weight: 500; }
.cs-warn { color: var(--warning); font-size: 13px; font-weight: 500; }
.cs-info { color: var(--info);    font-size: 13px; font-weight: 500; }

/* ── Check Item ───────────────────────────────────────────────────────── */
.check-item {
  border-radius: 8px; overflow: hidden; margin-bottom: 6px;
  border: 1px solid; transition: box-shadow .15s;
}
.check-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.check-item.pass    { border-color: #bbf7d0; background: #f0fdf4; }
.check-item.fail    { border-color: #fecaca; background: #fff5f5; }
.check-item.warning { border-color: #fde68a; background: #fffbeb; }
.check-item.info    { border-color: #bae6fd; background: #f0f9ff; }

.check-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background .1s; user-select: none;
}
.check-hdr:hover { background: rgba(0,0,0,.02); }
.chk-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.chk-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.chk-arrow { font-size: 10px; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.chk-arrow.open { transform: rotate(180deg); }

.check-body {
  padding: 0 14px 12px 44px;
  border-top: 1px solid rgba(0,0,0,.06);
  display: none;
}
.check-body.open { display: block; }
.chk-details { font-size: 13px; color: var(--muted); margin-top: 8px; }
.chk-rec {
  font-size: 13px; color: #0f766e;
  background: #f0fdfa; border-radius: 6px;
  padding: 7px 10px; margin-top: 8px;
  display: flex; gap: 6px; align-items: flex-start;
  border-left: 3px solid #14b8a6;
}

/* ── Impact Badge ─────────────────────────────────────────────────────── */
.badge-impact {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  font-weight: 600; flex-shrink: 0; text-transform: uppercase; letter-spacing: .03em;
}
.badge-impact.high   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.badge-impact.medium { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-impact.low    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Overview Panel ───────────────────────────────────────────────────── */
.overview-panel { display: grid; gap: 20px; }
.ov-top-issues {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 2px 8px rgba(111,66,193,.06);
}
.ov-title { font-size: 14px; font-weight: 700; color: var(--purple-dark); margin-bottom: 12px; }
.ov-issue {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #fff5f5;
  border: 1px solid #fecaca; border-radius: 7px; margin-bottom: 6px;
}
.ov-issue .oi-icon { color: var(--danger); font-size: 14px; }
.ov-issue .oi-name { flex: 1; font-size: 13px; font-weight: 500; }
.ov-issue .oi-cat  { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; background: #f3e8ff; color: var(--purple); padding: 2px 8px; border-radius: 999px; }

.ov-warn {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 7px; margin-bottom: 6px;
}
.ov-warn .oi-icon { color: var(--warning); }
.ov-quick-wins {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.ov-win {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 12px; background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: 7px; margin-bottom: 6px;
}
.ov-win .oi-icon { color: var(--success); }

/* ── Score Stats Row ──────────────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.stat-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; text-align: center;
}
.stat-val { font-size: 20px; font-weight: 700; color: var(--purple-dark); }
.stat-val.ok   { color: var(--success); }
.stat-val.bad  { color: var(--danger); }
.stat-val.warn { color: var(--warning); }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── SERP Preview ─────────────────────────────────────────────────────── */
.serp-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}
.serp-browser { background: #f1f3f4; border-radius: 8px; padding: 16px 20px; font-family: Arial, sans-serif; }
.serp-url { font-size: 12px; color: #0d652d; margin-bottom: 2px; }
.serp-url cite { font-style: normal; }
.serp-title { font-size: 19px; color: #1a0dab; margin-bottom: 3px; cursor: pointer; }
.serp-title:hover { text-decoration: underline; }
.serp-desc { font-size: 13px; color: #4d5156; line-height: 1.6; }
.serp-warning { font-size: 12px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.serp-ok { color: var(--success); }

/* ── Social Preview (OG) ──────────────────────────────────────────────── */
.og-card {
  border: 1px solid #dce1e7; border-radius: 10px; overflow: hidden;
  max-width: 500px; font-family: Arial, sans-serif;
}
.og-card .og-img { background: #e8e8e8; height: 260px; display: flex; align-items: center; justify-content: center; color: #999; font-size: 13px; }
.og-card .og-img img { width: 100%; height: 100%; object-fit: cover; }
.og-card .og-body { padding: 12px 14px; background: #f0f2f5; }
.og-card .og-domain { font-size: 11px; color: #90949c; text-transform: uppercase; }
.og-card .og-title { font-size: 16px; font-weight: 600; color: #1c1e21; margin: 2px 0; }
.og-card .og-desc { font-size: 13px; color: #606770; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Readability Meter ────────────────────────────────────────────────── */
.readability-card {
  background: linear-gradient(135deg, var(--purple-light), #fff);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 14px;
}
.read-score { font-size: 42px; font-weight: 700; color: var(--purple-dark); }
.read-bar-bg { height: 10px; background: #e8d8f5; border-radius: 999px; margin: 8px 0; overflow: hidden; }
.read-bar    { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--purple), var(--purple-mid)); }
.read-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

/* ── Cards (SERP/OG section) ──────────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important; margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(111,66,193,.06);
}
.card-header {
  background: linear-gradient(135deg, var(--purple-light), #fff) !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 700; color: var(--purple-dark) !important;
  font-size: 14px; padding: 14px 20px !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-body { padding: 20px !important; }

/* ── Flesch Scale ─────────────────────────────────────────────────────── */
.flesch-scale {
  display: flex; border-radius: 6px; overflow: hidden; height: 10px; margin: 8px 0;
}
.flesch-seg { flex: 1; }
.fs-1 { background: #ef4444; }
.fs-2 { background: #f97316; }
.fs-3 { background: #eab308; }
.fs-4 { background: #84cc16; }
.fs-5 { background: #22c55e; }
.flesch-needle {
  position: relative; height: 14px; margin-top: -4px;
}
.flesch-needle::before {
  content: '▲'; position: absolute; font-size: 12px; color: var(--purple-dark);
  transform: translateX(-50%); top: 0;
}

/* ── Tool Info Card ───────────────────────────────────────────────────── */
.tool-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px;
  margin-bottom: 24px; box-shadow: var(--shadow);
}
.tool-card h2 { font-size: 18px; font-weight: 700; color: var(--purple-dark); margin-bottom: 10px; }
.tool-card h2:not(:first-child) { margin-top: 24px; }
.tool-card p { color: var(--muted); font-size: 14px; }
.module-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin: 16px 0;
}
.module-card {
  background: var(--purple-light); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.module-card h4 { font-size: 13px; font-weight: 700; color: var(--purple-dark); margin-bottom: 4px; }
.module-card p  { font-size: 12px; color: var(--muted); margin: 0; }

/* ── Issue count pill ─────────────────────────────────────────────────── */
.pill-fail { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 12px; background: #fff5f5; border: 1px solid #fecaca; border-radius: 999px; color: #991b1b; font-weight: 600; margin-right: 8px; }
.pill-warn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; color: #92400e; font-weight: 600; margin-right: 8px; }
.pill-pass { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 999px; color: #166534; font-weight: 600; }

/* ── Proxy info ───────────────────────────────────────────────────────── */
.proxy-tag { font-size: 11px; color: var(--muted); background: var(--purple-50); padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer-custom { background-color: #343a40 !important; color: #e0e0e0 !important; padding: 50px 0 30px; margin-top: 50px; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); }
.footer-custom a { color: #e0e0e0 !important; text-decoration: none; transition: color .3s ease; }
.footer-custom a:hover { color: #8a2be2 !important; }
.footer-links-grid { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 35px; margin-bottom: 25px; }
.footer-col h5 { color: #fff; font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { color: #adb5bd !important; font-size: 1rem; transition: color .3s ease; }
.footer-col ul li a:hover { color: #8a2be2 !important; }
.footer-copyright { font-size: 1rem; color: #adb5bd; }
.footer-copyright a { color: #adb5bd !important; }
.footer-copyright a:hover { color: #8a2be2 !important; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero-section { padding: 36px 16px 32px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .sum-grid  { grid-template-columns: repeat(2, 1fr); }
  .score-banner .d-flex { flex-direction: column; align-items: flex-start; }
  .checks-summary { gap: 10px; }
  .cat-panel { padding: 16px; }
  .check-body { padding-left: 14px; }
}
@media (max-width: 480px) {
  .sum-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-tabs { flex-wrap: nowrap; }
}
