/* Distantec WHOIS page styles. Extracted from index.html for caching and CSP readiness. */
:root {
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #8b5cf6;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
}

body {
  min-height: 100vh;
  display: block;
  align-items: unset;
  justify-content: unset;
  padding: 0 0 4rem;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 40%, rgba(99,102,241,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(139,92,246,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(59,130,246,0.08) 0%, transparent 50%);
  color: var(--text);
}


.mode-desc {
  color: #94a3b8;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
  background: rgba(0,0,0,0.2);
  padding: 0.3rem;
  border-radius: 14px;
  width: fit-content;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
}

.search-box {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.input-box {
  min-width: 0;
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.input-box:focus { border-color: #6366f1; }
.input-box::placeholder { color: #4b5563; }

.btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.9rem 2rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

.result-area {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.5rem;
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #cbd5e1;
}

    /* Toggle button for Structured / Raw view */
    .view-toggle {
      display: none;
      justify-content: flex-end;
      margin-bottom: 0.75rem;
      gap: 0;
      background: rgba(0,0,0,0.2);
      border-radius: 10px;
      padding: 0.2rem;
      width: fit-content;
      margin-left: auto;
    }
    .view-toggle.visible { display: flex; }

    .view-toggle-btn {
      padding: 0.4rem 1rem;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: #94a3b8;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .view-toggle-btn.active {
      background: rgba(129, 140, 248, 0.2);
      color: #818cf8;
    }

    /* Structured WHOIS cards */
    .whois-structured {
      display: none;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    }
    .whois-structured.visible { display: block; }

    .source-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      margin-bottom: 0.85rem;
      padding: 0.35rem 0.7rem;
      border: 1px solid rgba(129, 140, 248, 0.25);
      border-radius: 999px;
      background: rgba(99, 102, 241, 0.12);
      color: #c4b5fd;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }
    .source-badge.rdap {
      border-color: rgba(34, 197, 94, 0.28);
      background: rgba(34, 197, 94, 0.10);
      color: #86efac;
    }
    .source-note {
      display: block;
      margin-top: 0.25rem;
      color: #94a3b8;
      font-size: 0.78rem;
      font-weight: 500;
      text-transform: none;
      letter-spacing: 0;
    }
    .raw-whois {
      margin: 0;
      white-space: pre-wrap;
      word-break: break-word;
      font: inherit;
      color: #cbd5e1;
    }
    .error-message {
      border: 1px solid rgba(248, 113, 113, 0.28);
      border-radius: 14px;
      padding: 1rem 1.1rem;
      background: rgba(248, 113, 113, 0.08);
      color: #fecaca;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      line-height: 1.5;
    }
    .error-message strong {
      display: block;
      margin-bottom: 0.35rem;
      color: #fca5a5;
    }

    .whois-card {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 14px;
      padding: 1rem 1.25rem;
      margin-bottom: 0.75rem;
    }
    .whois-card:last-child { margin-bottom: 0; }

    .whois-card-label {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #818cf8;
      margin-bottom: 0.35rem;
    }
    .whois-card-value {
      font-size: 0.95rem;
      color: #e2e8f0;
      line-height: 1.6;
      word-break: break-word;
    }
    .whois-card-value a {
      color: #818cf8;
      text-decoration: none;
    }
    .whois-card-value a:hover {
      text-decoration: underline;
    }
    .whois-card-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .whois-card-list li {
      padding: 0.2rem 0;
      color: #e2e8f0;
      font-size: 0.93rem;
    }
    .whois-card-list li::before {
      content: '•';
      color: #818cf8;
      margin-right: 0.5rem;
    }

    .whois-status-badge {
      display: inline-block;
      padding: 0.2rem 0.6rem;
      border-radius: 6px;
      font-size: 0.82rem;
      margin: 0.15rem 0.2rem;
      background: rgba(129, 140, 248, 0.15);
      color: #a5b4fc;
      font-family: 'JetBrains Mono', 'Consolas', monospace;
    }

    /* HTTP check result */
    .http-result {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    }
    .http-status-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }
    .http-stat {
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      padding: 0.75rem 1rem;
      flex: 1;
      min-width: 140px;
    }
    .http-stat-label {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #818cf8;
      margin-bottom: 0.3rem;
    }
    .http-stat-value {
      font-size: 1rem;
      color: #e2e8f0;
      font-weight: 600;
      word-break: break-all;
    }
    .http-stat-value.status-ok { color: #4ade80; }
    .http-stat-value.status-redirect { color: #facc15; }
    .http-stat-value.status-error { color: #f87171; }

    .http-redirect-chain {
      margin-top: 0.75rem;
    }
    .http-redirect-chain h4 {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #818cf8;
      margin: 0 0 0.5rem 0;
      font-weight: 700;
    }
    .http-chain-step {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      font-size: 0.9rem;
      color: #cbd5e1;
      word-break: break-all;
    }
    .http-chain-step:last-child { border-bottom: none; }
    .http-chain-arrow {
      color: #818cf8;
      flex-shrink: 0;
      font-size: 1.1rem;
    }
    .http-chain-code {
      font-family: 'JetBrains Mono', 'Consolas', monospace;
      font-weight: 600;
      flex-shrink: 0;
      min-width: 2.5rem;
      text-align: center;
    }

    /* MX note */
    .mx-dns-note {
      background: rgba(129, 140, 248, 0.08);
      border: 1px solid rgba(129, 140, 248, 0.2);
      border-radius: 12px;
      padding: 1rem 1.25rem;
      margin-bottom: 1rem;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      font-size: 0.9rem;
      color: #a5b4fc;
      line-height: 1.5;
    }
    .mx-dns-note a {
      color: #818cf8;
      font-weight: 600;
      text-decoration: none;
    }
    .mx-dns-note a:hover { text-decoration: underline; }

    ::-webkit-scrollbar { width: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


.result-area.normal-wrap { white-space: normal; }
.result-area.pre-wrap { white-space: pre-wrap; }
.whois-card-link { margin-top: 0.3rem; font-size: 0.85rem; }
.whois-card-muted { margin-top: 0.25rem; font-size: 0.85rem; color: #94a3b8; }
.whois-card-label-spaced { margin-top: 0.75rem; }
.whois-empty-note { color: #94a3b8; font-style: italic; }


@media (max-width: 600px) {
  .search-box { flex-direction: column; }
  .btn { width: 100%; text-align: center; }
  .tabs { width: 100%; }
  .tab-btn { flex: 1; padding-left: 0.6rem; padding-right: 0.6rem; }
}


/* Local visibility utility; avoids stale cached /css/common.css keeping loaders visible. */
.is-hidden { display: none !important; }
