/* ══════════════════════════════════════════
   TOOL UI COMPONENTS
   Shared styles for all diagnostic tools
   ══════════════════════════════════════════ */

/* ── Base tool UI ─────────────────────── */
.tool-ui {
  margin-top: 4px;
}

.tool-input-row {
  display: flex;
  gap: 8px;
}

.tool-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.tool-input:focus {
  border-color: #89008e;
}
.tool-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.tool-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  min-width: 80px;
}
.tool-select option {
  background: #1a1a2e;
  color: white;
}

.tool-textarea {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 12px 14px;
  color: white;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.tool-textarea:focus {
  border-color: #89008e;
}
.tool-textarea::placeholder {
  color: rgba(255,255,255,0.3);
}

.tool-btn {
  background: #89008e;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.tool-btn:hover { background: #70007a; }
.tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tool-btn-accent {
  background: #89008e;
  padding: 12px 24px;
  font-size: 15px;
}

.tool-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
}
.tool-btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.tool-results {
  margin-top: 16px;
}

.tool-error {
  color: #f87171;
  font-size: 14px;
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.tool-error-hint {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  line-height: 1.5;
}
.tool-error-detail {
  margin-top: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

.tool-loading {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  padding: 12px 0;
}

/* ── Resolvers ────────────────────────── */
.tool-resolvers {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.resolver-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

.resolver-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
}
.resolver-check input[type="checkbox"] {
  accent-color: #89008e;
}
.resolver-check:hover {
  color: white;
}

/* ── DNS Lookup Results ───────────────── */
.dns-query-info {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dns-resolver-block {
  margin-bottom: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px;
}

.dns-resolver-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dns-resolver-name {
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.dns-status {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
}
.dns-status.ok { background: rgba(22, 163, 74, 0.15); color: #4ade80; }
.dns-status.warn { background: rgba(217, 119, 6, 0.15); color: #fbbf24; }
.dns-status.fail { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.dns-records {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
}

.dns-record {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dns-record:last-child { border-bottom: none; }

.dns-record-type {
  color: #89008e;
  font-weight: 600;
  min-width: 48px;
  flex-shrink: 0;
}

.dns-record-data {
  color: rgba(255,255,255,0.8);
  word-break: break-all;
  flex: 1;
}

.dns-record-ttl {
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  flex-shrink: 0;
}

.dns-authority-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.3);
  margin-top: 12px;
  margin-bottom: 4px;
}

.dns-authority .dns-record-data {
  color: rgba(255,255,255,0.4);
}

.dns-empty {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

.dns-error {
  font-size: 13px;
}
.dns-error-hint {
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}
.dns-error-detail {
  margin-top: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

/* ── Health Check Results ─────────────── */
.health-loading {
  padding: 20px 0;
}
.health-loading-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.health-loading-bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: #89008e;
  border-radius: 2px;
  animation: health-bar 1.5s ease infinite;
}
@keyframes health-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.health-loading-text {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
}

.health-report {
  margin-top: 4px;
}

.health-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.health-score-ok { background: rgba(22, 163, 74, 0.1); border: 1px solid rgba(22, 163, 74, 0.2); }
.health-score-warn { background: rgba(217, 119, 6, 0.1); border: 1px solid rgba(217, 119, 6, 0.2); }
.health-score-fail { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2); }

.health-score-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.health-score-ok .health-score-icon { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
.health-score-warn .health-score-icon { background: rgba(217, 119, 6, 0.2); color: #fbbf24; }
.health-score-fail .health-score-icon { background: rgba(248, 113, 113, 0.2); color: #f87171; }

.health-score-domain {
  font-size: 18px;
  font-weight: 700;
  color: white;
}
.health-score-label {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.health-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-check {
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.health-check-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.health-check-header i {
  color: #49004c;
  font-size: 16px;
  width: 20px;
  text-align: center;
}
/* Override icon color in dark section */
.tools-section .health-check-header i {
  color: rgba(255,255,255,0.5);
}

.health-check-name {
  font-size: 15px;
  font-weight: 600;
  color: white;
  flex: 1;
}

.health-check-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
}
.health-badge-pass { background: rgba(22, 163, 74, 0.15); color: #4ade80; }
.health-badge-warn { background: rgba(217, 119, 6, 0.15); color: #fbbf24; }
.health-badge-fail { background: rgba(248, 113, 113, 0.15); color: #f87171; }

.health-check-message {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}

.health-check-detail {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}

.health-check-providers {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-family: 'DM Mono', monospace;
}

/* Raw records */
.health-raw {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}
.health-raw summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  user-select: none;
}
.health-raw summary:hover { color: white; }
.health-raw-inner {
  padding: 0 16px 16px;
}
.health-raw-item {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  line-height: 1.5;
}
.health-raw-item code {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  word-break: break-all;
}

/* ── Header Analyzer ──────────────────── */
.header-privacy-note {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-section {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}

.header-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.header-auth-grid {
  display: flex;
  gap: 12px;
}

.header-auth-item {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}
.header-auth-ok { background: rgba(22, 163, 74, 0.1); border: 1px solid rgba(22, 163, 74, 0.2); }
.header-auth-warn { background: rgba(217, 119, 6, 0.1); border: 1px solid rgba(217, 119, 6, 0.2); }
.header-auth-fail { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2); }
.header-auth-none { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); }

.header-auth-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}
.header-auth-result {
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}
.header-auth-ok .header-auth-result { color: #4ade80; }
.header-auth-warn .header-auth-result { color: #fbbf24; }
.header-auth-fail .header-auth-result { color: #f87171; }
.header-auth-none .header-auth-result { color: rgba(255,255,255,0.3); }

.header-info-grid {
  display: grid;
  gap: 6px;
}

.header-info-row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.header-info-label {
  color: rgba(255,255,255,0.4);
  min-width: 100px;
  flex-shrink: 0;
  font-weight: 500;
}

.header-info-value {
  color: rgba(255,255,255,0.75);
  word-break: break-all;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.header-dkim-sig {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}

.header-hops {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-hop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-hop:last-child { border-bottom: none; }

.header-hop-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(137, 0, 142, 0.15);
  color: #89008e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
/* Dark section override */
.tools-section .header-hop-num {
  color: #c580c8;
}

.header-hop-detail { flex: 1; min-width: 0; }

.header-hop-servers {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-hop-arrow { color: rgba(255,255,255,0.3); }

.header-hop-time {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

.header-hop-delay {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.header-hop-delay.fast { color: #4ade80; background: rgba(22, 163, 74, 0.1); }
.header-hop-delay.medium { color: #fbbf24; background: rgba(217, 119, 6, 0.1); }
.header-hop-delay.slow { color: #f87171; background: rgba(248, 113, 113, 0.1); }

/* ── Record Builder ───────────────────── */
.builder-providers {
  margin-top: 12px;
}

.builder-providers-label,
.builder-options-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  margin-bottom: 8px;
}

.builder-provider-option,
.builder-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  margin-right: 16px;
  margin-bottom: 6px;
}
.builder-provider-option:hover,
.builder-radio:hover { color: white; }

.builder-provider-option input,
.builder-radio input { accent-color: #89008e; }

.builder-options {
  margin-top: 12px;
}

.builder-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.builder-record {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px;
}

.builder-record-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.builder-record-type {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #89008e;
  background: rgba(137, 0, 142, 0.1);
  padding: 2px 10px;
  border-radius: 100px;
}
/* Dark section override */
.tools-section .builder-record-type {
  color: #c580c8;
}

.builder-record-host {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.builder-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.builder-copy:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.builder-record-value {
  display: block;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  word-break: break-all;
  line-height: 1.5;
  user-select: all;
}

.builder-dkim-notes {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

.builder-dkim-note {
  margin-bottom: 8px;
}

.builder-note {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  padding: 12px;
  background: rgba(217, 119, 6, 0.05);
  border: 1px solid rgba(217, 119, 6, 0.15);
  border-radius: 8px;
}

/* ── Share button ────────────────────── */
.tool-share {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.tool-share-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-share-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}
.tool-share-btn i { font-size: 12px; }

/* ── Responsive ───────────────────────── */
@media (max-width: 700px) {
  .tool-input-row { flex-wrap: wrap; }
  .tool-resolvers { flex-direction: column; align-items: flex-start; gap: 8px; }
  .header-auth-grid { flex-direction: column; }
  .header-hop-servers { font-size: 11px; }
  .dns-record { flex-wrap: wrap; }
}
