/* DNSx — terminál-stílusú sötét felület, emerald paletta */

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #050d0a;
  --panel: #08150f;
  --panel-2: #0b1d14;
  --border: #10362a;
  --border-hi: #1a5540;
  --text: #d0fae5;
  --bright: #ecfdf5;
  --dim: #009966;
  --dimmer: #007a55;
  --accent: #00d492;
  --accent-2: #00bc7d;
  --deep: #002c22;
  --err: #ff6d6d;
  --warn: #ffc861;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  padding: 1.5rem clamp(0.75rem, 3vw, 2.5rem);
}

::selection { background: rgba(0, 188, 125, 0.35); }

/* ---------- CRT hatás: scanline + vignetta + lassú fénypászta ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, 0.28) 0px, rgba(0, 0, 0, 0.28) 1px,
    transparent 1px, transparent 3px);
  opacity: 0.28;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 101;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 212, 146, 0.03) 50%, transparent 100%) no-repeat 0 -30vh / 100% 30vh,
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.32) 100%);
  animation: crtsweep 11s linear infinite;
}

@keyframes crtsweep {
  0%   { background-position: 0 -30vh, center; }
  100% { background-position: 0 130vh, center; }
}

@keyframes crtflicker {
  0%, 91%, 94%, 96%, 100% { opacity: 1; }
  92% { opacity: 0.85; }
  95% { opacity: 0.93; }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

/* ---------- logo / fejléc ---------- */

.logo {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.15;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(0, 212, 146, 0.35);
  user-select: none;
  white-space: pre;
  animation: crtflicker 7s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
}

.bootline {
  color: var(--dim);
  font-size: 12px;
  margin-top: 0.4rem;
  min-height: 1.3em;
}
.bootline .cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto 1.25rem;
}

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  padding-bottom: 0.2rem;
}

.tagline { color: var(--dim); font-size: 12px; }

/* ---------- prompt ---------- */

.prompt-char { font-weight: 500; white-space: nowrap; }
.p-user { color: var(--accent); }
.p-host { color: var(--bright); }
.p-dim  { color: var(--dimmer); }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- űrlapelemek ---------- */

input[type="text"], input[type="password"], select {
  background: var(--deep);
  border: 1px solid var(--border);
  color: var(--bright);
  caret-color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  outline: none;
  min-width: 0;
}
input[type="text"]:focus, input[type="password"]:focus, select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(0, 188, 125, 0.18);
}
input[type="text"] { flex: 1; }
input[type="password"] { flex: 1; }

button, .btn {
  background: var(--panel-2);
  border: 1px solid var(--border-hi);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, .btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 146, 0.2);
}
.btn.primary { background: var(--deep); border-color: var(--accent-2); color: var(--bright); }
.btn.small { padding: 0.1rem 0.5rem; font-size: 12px; }

/* szögletes zárójelek a parancsgombokon */
.btn:not(.small)::before { content: "[ "; color: var(--dimmer); }
.btn:not(.small)::after  { content: " ]"; color: var(--dimmer); }
.btn:not(.small):hover::before, .btn:not(.small):hover::after { color: var(--accent); }

/* ---------- app elrendezés ---------- */

.app { max-width: 1100px; margin: 0 auto; }

.querybar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 0.25rem; margin-top: 1rem; }

.tab {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--dimmer);
  padding: 0.35rem 1rem;
  border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--accent); box-shadow: none; }
.tab.active {
  color: var(--bright);
  background: var(--panel);
  border-color: var(--border);
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 6px;
  padding: 1rem;
  min-height: 200px;
}
.panel.active { display: block; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 12px;
}

.lookup-opts { color: var(--dim); font-size: 12px; }
.lookup-opts select { font-size: 12px; padding: 0.2rem 0.4rem; }

.dim { color: var(--dimmer); }
.hint { color: var(--dim); }

/* ---------- térkép ---------- */

