/* ═══════════════════════════════════════════════════════════════
   H4xX0r Systems — Unified Theme
   Dark 90s hacker aesthetic · Neon green on black · Red accents
   ═══════════════════════════════════════════════════════════════ */

:root {
  --neon: #00ff9c;
  --neon-dim: #00ff9c40;
  --neon-glow: #00ff9c80;
  --red: #ff3c3c;
  --red-dim: #ff3c3c40;
  --amber: #ffbd2e;
  --fg: #d3f9ea;
  --bg: #050a08;
  --card-bg: #0b1511cc;
  --card-border: #1d3a2f;
  --shadow: 0 10px 30px #0008;
}

* { box-sizing: border-box; }
html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
}

/* ── Matrix background ─────────────────────────────────────── */
.parallax {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 70% -10%, #0a2e23 0%, transparent 60%),
    radial-gradient(1200px 600px at 10% 110%, #06231b 0%, transparent 55%),
    #000;
}

canvas#matrix {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 0 6px var(--neon-dim)); opacity: .75;
}

.grid-overlay {
  position: absolute; inset: -100vh 0 0 0;
  background-image:
    linear-gradient(transparent 95%, #0f2 96%),
    linear-gradient(90deg, transparent 95%, #0f2 96%);
  background-size: 100% 24px, 24px 100%;
  opacity: .05; transform: translateZ(0);
}

/* ── Navigation ────────────────────────────────────────────── */
nav.topnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 0;
  padding: 0 12px;
  background: #06120eee;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  font-family: "Share Tech Mono", monospace;
  font-size: .85rem;
  overflow-x: auto;
  scrollbar-width: none;
}

nav.topnav::-webkit-scrollbar { display: none; }

nav.topnav a {
  color: var(--fg); text-decoration: none;
  padding: 12px 14px;
  white-space: nowrap;
  opacity: .7;
  border-bottom: 2px solid transparent;
  transition: opacity .15s, border-color .15s, color .15s;
}

nav.topnav a:hover { opacity: 1; color: var(--neon); }
nav.topnav a.active { opacity: 1; color: var(--neon); border-bottom-color: var(--neon); }

nav.topnav a .lock {
  font-size: .7rem; opacity: .5; margin-left: 4px; vertical-align: super;
}

nav.topnav .nav-brand {
  font-weight: 800; font-size: 1rem; opacity: 1;
  color: var(--neon); margin-right: 8px;
  padding: 10px 10px 10px 4px;
  border-bottom: none;
}

nav.topnav .nav-brand:hover { color: #fff; }

/* ── Header / Hero ─────────────────────────────────────────── */
header {
  min-height: 16vh;
  display: grid; place-items: center;
  text-align: center; padding: 32px 16px 12px;
}

.brand {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--card-border); border-radius: 14px;
  background: #06120e99; backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.brand .logo {
  width: 110px; height: 110px; border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 20px var(--neon-dim), 0 0 20px #00e0ff40;
}

.brand .logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

h1 {
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(32px, 7vw, 72px);
  margin: 6px 0 4px; letter-spacing: 1px;
  text-shadow: 0 0 18px var(--neon-dim);
  position: relative;
}

/* Glitch effect */
h1[data-glitch]::before,
h1[data-glitch]::after {
  content: attr(data-glitch);
  position: absolute; left: 0; right: 0; top: 0;
  color: var(--neon);
  text-shadow: -2px 0 #f0f, 2px 0 #0ff;
  clip-path: inset(0 0 0 0);
  animation: glitch 650ms infinite;
  opacity: .8;
}

h1[data-glitch]::after {
  animation-duration: 900ms; opacity: .6; mix-blend-mode: screen;
}

@keyframes glitch {
  0%   { transform: translate(0) }
  20%  { transform: translate(-2px, 1px) }
  40%  { transform: translate(2px, -1px) }
  60%  { transform: translate(-1px, 2px) }
  80%  { transform: translate(1px, -2px) }
  100% { transform: translate(0) }
}

.subtitle {
  opacity: 0.8; max-width: 820px; margin: 0 auto; line-height: 1.5;
}

/* ── Console block ─────────────────────────────────────────── */
.console-window {
  font-family: "Share Tech Mono", monospace;
  max-width: 1200px; margin: 0 auto 8px;
  border: 1px solid var(--card-border); border-radius: 12px;
  overflow: hidden; background: #030a07cc;
  box-shadow: var(--shadow);
}

.console-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #0a1914cc;
  border-bottom: 1px solid var(--card-border);
}

.console-titlebar .dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  box-shadow: 0 0 8px #0008 inset;
}

