/* ============================================================
   Mini-Tools — Analito (mini-tools.css)
   Shared styles for /tools/{slug}/ mini-tool pages
   ============================================================ */

/* ── Page wrapper ─────────────────────────────────────────── */
.minitool-page {
  padding: 100px 0 80px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.minitool__hero {
  padding-bottom: 40px;
  text-align: center;
}
.minitool__h1 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}
.minitool__subtitle {
  font-size: 16px;
  color: #555;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Card ─────────────────────────────────────────────────── */
.minitool__card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

/* ── Input row ────────────────────────────────────────────── */
.minitool__input-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.minitool__input {
  flex: 1;
  width: 100%;
  min-width: 465px;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.minitool__input:focus {
  border-color: var(--primary);
}
.minitool__textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.minitool__textarea:focus {
  border-color: var(--primary);
}
.minitool__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.minitool__form-group {
  margin-bottom: 16px;
}
.minitool__form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Button ───────────────────────────────────────────────── */
.minitool__btn {
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.minitool__btn:hover {
  background: var(--primary-hover);
}
.minitool__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.minitool__btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.minitool__btn--outline:hover {
  background: #EFF6FF;
}
.minitool__btn--copy {
  padding: 8px 16px;
  font-size: 13px;
}

/* ── State: loading / error ───────────────────────────────── */
.minitool__loading {
  display: none;
  text-align: center;
  padding: 40px 0;
  color: #888;
  font-size: 14px;
}
.minitool__loading.visible { display: block; }

.minitool__error {
  display: none;
  padding: 12px 16px;
  background: #FEF2F2;
  border-radius: 8px;
  color: #DC2626;
  font-size: 14px;
  margin-bottom: 16px;
}
.minitool__error.visible { display: block; }

/* ── Result area ──────────────────────────────────────────── */
.minitool__result { display: none; }
.minitool__result.visible { display: block; }

/* ── Section heading ──────────────────────────────────────── */
.minitool__section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 16px;
}

/* ── Status badges ────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  vertical-align: middle;
}
.status-ok   { color: #16A34A; background: #F0FDF4; }
.status-warn { color: #D97706; background: #FFF7ED; }
.status-err  { color: #DC2626; background: #FEF2F2; }

/* ── Result rows ──────────────────────────────────────────── */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
  gap: 16px;
}
.result-row:last-child { border-bottom: none; }
.result-row__label {
  font-size: 14px;
  color: #666;
  flex-shrink: 0;
  min-width: 130px;
}
.result-row__value {
  font-size: 14px;
  color: #1a1a2e;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* ── Issues list ──────────────────────────────────────────── */
.issues-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.issue-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.issue-item--ok   { background: #F0FDF4; color: #166534; }
.issue-item--warn { background: #FFF7ED; color: #92400E; }
.issue-item--err  { background: #FEF2F2; color: #991B1B; }
.issue-item__icon { flex-shrink: 0; font-weight: 700; }

/* ── SERP preview ─────────────────────────────────────────── */
.serp-preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 560px;
}
.serp-preview__url   { font-size: 12px; color: #1a6c00; margin-bottom: 2px; word-break: break-all; }
.serp-preview__title { font-size: 18px; color: #1a0dab; font-weight: 500; margin-bottom: 4px; line-height: 1.3; }
.serp-preview__desc  { font-size: 13px; color: #545454; line-height: 1.5; }

/* ── OG social preview ────────────────────────────────────── */
.og-preview {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  max-width: 520px;
}
.og-preview__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 13px;
}
.og-preview__body { padding: 14px 16px; background: #f6f8fa; }
.og-preview__domain { font-size: 11px; color: #888; text-transform: uppercase; margin-bottom: 4px; }
.og-preview__title  { font-size: 15px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.og-preview__desc   { font-size: 13px; color: #555; }

/* ── Metrics grid ─────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.metric-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.metric-card__label { font-size: 12px; color: #888; }

/* ── TTFB big display ─────────────────────────────────────── */
.ttfb-display {
  text-align: center;
  padding: 32px 0 24px;
}
.ttfb-display__value {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}
.ttfb-display__unit  { font-size: 24px; font-weight: 400; color: #888; }
.ttfb-display__label { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.ttfb-display__desc  { font-size: 14px; color: #888; }
.ttfb-excellent .ttfb-display__value, .ttfb-excellent .ttfb-display__label { color: #16A34A; }
.ttfb-good      .ttfb-display__value, .ttfb-good      .ttfb-display__label { color: #4EA0D2; }
.ttfb-needs_improvement .ttfb-display__value, .ttfb-needs_improvement .ttfb-display__label { color: #D97706; }
.ttfb-poor      .ttfb-display__value, .ttfb-poor      .ttfb-display__label { color: #DC2626; }

/* ── robots.txt raw ───────────────────────────────────────── */
.robots-raw {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 10px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
  overflow-y: auto;
}

/* ── UTM output ───────────────────────────────────────────── */
.utm-output-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.utm-output-text {
  flex: 1;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #1a1a2e;
  line-height: 1.5;
}
.utm-copy-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.utm-copy-btn:hover { background: var(--primary-hover); }

/* ── Char counter bar ─────────────────────────────────────── */
.char-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 6px;
}
.char-bar__fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.15s, background-color 0.15s;
  background: var(--primary);
}
.char-counter {
  font-size: 12px;
  color: #888;
  text-align: right;
  margin-top: 4px;
}
.char-counter.over { color: #DC2626; font-weight: 600; }

/* ── Sitemap URLs table ───────────────────────────────────── */
.url-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.url-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f5f5f5;
  word-break: break-all;
}
.url-table tr:last-child td { border-bottom: none; }
.url-table tr:nth-child(even) td { background: #fafafa; }

/* ── CTA card ─────────────────────────────────────────────── */
.minitool__cta-card {
  background: linear-gradient(135deg, #4EA0D2 0%, #3A7CAA 100%);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 48px 0;
}
.minitool__cta-text { color: #fff; }
.minitool__cta-text strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.minitool__cta-text p { font-size: 14px; opacity: 0.85; max-width: 440px; }
.minitool__cta-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.minitool__cta-btn:hover { opacity: 0.9; color: var(--primary); }

/* ── SEO text block ───────────────────────────────────────── */
.minitool__seo-block {
  padding: 40px 0 8px;
  border-top: 1px solid #f0f0f0;
}
.minitool__seo-block h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 28px 0 10px;
}
.minitool__seo-block h2:first-child { margin-top: 0; }
.minitool__seo-block p {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.minitool__faq { padding: 40px 0 8px; }
.minitool__faq-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 20px;
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .minitool__input-row  { flex-direction: column; }
  .minitool__input      { min-width: 0; width: 100%; }
  .minitool__btn        { width: 100%; text-align: center; }
  .minitool__cta-card   { flex-direction: column; text-align: center; }
  .minitool__form-grid  { grid-template-columns: 1fr; }
  .result-row           { flex-direction: column; align-items: flex-start; }
  .result-row__value    { text-align: left; }
  .ttfb-display__value  { font-size: 48px; }
  .metric-grid          { grid-template-columns: 1fr 1fr; }
}
