@import url("https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap");

:root {
  --bg-color: #000000;
  --text-color: #00cc33;
  --text-muted: #008f11;
  --container-bg: rgba(0, 0, 0, 0.8);
  --primary-color: #00cc33;
  --primary-hover: #ffffff;
  --border-color: #008f11;
  --input-bg: #001100;
  --code-bg: #001100;
  --selection-bg: #00cc33;
  --selection-color: #000000;

  --status-open: #00cc33;
  --status-refused: #ff0000;
  --status-timedout: #ffb000;
  --status-unreachable: #ff00ff;
}

html,
body {
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-color);
}

body {
  font-family: "Anonymous Pro", monospace;
  font-size: 1.1rem;
  background: var(--bg-color);
  color: var(--text-color);
  text-shadow: 0 0 2px rgba(0, 204, 51, 0.6);
  line-height: normal;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.06),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.06)
    );
  z-index: 2;
  background-size:
    100% 2px,
    3px 100%;
  pointer-events: none;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

h1,
h2,
h3 {
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

.mt-0 {
  margin-top: 0 !important;
}
.mt-1 {
  margin-top: 1rem !important;
}
.mt-2 {
  margin-top: 2rem !important;
}
.mt-3 {
  margin-top: 3rem !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 1rem !important;
}
.mb-2 {
  margin-bottom: 2rem !important;
}
.mb-4 {
  margin-bottom: 3rem !important;
}

.pl-3 {
  padding-left: 1rem !important;
}

.text-muted {
  color: var(--text-muted) !important;
}
.text-normal {
  font-weight: normal !important;
}
.text-center {
  text-align: center !important;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: 0 0 2px var(--primary-color);
}

.brand a {
  color: inherit;
  text-decoration: none;
}

main {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1000px;
  margin: 1rem auto 0;
  padding: 1rem;
  background: var(--bg-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

section {
  margin-bottom: 1rem;
}

.tos-list li {
  margin-bottom: 0.5rem;
}

input[type="text"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.2rem 0.5rem;
  font-family: "Anonymous Pro", monospace;
  font-size: 1rem;
  line-height: normal;
  outline: none;
  box-shadow: inset 0 0 5px var(--border-color);
}

input[type="text"]:focus {
  border-color: var(--primary-color);
}

button {
  background: var(--border-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Anonymous Pro", monospace;
  line-height: normal;
  cursor: pointer;
  box-shadow: 0 0 5px var(--border-color);
  text-transform: uppercase;
}

button:hover {
  background: var(--primary-hover);
  color: var(--bg-color);
}

button:active {
  background: var(--primary-color);
}

.fixed-control {
  width: 160px !important;
  flex: none;
  text-align: center;
}

.btn-group {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  body {
    padding: 0;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  main {
    padding: 1rem;
  }

  section {
    padding: 1rem 0;
  }

  input[type="text"],
  input[type="number"],
  input.no-arrows,
  button,
  .fixed-control {
    width: 100% !important;
    max-width: none !important;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #map {
    min-height: 300px;
  }
}

.geo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.geo-table th,
.geo-table td {
  padding: 0.25rem 0;
  border-bottom: none;
  text-align: left;
}

.geo-table th {
  color: var(--text-muted);
  font-weight: 400;
  width: 40%;
}

.geo-table td {
  font-weight: 700;
}

input.no-arrows::-webkit-inner-spin-button,
input.no-arrows::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.no-arrows {
  -moz-appearance: textfield;
}

#map {
  flex: 1;
  height: 100%;
  border: 1px solid var(--border-color);
  z-index: 1;
  filter: grayscale(1);
}

pre {
  background: var(--code-bg) !important;
  border: 1px dashed var(--border-color);
  color: var(--text-color);
  padding: 0.5rem;
  font-family: "Anonymous Pro", monospace;
  font-size: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.2);
}

code {
  font-family: "Anonymous Pro", monospace;
  color: var(--primary-color);
}

.status-result {
  margin-top: 1rem;
  font-size: 1rem;
}

.status-open {
  color: var(--status-open);
}
.status-refused {
  color: var(--status-refused);
}
.status-timedout {
  color: var(--status-timedout);
}
.status-unreachable {
  color: var(--status-unreachable);
}
.status-unknown {
  color: var(--text-muted);
}

.status-legend {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: 1rem;
}

.status-legend dt {
  color: var(--text-muted);
}

.status-legend dd {
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: none;
}

.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-block;
}
.htmx-request.htmx-indicator {
  display: inline-block;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
  vertical-align: text-bottom;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
