/* DNS Lookup tool – styles used only by dns-lookup.html.
   Builds on style.css (variables, .panel, .btn, .table-scroll, .compare-table, .sr-only). */

.dns-tool {
  max-width: 64rem;
  margin: 0 auto 1.75rem;
  color-scheme: dark;
}

.dns-intro {
  color: #d6def2;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

/* Form */
.dns-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 13rem) auto;
  gap: 1rem;
  align-items: end;
}

.dns-field { display: grid; gap: 0.4rem; min-width: 0; }

.dns-field label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.dns-input {
  font: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  min-height: 3rem;
  width: 100%;
}

.dns-input::placeholder { color: #6f82ad; }

.dns-input:focus-visible,
.dns-tool .table-scroll:focus-visible,
.dns-tool .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dns-input[aria-invalid="true"] { border-color: #ff9a9a; }

.dns-form .btn { min-height: 3rem; }

.dns-error {
  margin-top: 0.75rem;
  color: #ff9a9a;
  font-weight: 600;
}
.dns-error[hidden] { display: none; }

.dns-hint {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Status line (also the live region) */
.dns-status {
  margin-top: 1rem;
  padding: 0;
  color: #d6def2;
  line-height: 1.5;
}
.dns-status:empty { display: none; }
.dns-status[data-state="info"],
.dns-status[data-state="loading"],
.dns-status[data-state="success"],
.dns-status[data-state="error"] {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(77, 163, 255, 0.1);
}
.dns-status[data-state="success"] { border-left-color: #3ddc97; background: rgba(61, 220, 151, 0.1); }
.dns-status[data-state="error"] { border-left-color: #ff6b6b; background: rgba(255, 107, 107, 0.1); }

.dns-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.55rem;
  vertical-align: -0.15em;
  border: 2px solid var(--card-edge);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dns-spin 0.8s linear infinite;
}
@keyframes dns-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .dns-spinner { animation: none; border-top-color: var(--card-edge); border-right-color: var(--accent); }
}

/* Results */
.dns-results {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-edge);
}
.dns-results[hidden] { display: none; }

.dns-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.dns-results-head h2 { margin: 0; font-size: 1.3rem; }

.dns-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.dns-notice {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.dns-groups { margin-top: 1.25rem; }
.dns-group + .dns-group { margin-top: 1.5rem; }

.dns-group h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.dns-badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--muted);
}
.dns-badge[data-kind="ok"] { color: #3ddc97; border-color: #3ddc97; }
.dns-badge[data-kind="warn"] { color: #ffcc66; border-color: #ffcc66; }
.dns-badge[data-kind="error"] { color: #ff9a9a; border-color: #ff9a9a; }
.dns-badge[data-kind="loading"] { color: var(--accent); border-color: var(--accent); }

.dns-note {
  color: #d6def2;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.dns-note + .dns-note,
.table-scroll + .dns-note,
.dns-note + .table-scroll { margin-top: 0.6rem; }

.dns-note-small { font-size: 0.88rem; color: var(--muted); }

/* Table (extends .compare-table) */
.dns-table td { overflow-wrap: anywhere; word-break: break-word; }
.dns-table th:nth-child(3),
.dns-table td:nth-child(3) { white-space: nowrap; }

.dns-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; }

.dns-fields {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.2rem 0.85rem;
  margin: 0;
}
.dns-fields dt { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.dns-fields dd { margin: 0; }

/* Explanation content below the tool */
.dns-explainer { max-width: 64rem; }
.dns-explainer h3 { margin-top: 1.1rem; }
.dns-explainer h3:first-child { margin-top: 0; }

@media (max-width: 720px) {
  .dns-form { grid-template-columns: 1fr; }
  .dns-form .btn { width: 100%; }
  .dns-results-head .btn { width: 100%; }
}
