/* seo-analysis.css — prefix: seo- */
/* Relies on home-template.css for mdh-* design tokens and components */

body.seo-analysis-body {
  background: var(--mdh-bg);
  color: var(--mdh-ink);
}

/* ── Hero ── */
.seo-hero {
  padding: 80px 24px 64px;
  text-align: center;
  background: var(--mdh-bg);
}

.seo-hero-inner {
  max-width: 740px;
  margin: 0 auto;
}

/* ── URL Form Card ── */
.seo-form-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--mdh-line);
  border-radius: 26px;
  box-shadow: var(--mdh-shadow);
  padding: 28px 28px 22px;
  margin-top: 36px;
  text-align: left;
}

.seo-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--mdh-ink-soft);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.seo-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.seo-url-input {
  flex: 1;
  min-width: 0;
  height: 3.25rem;
  background: var(--mdh-bg);
  border: 1.5px solid var(--mdh-line-strong, rgba(107,33,212,.2));
  border-radius: 999px;
  color: var(--mdh-ink);
  font-size: 0.95rem;
  padding: 0 1.25rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}

.seo-url-input::placeholder {
  color: var(--mdh-muted);
}

.seo-url-input:focus {
  border-color: var(--mdh-purple);
  box-shadow: 0 0 0 3px rgba(107,33,212,.1);
}

.seo-submit-btn {
  height: 3.25rem;
  padding: 0 1.75rem;
  flex-shrink: 0;
  background: var(--mdh-grad);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s, box-shadow .2s;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(107,33,212,.3);
}

.seo-submit-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(107,33,212,.36);
}

.seo-submit-btn:active { transform: scale(.98); }
.seo-submit-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.seo-form-note {
  color: var(--mdh-muted);
  font-size: 0.78rem;
  margin-top: 12px;
}

/* ── Inline Messages ── */
.seo-error-msg,
.seo-limit-msg {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-top: 12px;
  display: none;
  line-height: 1.55;
}

.seo-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.seo-limit-msg {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ── Loading ── */
.seo-loading {
  display: none;
  text-align: center;
  padding: 48px 24px;
}

.seo-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--mdh-line);
  border-top-color: var(--mdh-purple);
  border-radius: 50%;
  animation: seo-spin .8s linear infinite;
  margin: 0 auto 16px;
}

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

.seo-loading-text {
  color: var(--mdh-ink-soft);
  font-size: 0.9rem;
}

/* ── Results ── */
.seo-results {
  display: none;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

/* Score card */
.seo-score-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--mdh-line);
  border-radius: 26px;
  box-shadow: var(--mdh-shadow);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.seo-score-ring {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  position: relative;
}

.seo-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.seo-score-ring circle { fill: none; stroke-width: 8; }

.seo-ring-bg { stroke: rgba(107,33,212,.1); }
.seo-ring-fill {
  stroke: var(--mdh-purple);
  stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1);
}
.seo-ring-fill.warn { stroke: #f59e0b; }
.seo-ring-fill.poor { stroke: #ef4444; }

.seo-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--mdh-ink);
  letter-spacing: -0.04em;
}

.seo-score-num span { font-size: 0.65rem; color: var(--mdh-muted); font-weight: 500; letter-spacing: 0; }

.seo-score-info { flex: 1; min-width: 160px; }
.seo-score-label { font-size: 1.2rem; font-weight: 800; color: var(--mdh-ink); margin-bottom: 4px; }
.seo-score-sub { color: var(--mdh-ink-soft); font-size: 0.88rem; line-height: 1.5; }
.seo-analyzed-url { color: var(--mdh-muted); font-size: 0.78rem; margin-top: 4px; word-break: break-all; }

/* Check list */
.seo-checks-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mdh-purple);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.seo-checks-title::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--mdh-purple);
  border-radius: 999px;
}

.seo-checks-list { display: flex; flex-direction: column; gap: 8px; }

.seo-check-item {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--mdh-line);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(15,10,30,.04);
  border-left: 3px solid transparent;
}

.seo-check-item.pass  { border-left-color: #22c55e; }
.seo-check-item.warning { border-left-color: #f59e0b; }
.seo-check-item.fail  { border-left-color: #ef4444; }

.seo-check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 1px;
}

.pass .seo-check-icon    { background: #dcfce7; color: #16a34a; }
.warning .seo-check-icon { background: #fef3c7; color: #d97706; }
.fail .seo-check-icon    { background: #fee2e2; color: #dc2626; }

.seo-check-body { flex: 1; min-width: 0; }
.seo-check-label { font-weight: 700; color: var(--mdh-ink); font-size: 0.9rem; margin-bottom: 2px; }
.seo-check-msg { color: var(--mdh-ink-soft); font-size: 0.84rem; line-height: 1.55; }
.seo-check-detail {
  color: var(--mdh-muted);
  font-size: 0.77rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Results → upsell inline ── */
.seo-result-upsell {
  margin-top: 20px;
}

/* ── Hero stat band (inside form card) ── */
.seo-trust-strip {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--mdh-line);
}

.seo-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--mdh-ink-soft);
  font-weight: 600;
}

.seo-trust-item strong {
  color: var(--mdh-purple);
  font-weight: 800;
}

/* ── Category groups ── */
.seo-cat-group { margin-bottom: 8px; }

.seo-cat-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mdh-purple);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 8px;
}
.seo-cat-title::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--mdh-purple);
  border-radius: 999px;
  flex-shrink: 0;
}
.seo-cat-group:first-child .seo-cat-title { margin-top: 0; }

/* ── info status ── */
.seo-check-item.info { border-left-color: #3b82f6; }
.info .seo-check-icon { background: #dbeafe; color: #1d4ed8; }

/* ── Expandable items list ── */
.seo-items-details {
  margin-top: 6px;
}

.seo-items-details summary {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mdh-purple);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
}
.seo-items-details summary::-webkit-details-marker { display: none; }
.seo-items-details summary::before {
  content: "▸";
  font-size: .7rem;
  transition: transform .2s;
}
.seo-items-details[open] summary::before { transform: rotate(90deg); }

.seo-items-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--mdh-line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--mdh-bg);
}

.seo-items-list li {
  font-size: 0.77rem;
  color: var(--mdh-ink-soft);
  line-height: 1.5;
  word-break: break-all;
  padding: 2px 0;
  border-bottom: 1px solid var(--mdh-line);
}
.seo-items-list li:last-child { border-bottom: none; }

@media (max-width: 540px) {
  .seo-hero { padding: 64px 16px 48px; }
  .seo-form-card { padding: 20px 16px 16px; }
  .seo-input-row { flex-direction: column; }
  .seo-submit-btn { width: 100%; }
  .seo-score-card { flex-direction: column; gap: 16px; }
  .seo-results { padding: 0 16px 16px; }
}
