/* ================================================================
 * SiteTrace — Custom styles
 * Built on top of Tailwind CDN. Keep this file lean.
 * ================================================================ */

:root {
  --ink-900: #0a0e1a;
  --ink-800: #0d1424;
  --ink-700: #111a2e;
  --ink-600: #1a2438;
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.10);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Smooth view transitions */
[data-view] {
  animation: viewIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
 * Navigation
 * ================================================================ */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  color: rgb(203 213 225);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 180ms ease;
  white-space: nowrap;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.04); }
.nav-link.is-active {
  color: white;
  background: linear-gradient(135deg, rgba(94,131,255,0.18), rgba(139,92,246,0.18));
  box-shadow: inset 0 0 0 1px rgba(94,131,255,0.25);
}
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  color: rgb(203 213 225);
  transition: all 180ms ease;
}
.nav-icon-btn:hover { color: white; background: rgba(255,255,255,0.04); }

/* Language menu */
.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.9rem;
  color: rgb(226 232 240);
  font-size: 0.85rem;
  transition: background 150ms ease;
}
.lang-option:hover { background: rgba(255,255,255,0.05); }
.lang-option.is-active { color: rgb(180 199 255); background: rgba(94,131,255,0.10); }

/* ================================================================
 * Cards
 * ================================================================ */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 200ms ease;
}
.card:hover { border-color: var(--hairline-strong); }

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(148 163 184);
  margin-bottom: 1rem;
}

.data-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.85rem;
}
.data-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.data-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.data-list dt { color: rgb(148 163 184); flex-shrink: 0; }
.data-list dd { color: rgb(241 245 249); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================
 * Tool cards (landing page)
 * ================================================================ */
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.005));
  text-decoration: none;
  color: inherit;
  transition: all 200ms ease;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(94,131,255,0.08), transparent 50%);
  opacity: 0;
  transition: opacity 200ms ease;
}
.tool-card:hover {
  border-color: rgba(94,131,255,0.35);
  transform: translateY(-3px);
}
.tool-card:hover::before { opacity: 1; }
.tool-card__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 14px -2px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
}
.tool-card__icon svg { width: 1.5rem; height: 1.5rem; }
.tool-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
}
.tool-card__desc {
  font-size: 0.85rem;
  color: rgb(148 163 184);
  line-height: 1.55;
  flex: 1;
  position: relative;
  z-index: 1;
}
.tool-card__cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgb(180 199 255);
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.tool-card:hover .tool-card__cta { color: white; }

/* ================================================================
 * Prose / article content
 * ================================================================ */
.prose-content h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prose-content p { margin-bottom: 1rem; }

.security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.02);
}

/* ================================================================
 * Buttons
 * ================================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #5e83ff 0%, #8b5cf6 100%);
  box-shadow: 0 4px 14px -2px rgba(94, 131, 255, 0.4);
  transition: transform 120ms ease, box-shadow 200ms ease, filter 200ms ease;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 6px 20px -2px rgba(94, 131, 255, 0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(203 213 225);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  transition: all 150ms ease;
}
.btn-ghost:hover { color: white; background: rgba(255,255,255,0.08); border-color: var(--hairline-strong); }

/* ================================================================
 * Status badge
 * ================================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 250ms ease;
}
.status-badge .status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 25%, transparent);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.status-badge--loading {
  color: rgb(148 163 184);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}
.status-badge--protected {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}
.status-badge--exposed {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}
.status-badge--vpn, .status-badge--proxy, .status-badge--tor {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.30);
}

/* Security row pill values */
.pill-yes { color: #6ee7b7; }
.pill-no  { color: #94a3b8; }
.pill-warn{ color: #fcd34d; }

/* ================================================================
 * IP placeholder / loading shimmer
 * ================================================================ */
.ip-placeholder {
  display: inline-block;
  min-width: 3ch;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  border-radius: 0.3rem;
  color: transparent;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
 * Affiliate / recommendation cards
 * ================================================================ */
.aff-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  transition: all 200ms ease;
  color: inherit;
  text-decoration: none;
}
.aff-card:hover {
  border-color: rgba(94, 131, 255, 0.30);
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(94,131,255,0.05), rgba(255,255,255,0.005));
}
.aff-card__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.3);
}
.aff-card__cta {
  margin-top: auto;
  font-size: 0.75rem;
  color: rgb(180 199 255);
  font-weight: 500;
}

/* ================================================================
 * Ad slots removed: AdSense auto-ads injects ads automatically now.
 * (The auto-ads library loaded in <head> handles placement.)
 * ================================================================ */

/* ================================================================
 * Ping view
 * ================================================================ */
.ping-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.02);
  transition: border-color 200ms ease, background 200ms ease;
}
.ping-row:hover { border-color: var(--hairline-strong); }
.ping-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ping-row__name { font-weight: 600; font-size: 0.9rem; }
.ping-row__url  { font-size: 0.7rem; color: rgb(100 116 139); font-family: 'JetBrains Mono', monospace; }
.ping-row__lat  { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.1rem; }
.ping-row__bar  { height: 4px; background: rgba(255,255,255,0.04); border-radius: 2px; overflow: hidden; }
.ping-row__bar > span { display: block; height: 100%; width: 0; border-radius: 2px; transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1), background 250ms ease; }
.ping-row__foot { display: flex; justify-content: space-between; font-size: 0.7rem; color: rgb(100 116 139); }

.ping-lat--ok    { color: #6ee7b7; }
.ping-lat--med   { color: #fcd34d; }
.ping-lat--high  { color: #fca5a5; }
.ping-lat--err   { color: #fca5a5; }
.ping-lat--idle  { color: rgb(100 116 139); }

.ping-bar--ok    { background: linear-gradient(90deg, #10b981, #34d399); }
.ping-bar--med   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ping-bar--high  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ================================================================
 * DNS result rows
 * ================================================================ */
.dns-answer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.55rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  word-break: break-all;
}
.dns-answer__type {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(94,131,255,0.15);
  color: #b6c8ff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* ================================================================
 * Focus ring (a11y)
 * ================================================================ */
:focus-visible {
  outline: 2px solid rgba(94, 131, 255, 0.6);
  outline-offset: 2px;
  border-radius: 0.35rem;
}

/* ================================================================
 * Scrollbar (subtle)
 * ================================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 10px; border: 2px solid var(--ink-900); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ================================================================
 * Reduce motion
 * ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
