/* assets/cbdd-ui.css
   CB Domain Diagnostics UI theme (cleaned + theme-resistant)
   - Scoped to .cb-domain-diagnostics so your theme can’t vandalize it
   - Higher-specificity selectors (prefix with .cb-domain-diagnostics) and targeted !important
*/

/* =========================
   Design tokens
========================= */
:root{
  --cb-accent: #873eff;
  --cb-accent-hover: #7c3aed;
  --cb-accent-soft: rgba(135, 62, 255, 0.18);

  --cb-text: #111827;
  --cb-muted: #4b5563;

  --cb-bg: #ffffff;
  --cb-soft: #f8f4ff;

  --cb-border: #e5e5e7;
  --cb-border-2: #edf0f3;

  --cb-shadow: 0 4px 16px rgba(0,0,0,0.04);

  --cb-ok: #16a34a;
  --cb-warn: #ca8a04;
  --cb-bad: #dc2626;

  --cb-ok-bg: #ecfdf5;
  --cb-warn-bg: #fffbeb;
  --cb-bad-bg: #fff1f2;

  --cb-ok-border: #a7f3d0;
  --cb-warn-border: #fde68a;
  --cb-bad-border: #fecdd3;
}

/* =========================
   Root wrapper (reset-ish)
========================= */
.cb-domain-diagnostics{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cb-text) !important;
}

/* Contain theme effects (opacity/filter/transforms sometimes applied to article content) */
.cb-domain-diagnostics,
.cb-domain-diagnostics *{
  box-sizing: border-box;
  opacity: 1 !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Make text readable even if theme sets low-contrast defaults on content wrappers */
.cb-domain-diagnostics p,
.cb-domain-diagnostics li,
.cb-domain-diagnostics span,
.cb-domain-diagnostics div{
  color: inherit;
}

/* Theme-proof form controls inside the tool */
.cb-domain-diagnostics input,
.cb-domain-diagnostics textarea,
.cb-domain-diagnostics select{
  color: var(--cb-text) !important;
  -webkit-text-fill-color: var(--cb-text) !important; /* Safari */
}

.cb-domain-diagnostics input::placeholder,
.cb-domain-diagnostics textarea::placeholder{
  color: var(--cb-muted) !important;
  opacity: 0.85;
}

.cb-domain-diagnostics input[readonly],
.cb-domain-diagnostics textarea[readonly]{
  background: #ffffff;
  border: 1px solid var(--cb-border);
}

/* =========================
   Form card
========================= */
.cb-domain-diagnostics .cbdd-form-wrap{
  margin: 20px 0 24px;
  background: var(--cb-bg);
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--cb-border);
  box-shadow: var(--cb-shadow);
}

.cb-domain-diagnostics .cbdd-form-wrap h2{
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--cb-text);
}

