/* ── Shared Tool Pages (WHOIS + DNS) ────────────────────────── */

body.dark-page { background: #090e1a; }

/* Tool Hero */
.tool-hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 70px;
  background: #090e1a;
  text-align: center;
}
.tool-hero__glow {
  position: absolute;
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,174,239,0.1) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tool-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  position: relative;
}
.tool-hero p {
  color: rgba(255,255,255,0.55);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Tool section */
.tool-section {
  background: #0d1117;
  min-height: 60vh;
  padding: 60px 0 100px;
}

/* Tool Card */
.tool-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}
.tool-card__header {
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-card__header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.tool-card__body { padding: 28px; }

/* Tool input row */
.tool-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.tool-input-row .form-group { flex: 1; margin: 0; }
.tool-input-row .form-group label {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  margin-bottom: 6px;
  display: block;
}
.tool-input-row input,
.tool-input-row select {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #fff !important;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
}
.tool-input-row input::placeholder { color: rgba(255,255,255,0.25) !important; }
.tool-input-row input:focus,
.tool-input-row select:focus {
  border-color: rgba(0,174,239,0.5) !important;
  background: rgba(0,174,239,0.05) !important;
  outline: none;
}
.tool-input-row select option { background: #0d1117; color: #fff; }

/* Submit button */
.btn-tool {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-tool:hover { background: #0095cc; }
.btn-tool:active { transform: scale(0.97); }
.btn-tool:disabled { opacity: 0.6; cursor: not-allowed; }

/* Spinner */
.tool-spinner {
  display: none;
  margin: 40px auto;
  text-align: center;
}
.tool-spinner.visible { display: block; }
.spinner-ring {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tool-spinner p { color: rgba(255,255,255,0.45); font-size: 0.88rem; }

/* Results container */
.tool-results { margin-top: 32px; }
.tool-results.hidden { display: none; }

/* Error message */
.tool-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px;
  padding: 16px 20px;
  color: #fca5a5;
  font-size: 0.9rem;
}

/* Rate limit / info message */
.tool-info {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px;
  padding: 16px 20px;
  color: #fcd34d;
  font-size: 0.9rem;
}

/* Cache badge */
.cache-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}

/* ── WHOIS Results ───────────────────────────────────────────── */
.whois-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.whois-field {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 16px;
}
.whois-field__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
}
.whois-field__value {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  word-break: break-all;
  line-height: 1.5;
}
.whois-field__value a { color: var(--primary); text-decoration: none; }
.whois-field__value a:hover { text-decoration: underline; }
.whois-field--wide { grid-column: 1 / -1; }

/* Expiry color coding */
.expiry-green { color: #34d399 !important; }
.expiry-yellow { color: #fcd34d !important; }
.expiry-red { color: #f87171 !important; }

/* Status badges */
.status-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.status-badge {
  background: rgba(0,174,239,0.08);
  border: 1px solid rgba(0,174,239,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 100px;
}

/* Nameservers list */
.ns-list { list-style: none; padding: 0; margin: 0; }
.ns-list li {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  padding: 2px 0;
  font-family: 'JetBrains Mono', monospace;
}

/* Raw WHOIS toggle */
.raw-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 0.2s, color 0.2s;
}
.raw-toggle:hover { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.75); }
.raw-whois {
  display: none;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}
.raw-whois.visible { display: block; }

/* ── DNS Propagation Results ─────────────────────────────────── */
.dns-status-bar {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dns-status-bar.propagated { border-color: rgba(52,211,153,0.3); background: rgba(52,211,153,0.06); }
.dns-status-bar.partial    { border-color: rgba(251,146,60,0.3);  background: rgba(251,146,60,0.06); }
.dns-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dns-status-dot.green  { background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,0.5); }
.dns-status-dot.orange { background: #fb923c; box-shadow: 0 0 8px rgba(251,146,60,0.5); }
.dns-status-bar p { margin: 0; font-size: 0.88rem; color: rgba(255,255,255,0.7); }
.dns-status-bar strong { color: #fff; }

/* DNS table — desktop */
.dns-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid rgba(255,255,255,0.07); }
.dns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.dns-table thead th {
  background: rgba(255,255,255,0.05);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}
.dns-table tbody td {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.75);
  vertical-align: top;
}
.dns-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.dns-resolver-name { font-weight: 600; color: #fff; }
.dns-resolver-ip { font-size: 0.72rem; color: rgba(255,255,255,0.3); font-family: monospace; }
.dns-record { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; word-break: break-all; }
.dns-record-line { display: block; margin-bottom: 4px; }
.dns-ttl { color: rgba(255,255,255,0.4); font-size: 0.82rem; }
.dns-status-icon { font-size: 1.1rem; }
.dns-status-ok    { color: #34d399; }
.dns-status-empty { color: rgba(255,255,255,0.25); }

/* DNS stacked cards on mobile */
.dns-cards { display: none; }

/* Turnstile widget spacing */
.turnstile-wrap { margin-top: 16px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tool-input-row { flex-direction: column; gap: 12px; }
  .tool-input-row .btn-tool { width: 100%; justify-content: center; }
  .whois-grid { grid-template-columns: 1fr; }
  .whois-field--wide { grid-column: 1; }

  /* Switch DNS table to cards on mobile */
  .dns-table-wrap { display: none; }
  .dns-cards { display: flex; flex-direction: column; gap: 10px; }
  .dns-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 16px;
  }
  .dns-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  .dns-card__label { display: flex; align-items: center; gap: 6px; }
  .dns-card__dot { width: 8px; height: 8px; border-radius: 50%; }
  .dns-card__records { font-family: monospace; font-size: 0.82rem; color: rgba(255,255,255,0.65); }
  .dns-card__meta { font-size: 0.75rem; color: rgba(255,255,255,0.3); margin-top: 6px; }
}

@media (max-width: 480px) {
  .tool-hero h1 { font-size: 1.6rem; }
  .tool-card__body { padding: 18px 16px; }
}