.map-wrap {
  position: relative;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.map-wrap img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.mk {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 12px;
  line-height: 1;
  cursor: default;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}
.mk.idle { color: var(--dimmer); }
.mk.pend { color: var(--dim); animation: blink 0.9s steps(1) infinite; }
.mk.ok   { color: var(--accent); text-shadow: 0 0 8px rgba(0, 212, 146, 0.7); }
.mk.warn { color: var(--warn);   text-shadow: 0 0 8px rgba(255, 200, 97, 0.7); }
.mk.err  { color: var(--err);    text-shadow: 0 0 8px rgba(255, 109, 109, 0.7); }
.mk.origin {
  color: var(--bright);
  font-size: 11px;
  text-shadow: 0 0 10px rgba(236, 253, 245, 0.8);
}

.map-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 11px;
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

/* ---------- zászlók ---------- */

img.flag {
  width: 18px;
  height: 13.5px;
  object-fit: cover;
  vertical-align: -2px;
  border-radius: 2px;
  outline: 1px solid rgba(16, 54, 42, 0.9);
  margin-right: 5px;
}

/* ---------- táblázatok ---------- */

.tbl-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--dim);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.32rem 0.75rem 0.32rem 0;
  border-bottom: 1px solid rgba(16, 54, 42, 0.45);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: rgba(0, 188, 125, 0.06); }

tr.group-row td {
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.8rem;
  border-bottom: none;
}
tbody tr.group-row:hover td { background: transparent; }

@keyframes rowflash {
  from { background: rgba(0, 212, 146, 0.18); }
  to   { background: transparent; }
}
tr.flash td { animation: rowflash 0.7s ease-out 1; }

td.val { color: var(--bright); word-break: break-all; }
td.num { text-align: right; color: var(--dim); white-space: nowrap; }

.status-ok { color: var(--accent); }
.status-warn { color: var(--warn); }
.status-err { color: var(--err); }

.mismatch td.val { color: var(--warn); }

/* ---------- lookup szekciók ---------- */

.rec-section { margin-bottom: 1rem; }

.rec-title {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.rec-title .count { color: var(--dimmer); font-weight: 400; font-size: 11px; }
.rec-title > span:first-child::before { content: "── "; color: var(--dimmer); font-weight: 400; }

.norec { color: var(--dimmer); font-size: 12px; padding: 0.2rem 0; }

/* kattintható IP-k és hosztnevek */
.ip-link, .host-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ip-link:hover, .host-link:hover {
  color: var(--bright);
  background: rgba(0, 188, 125, 0.15);
  border-radius: 2px;
}

/* ---------- futásjelzők ---------- */

.spin { color: var(--dim); animation: blink 0.9s steps(1) infinite; }

.progress-note { color: var(--dim); font-size: 12px; margin-bottom: 0.5rem; }

.cmdline { color: var(--text); display: inline-block; }
.cmdline::first-letter { color: var(--accent); }
.progress { color: var(--dim); white-space: nowrap; font-size: 12px; letter-spacing: -0.5px; }
.progress.status-ok { color: var(--accent); }
.progress.status-warn { color: var(--warn); }

.help {
  color: var(--dimmer);
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
  padding: 0.25rem 0;
}

/* ---------- overlay (fordított lookup) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 6, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10;
}
.overlay.hidden { display: none; }

.overlay-box {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(0, 212, 146, 0.12);
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 1rem;
}
.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--bright);
}

/* ---------- IP info ---------- */

.ipinfo {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ipinfo-fields { flex: 1 1 280px; min-width: 0; }
.ipinfo-fields td:first-child { white-space: nowrap; padding-right: 1rem; }
.ipinfo-map { flex: 1 1 300px; min-width: 0; }
.map-wrap.mini { margin-bottom: 0; }

.mk.pin {
  color: var(--accent);
  font-size: 14px;
  text-shadow: 0 0 10px rgba(0, 212, 146, 0.9);
  animation: blink 1.6s steps(1) infinite;
}

.badge {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.4rem;
  font-size: 11px;
  color: var(--dim);
}
.badge.yes { color: var(--warn); border-color: var(--warn); }

.hint.src { margin-top: 0.4rem; font-size: 11px; }

/* ---------- lábléc ---------- */

.foot {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  font-size: 11px;
  display: flex;
  align-items: stretch;
}
.seg {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 0.18rem 0.7rem;
  color: var(--dim);
}
.seg + .seg { border-left: none; }
.seg-hi {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--deep);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.foot a {
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.08em;
}
.foot a:hover { color: var(--accent); }

@media (max-width: 640px) {
  body { padding: 1rem 0.6rem; }
  .querybar { flex-direction: column; align-items: stretch; }
  .querybar .prompt-char { display: none; }
}
