/* DNS Lookup — /tools/dnslookup/ (extends ping-tool topology & whois stats) */

/* Topology link label */
.dl-link-type {
  font-size: 11px;
  font-weight: 800;
  color: var(--te-accent);
  font-family: ui-monospace, 'Cascadia Mono', monospace;
  min-height: 16px;
  direction: ltr;
}

/* Quick examples */
.dl-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.dl-example-btn {
  border: 1px solid var(--te-border);
  background: #fff;
  color: #4356a3;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: ui-monospace, 'Cascadia Mono', monospace;
  cursor: pointer;
  direction: ltr;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.dl-example-btn:hover:not(:disabled) {
  border-color: var(--te-accent);
  background: var(--te-accent-dim);
  color: #4356a3;
}

.dl-example-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toolbar */
.dl-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 108px auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: 12px;
  box-sizing: border-box;
}

.dl-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.dl-field-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--te-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dl-toolbar-field .te-input,
.dl-toolbar-field .pt-host-input {
  width: 100%;
  max-width: 100%;
  height: 40px;
  box-sizing: border-box;
  min-width: 0;
  font-size: 13px;
  padding: 0 12px;
}

.dl-select {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--te-border);
  background: #fff;
  color: var(--te-text);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, 'Cascadia Mono', monospace;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dl-select:focus {
  border-color: var(--te-accent);
  box-shadow: 0 0 0 3px rgba(0, 147, 233, 0.12);
}

.dl-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dl-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dl-toolbar-actions .te-btn {
  height: 40px;
  min-width: 0;
  padding: 0 18px;
  font-size: 13px;
  white-space: nowrap;
}

.dl-btn-copy {
  padding: 0 14px !important;
}

/* Stats */
.dl-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0 12px;
}

.dl-stat {
  text-align: center;
  padding: 12px 4px;
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: 10px;
  transition: border-color 0.25s, transform 0.25s;
}

.dl-stat--flash {
  animation: dl-stat-flash 0.45s ease;
}

@keyframes dl-stat-flash {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); border-color: var(--te-accent); }
  100% { transform: scale(1); }
}

.dl-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--te-muted);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.dl-stat-value {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--te-text);
  direction: ltr;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.dl-stat-value--accent { color: var(--te-accent); }
.dl-stat-value--ok { color: #059669; }
.dl-stat-value--warn { color: #d97706; }
.dl-stat-value--fail { color: var(--te-danger); }

.dl-status-line {
  text-align: center;
  font-size: 13px;
  color: var(--te-muted);
  margin-bottom: 14px;
  min-height: 20px;
  line-height: 1.6;
}

.dl-status-line strong {
  color: var(--te-text);
  font-weight: 800;
}

.dl-status-line code {
  font-size: 12px;
  background: rgba(67, 86, 163, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #4356a3;
}

/* Results table */
.dl-results {
  margin-bottom: 14px;
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: 12px;
  overflow: hidden;
}

.dl-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--te-border);
  background: rgba(67, 86, 163, 0.04);
}

.dl-results-title {
  font-size: 13px;
  font-weight: 800;
  color: #4356a3;
}

.dl-results-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--te-muted);
  direction: ltr;
}

.dl-table-wrap {
  overflow: auto;
}

.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dl-table th,
.dl-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--te-border);
}

.dl-table th {
  background: rgba(67, 86, 163, 0.06);
  color: #4356a3;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.dl-table td[data-col="value"],
.dl-table td[data-col="name"] {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, 'Cascadia Mono', monospace;
  word-break: break-all;
}

.dl-table tr:last-child td {
  border-bottom: none;
}

.dl-table tbody tr:hover td {
  background: rgba(67, 86, 163, 0.04);
}

.dl-table-empty td {
  text-align: center !important;
  color: var(--te-muted);
  font-size: 13px;
  padding: 28px 12px !important;
}

.dl-type-badge {
  display: inline-block;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--te-accent-dim);
  color: #4356a3;
  font-weight: 800;
  font-size: 11px;
  text-align: center;
  direction: ltr;
}

/* Raw console (collapsible) */
.dl-raw {
  margin-bottom: 8px;
  border: 1px solid var(--te-border);
  border-radius: 10px;
  background: var(--te-card);
  overflow: hidden;
}

.dl-raw summary {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--te-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}

.dl-raw summary::-webkit-details-marker {
  display: none;
}

.dl-raw summary::before {
  content: '▸';
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.15s;
}

.dl-raw[open] summary::before {
  transform: rotate(90deg);
}

.dl-raw summary:hover {
  color: #4356a3;
  background: rgba(67, 86, 163, 0.04);
}

.dl-console-wrap.pt-console-wrap {
  height: 180px;
  min-height: 180px;
  max-height: 180px;
  margin: 0;
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--te-border);
}

@media (max-width: 640px) {
  .dl-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .dl-toolbar-field--host {
    grid-column: 1 / -1;
  }

  .dl-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .dl-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .dl-stats .dl-stat:nth-child(4),
  .dl-stats .dl-stat:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 420px) {
  .dl-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