.console-titlebar .dot.red    { background: #ff5f56; }
.console-titlebar .dot.yellow { background: #ffbd2e; }
.console-titlebar .dot.green  { background: #27c93f; }
.console-titlebar .title      { margin-left: 6px; opacity: .85; font-size: .9rem; }

.console-output {
  margin: 0; padding: 12px 14px 16px;
  color: #b6ffe0; height: 340px; overflow-y: auto;
  background: repeating-linear-gradient(180deg, #04120d, #04120d 24px, #051712 24px, #051712 48px);
  text-shadow: 0 0 6px #00ff9c40;
  white-space: pre-wrap; word-break: break-word;
  font-size: .85rem; line-height: 1.6;
}

.console-output .cursor {
  display: inline-block; width: 10px;
  background: var(--neon); box-shadow: 0 0 8px var(--neon);
  margin-left: 2px; animation: blink 1s steps(1) infinite;
}

.console-output .cmd  { color: var(--neon); }
.console-output .err  { color: var(--red); }
.console-output .warn { color: var(--amber); }
.console-output .ok   { color: #27c93f; }

@keyframes blink { 50% { opacity: 0; } }

/* ── Main content ──────────────────────────────────────────── */
main {
  max-width: 1200px; margin: 0 auto; padding: 18px 16px 56px;
  flex: 1 0 auto;
}

.sections { display: grid; gap: 28px; }

.section-title {
  font-size: 1rem; letter-spacing: .12em; text-transform: uppercase;
  opacity: .8; margin: 12px 4px;
  font-family: "Share Tech Mono", monospace;
}

.section-title .red { color: var(--red); }

/* ── Card grid ─────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  max-width: 100%;
  gap: 16px;
}

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

a.card {
  position: relative; display: flex; flex-direction: column;
  aspect-ratio: 1 / 1; border-radius: 16px;
  color: inherit; text-decoration: none;
  border: 1px solid var(--card-border); background: var(--card-bg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px #000c;
  border-color: var(--neon);
}

.thumb {
  flex: 1 1 auto;
  background-size: 60%; background-position: center; background-repeat: no-repeat;
  filter: saturate(1.1) contrast(1.05);
}

.card::after {
  content: ""; position: absolute;
  inset: auto -40% -40% auto; width: 120%; height: 120%;
  background: radial-gradient(60% 60% at 100% 100%, var(--neon-dim), transparent 60%);
  opacity: 0; transition: opacity .2s;
}

a.card:hover::after { opacity: 1; }

.meta {
  padding: 10px 12px;
  background: linear-gradient(to top, #0a1914ee 70%, #0a191400);
  text-align: center;
}

.card-title {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 1.1rem;
}

.desc { opacity: .7; font-size: .8rem; margin-top: 2px; }
.ext  { margin-left: auto; opacity: .7; }

/* ── Dashboard ─────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.status-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--card-border); border-radius: 12px;
  background: var(--card-bg);
  font-family: "Share Tech Mono", monospace;
  transition: border-color .15s;
}

.status-card:hover { border-color: var(--neon); }

.status-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.status-dot.healthy  { background: #27c93f; color: #27c93f; }
.status-dot.degraded { background: var(--amber); color: var(--amber); }
.status-dot.offline  { background: var(--red); color: var(--red); }
.status-dot.unknown  { background: #666; color: #666; }
.status-dot.loading  { background: #444; color: #444; animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: .3; }
  50%      { opacity: 1; }
}

.status-info { flex: 1; min-width: 0; }
.status-name { font-size: .95rem; font-weight: 600; color: var(--fg); }
.status-url  { font-size: .75rem; opacity: .5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge {
  font-size: .7rem; padding: 2px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0;
}
.status-badge.healthy  { background: #27c93f20; color: #27c93f; }
.status-badge.degraded { background: #ffbd2e20; color: var(--amber); }
.status-badge.offline  { background: #ff3c3c20; color: var(--red); }
.status-badge.unknown  { background: #66666620; color: #999; }

.dashboard-summary {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 14px 18px;
  border: 1px solid var(--card-border); border-radius: 12px;
  background: var(--card-bg);
  font-family: "Share Tech Mono", monospace;
  font-size: .9rem;
}

.dashboard-summary .stat { display: flex; align-items: center; gap: 6px; }
.dashboard-summary .stat .count { font-weight: 800; font-size: 1.1rem; }

.dashboard-error {
  padding: 16px; border: 1px solid var(--red); border-radius: 12px;
  background: #ff3c3c10; color: var(--red);
  font-family: "Share Tech Mono", monospace; font-size: .85rem;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center; font-size: .85rem; color: #a8e6cf;
  padding: 22px 16px 32px;
  border-top: 1px solid var(--card-border);
  background: #06120e80; backdrop-filter: blur(6px);
  flex-shrink: 0;
  margin-top: auto;
}

footer a { color: inherit; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 520px) {
  .subtitle { padding: 0 6px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  nav.topnav { font-size: .78rem; }
  nav.topnav a { padding: 10px 10px; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}