.cb-domain-diagnostics .cbdd-input-row{
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.cb-domain-diagnostics .cbdd-input-row input[type="text"]{
  flex: 1;
  min-width: 240px;
  height: 56px;
  padding: 14px 18px;
  border: 3px solid var(--cb-accent);
  border-radius: 12px;
  font-size: 16px;
  background: var(--cb-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 0 rgba(135,62,255,0.1), 0 2px 8px rgba(135,62,255,0.12);
}

.cb-domain-diagnostics .cbdd-input-row input[type="text"]::placeholder{
  color: #a855f7;
  font-weight: 600;
}

.cb-domain-diagnostics .cbdd-input-row input[type="text"]:focus{
  outline: none;
  border-color: var(--cb-accent-hover);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--cb-accent-soft), 0 4px 12px rgba(135,62,255,0.22);
  transform: translateY(-1px);
}

.cb-domain-diagnostics .cbdd-input-row button{
  height: 56px;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-width: 160px;
  background: var(--cb-accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(135,62,255,0.18);
}

.cb-domain-diagnostics .cbdd-input-row button:hover{
  background: var(--cb-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(135,62,255,0.26);
}

.cb-domain-diagnostics .cbdd-input-row button:active{
  transform: translateY(0);
}

.cb-domain-diagnostics .cbdd-error{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--cb-bad-bg);
  border: 1px solid var(--cb-bad-border);
  color: #9f1239 !important;
  font-size: 13px;
}

/* =========================
   Section cards
========================= */
.cb-domain-diagnostics .cbdd-section{
  margin: 0 0 18px;
  background: var(--cb-bg) !important;
  border: 1px solid var(--cb-border);
  border-radius: 16px;
  box-shadow: var(--cb-shadow);
  padding: 18px 20px;
  position: relative;
}

.cb-domain-diagnostics .cbdd-section h3{
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--cb-text) !important;
}

.cb-domain-diagnostics .cbdd-section hr{
  border: none;
  border-top: 1px solid var(--cb-border);
  margin: 12px 0;
}

/* Key/value rows */
.cb-domain-diagnostics .cbdd-kv{
  margin: 6px 0;
}

.cb-domain-diagnostics .cbdd-label{
  display: inline-block;
  width: 260px;
  font-weight: 700;
  color: var(--cb-muted) !important;
}

.cb-domain-diagnostics .cbdd-section-body{
  margin-top: 10px;
  color: var(--cb-text) !important;
}

/* Status colors */
.cb-domain-diagnostics .cbdd-value-ok{ color: var(--cb-ok) !important; font-weight: 700; }
.cb-domain-diagnostics .cbdd-value-warn{ color: var(--cb-warn) !important; font-weight: 700; }
.cb-domain-diagnostics .cbdd-value-bad{ color: var(--cb-bad) !important; font-weight: 700; }

/* Monospace blocks */
.cb-domain-diagnostics .cbdd-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  background: #f8f9fa;
  border: 1px solid var(--cb-border);
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
  color: var(--cb-text) !important;
  white-space: pre-wrap;
}

/* Lists */
.cb-domain-diagnostics .cbdd-list{
  margin: 8px 0 0 18px;
  padding: 0;
}
.cb-domain-diagnostics .cbdd-list li{
  margin: 4px 0;
  color: var(--cb-text) !important;
}
.cb-domain-diagnostics li::marker{
  color: var(--cb-muted) !important;
}

/* Badges */
.cb-domain-diagnostics .cbdd-badge{
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 800;
  border: 1px solid transparent;
  vertical-align: middle;
}
.cb-domain-diagnostics .cbdd-badge-ok{
  background: var(--cb-ok-bg);
  color: #065f46 !important;
  border-color: var(--cb-ok-border);
}
.cb-domain-diagnostics .cbdd-badge-issues{
  background: var(--cb-bad-bg);
  color: #9f1239 !important;
  border-color: var(--cb-bad-border);
}

