/* =========================================================
   ARIX SEO Analyzer — Component Styles
   Add to your main stylesheet or include as a separate file.
   File: /assets/css/seo-analyzer.css
   ========================================================= */

/* ── Severity icons ─────────────────────────────────────── */
.sev-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.sev-critical { background: #fee2e2; color: #dc2626; }
.sev-warning  { background: #fef3c7; color: #d97706; }
.sev-info     { background: #dbeafe; color: #2563eb; }
.sev-ok       { background: #dcfce7; color: #16a34a; }

/* ── Submit button states ───────────────────────────────── */
#seoSubmit .seo-submit__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
#seoSubmit.is-loading .seo-submit__label  { display: none; }
#seoSubmit.is-loading .seo-submit__spinner{ display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error hint ─────────────────────────────────────────── */
.seo-error { color: var(--clr-critical, #ef4444); font-weight: 500; }

/* ── Result head ────────────────────────────────────────── */
.seo-result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.seo-result__crumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
}
.seo-result__crumbs a {
  font-weight: 600;
  word-break: break-all;
}

/* ── Top two-column ─────────────────────────────────────── */
.seo-result__top {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}
@media (max-width: 700px) {
  .seo-result__top { grid-template-columns: 1fr; }
}

/* ── Score ring card ────────────────────────────────────── */
.seo-score {
  background: var(--clr-surface, #fff);
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}
.seo-score__ring { position: relative; display: inline-block; }
.seo-score__svg  { display: block; }
.seo-score__bg   { fill: none; stroke: var(--clr-border, #e5e7eb); stroke-width: 10; }
.seo-score__fg   {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.05s;
}
.seo-score__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.seo-score__grade {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.seo-score__num  { font-size: 2.5rem; font-weight: 800; line-height: 1; color: var(--clr-text, #111); }
.seo-score__lbl  { font-size: 0.75rem; color: var(--clr-muted, #6b7280); }
.seo-score__rec  {
  margin-top: 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--clr-text-2, #374151);
  text-align: left;
}

/* ── Meta card ──────────────────────────────────────────── */
.seo-meta-card {
  background: var(--clr-surface, #fff);
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 16px;
  padding: 1.5rem;
}
.seo-meta-card h2 { margin: 0 0 1rem; font-size: 1rem; }

.seo-meta-list { margin: 0; }
.seo-meta-row  {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.25rem 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--clr-border, #f0f0f0);
  font-size: 0.82rem;
}
.seo-meta-row:last-child { border-bottom: none; }
.seo-meta-row dt { color: var(--clr-muted, #6b7280); white-space: nowrap; }
.seo-meta-row dd { margin: 0; word-break: break-word; }
.meta-val--ok   { color: #16a34a; }
.meta-val--warn { color: #d97706; }
.meta-val--bad  { color: #dc2626; }
.meta-val--missing em { color: var(--clr-muted, #9ca3af); }

/* ── Section title ──────────────────────────────────────── */
.seo-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  height: 22px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge--critical { background: #fee2e2; color: #dc2626; }
.badge--ok       { background: #dcfce7; color: #16a34a; }

/* ── Category grid ──────────────────────────────────────── */
.seo-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.seo-cat {
  background: var(--clr-surface, #fff);
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 12px;
  padding: 1rem;
}
.seo-cat__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.seo-cat__icon  { font-size: 1rem; }
.seo-cat__label { font-size: 0.82rem; font-weight: 600; flex: 1; }
.seo-cat__score { font-size: 1rem; font-weight: 800; }
.seo-cat__bar   {
  height: 6px;
  border-radius: 99px;
  background: var(--clr-border, #e5e7eb);
  overflow: hidden;
}
.seo-cat__fill  {
  height: 100%;
  border-radius: 99px;
  width: 0%;
}

/* ── Two-col issues/passed ──────────────────────────────── */
.seo-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}
@media (max-width: 800px) {
  .seo-cols { grid-template-columns: 1fr; }
}

/* ── Issue item ─────────────────────────────────────────── */
.seo-issue, .seo-pass {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--clr-border, #e5e7eb);
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  background: var(--clr-surface, #fff);
}
.seo-issue--critical { border-left: 3px solid #dc2626; }
.seo-issue--warning  { border-left: 3px solid #d97706; }
.seo-issue--info     { border-left: 3px solid #2563eb; }
.seo-issue__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.seo-issue__head strong { flex: 1; line-height: 1.3; }
.seo-issue__cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-muted, #9ca3af);
  background: var(--clr-bg, #f9fafb);
  padding: 1px 6px;
  border-radius: 4px;
}
.seo-issue__desc {
  margin: 0;
  color: var(--clr-text-2, #4b5563);
  line-height: 1.5;
  font-size: 0.8rem;
}

/* ── Pass item ──────────────────────────────────────────── */
.seo-pass {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  border-left: 3px solid #16a34a;
}
.seo-pass > div { flex: 1; }
.seo-pass strong { display: block; margin-bottom: 0.15rem; }

/* ── Empty states ───────────────────────────────────────── */
.seo-empty { font-size: 0.9rem; padding: 1rem; text-align: center; color: var(--clr-muted, #9ca3af); }

/* ── Issue list / passed list scroll ───────────────────── */
.seo-issue-list,
.seo-passed-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}
.seo-issue-list::-webkit-scrollbar,
.seo-passed-list::-webkit-scrollbar { width: 4px; }
.seo-issue-list::-webkit-scrollbar-thumb,
.seo-passed-list::-webkit-scrollbar-thumb {
  background: var(--clr-border, #e5e7eb);
  border-radius: 4px;
}

/* ── CTA block ──────────────────────────────────────────── */
.seo-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2rem;
  background: var(--clr-surface, #fff);
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 16px;
  margin-top: 1rem;
}
.seo-cta h2 { margin: 0 0 0.5rem; }
.seo-cta p  { margin: 0; font-size: 0.9rem; color: var(--clr-text-2, #4b5563); max-width: 480px; }