/* =========================
   Collapsible sections
========================= */
.cb-domain-diagnostics .cbdd-section-toggle{
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

.cb-domain-diagnostics .cbdd-section-toggle::after{
  content: "▾";
  font-size: 18px;
  opacity: 0.8;
  transition: transform 0.15s ease-out;
  color: var(--cb-muted);
}

.cb-domain-diagnostics .cbdd-section.is-collapsed .cbdd-section-toggle::after{
  transform: rotate(-90deg);
}

.cb-domain-diagnostics .cbdd-section.is-collapsed .cbdd-section-body{
  display: none;
}

/* =========================
   DNS tables (clean + interesting)
   Goal: scannable like a diagnostic tool, but not boring.
========================= */

.cb-domain-diagnostics .cbdd-dns-table-wrap{ margin-top: 2px; }
.cb-domain-diagnostics .cbdd-dns-table-block{ margin-bottom: 2px; }

.cb-domain-diagnostics .cbdd-dns-source-label{
  font-size: 14px;
  font-weight: 800;
  color: var(--cb-muted) !important;
  margin: 10px 0 8px;
}

/* Collapsible resolver block: subtle “Commercebuild-ish” */
.cb-domain-diagnostics .cbdd-dns-details{
  border: 1px solid #d1d5db;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.cb-domain-diagnostics .cbdd-dns-details > summary{
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e5e7eb;
  user-select: none;
  color: var(--cb-text) !important;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-domain-diagnostics .cbdd-dns-details > summary:hover{
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.cb-domain-diagnostics .cbdd-dns-details > summary::-webkit-details-marker{ display: none; }

.cb-domain-diagnostics .cbdd-dns-details > summary::after{
  content: "▸";
  margin-left: auto;
  opacity: 0.75;
  color: var(--cb-muted);
}

.cb-domain-diagnostics .cbdd-dns-details[open] > summary::after{ content: "▾"; }

.cb-domain-diagnostics .cbdd-dns-body{ padding: 5px 8px 8px; }

/* Table: nicer frame + row striping that actually shows */
.cb-domain-diagnostics .cbdd-dns-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

/* Header: subtle gradient + clearer separation */
.cb-domain-diagnostics .cbdd-dns-table th{
  text-align: left;
  padding: 8px 10px;
  font-weight: 850;
  border-bottom: 1px solid #d1d5db;
  color: #111827 !important;
  background: linear-gradient(180deg, #fbfbff 0%, #f3f4f6 100%);
  font-size: 12px;
}

.cb-domain-diagnostics .cbdd-dns-table td{
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  color: #1f2937 !important;
  vertical-align: top;
}

/* Alternating shading: visible but not loud */
.cb-domain-diagnostics .cbdd-dns-table tbody tr:nth-child(odd) td{
  background: #ffffff;
}
.cb-domain-diagnostics .cbdd-dns-table tbody tr:nth-child(even) td{
  background: #f8fafc;
}

/* Hover: mild highlight for scanning */
.cb-domain-diagnostics .cbdd-dns-table tbody tr:hover td{
  background: #eef2ff;
}

/* Type column: badge-like but still “data”, not a button */
.cb-domain-diagnostics .cbdd-dns-table td:first-child{
  font-weight: 900;
  width: 76px;
  white-space: nowrap;
  color: #111827 !important;
}

.cb-domain-diagnostics .cbdd-dns-table td:first-child::before{
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  background: rgba(135, 62, 255, 0.35);
  vertical-align: middle;
}

.cb-domain-diagnostics .cbdd-dns-table td:first-child{
  border-left: 3px solid rgba(135, 62, 255, 0.25);
}

/* Name + Value: monospace, wrapped, easier to read */
.cb-domain-diagnostics .cbdd-dns-name,
.cb-domain-diagnostics .cbdd-dns-value{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: #111827 !important;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Value: a very light tint to guide the eye (not a “pill”) */
.cb-domain-diagnostics .cbdd-dns-value{
  background: rgba(135, 62, 255, 0.06);
  border: 1px solid rgba(135, 62, 255, 0.12);
  border-radius: 10px;
  padding: 6px 8px;
  display: inline-block;
}

/* TTL: muted but legible */
.cb-domain-diagnostics .cbdd-dns-table th:last-child,
.cb-domain-diagnostics .cbdd-dns-table td:last-child{
  text-align: right;
  color: #6b7280 !important;
  font-size: 12px;
  width: 90px;
  white-space: nowrap;
  font-weight: 700;
}

/* Keep last row from having a heavy bottom line */
.cb-domain-diagnostics .cbdd-dns-table tbody tr:last-child td{
  border-bottom: 0;
}

@media (max-width: 640px){
  .cb-domain-diagnostics .cbdd-dns-details > summary{ padding: 12px 14px; }
  .cb-domain-diagnostics .cbdd-dns-body{ padding: 5px 6px 6px; }
}


/* =========================
   Mobile tweaks
========================= */
@media (max-width: 640px){
  .cb-domain-diagnostics .cbdd-form-wrap{ padding: 18px; }
  .cb-domain-diagnostics .cbdd-form-wrap h2{ font-size: 18px; }

  .cb-domain-diagnostics .cbdd-label{
    width: auto;
    display: block;
    margin-bottom: 2px;
  }

  .cb-domain-diagnostics .cbdd-input-row button{
    width: 100%;
    min-width: 0;
  }

  .cb-domain-diagnostics .cbdd-dns-value{
    max-width: 85vw;
  }
}
