/**
 * ===================================================================
 * status.css — status.gila.ro, in tema node.gila.ro
 * -------------------------------------------------------------------
 */

@font-face {
  font-family: "poppins-medium";
  src: url("fonts/poppins-medium-webfont.woff2") format("woff2"),
       url("fonts/poppins-medium-webfont.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "poppins-semibold";
  src: url("fonts/poppins-semibold-webfont.woff2") format("woff2"),
       url("fonts/poppins-semibold-webfont.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #020604;
  --panel: rgba(4, 16, 11, 0.74);
  --line: rgba(0, 255, 156, 0.16);
  --ink: #d9ffef;
  --muted: rgba(217, 255, 239, 0.5);
  --faint: rgba(217, 255, 239, 0.28);
  --ok: #00ff9c;
  --warn: #ffb547;
  --bad: #ff3b6b;
  --none: rgba(217, 255, 239, 0.12);
  --mono: Consolas, "Courier New", ui-monospace, monospace;
  --c: var(--ok); /* culoarea starii, suprascrisa per element */
}

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

html { background: var(--bg); }
body {
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(0, 255, 156, 0.08), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

[data-status="operational"] { --c: var(--ok); }
[data-status="degraded"],
[data-status="stopped"]     { --c: var(--warn); }
[data-status="down"]        { --c: var(--bad); }
[data-status="unknown"],
[data-status="loading"]     { --c: var(--muted); }

/* ---- fundal ---- */
#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.12;
  pointer-events: none;
}
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0, 255, 156, 0.025) 0 1px, transparent 1px 3px);
}
.top, .wrap, .foot { position: relative; z-index: 2; }

/* ---- header ---- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px 2px rgba(0, 255, 156, 0.7);
}
.back { color: var(--muted); transition: color 0.2s; }
.back:hover, .back:focus-visible { color: var(--ok); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 24px;
}

.prompt {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}
#typed { color: var(--ok); }
.cursor { color: var(--ok); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- starea generala ---- */
.overall {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--c);
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.5s;
}
.overall-heart {
  font-size: 34px;
  line-height: 1;
  color: var(--c);
  text-shadow: 0 0 14px var(--c), 0 0 32px var(--c);
  transition: color 0.5s;
}
.overall[data-status="operational"] .overall-heart { animation: heartbeat 1.4s ease-in-out infinite; }
.overall[data-status="degraded"] .overall-heart,
.overall[data-status="stopped"] .overall-heart     { animation: heartbeat 2.6s ease-in-out infinite; }
.overall[data-status="loading"] .overall-heart     { animation: blink 1.1s steps(1) infinite; }
.overall[data-status="down"] .overall-heart        { text-shadow: 0 0 10px var(--c); }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.3); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.2); }
  56%      { transform: scale(1); }
}

.overall h1 {
  font-family: "poppins-semibold", sans-serif;
  font-weight: normal;
  font-size: clamp(20px, 3.2vw, 28px);
  line-height: 1.25;
  color: #f0fff8;
}
.overall p { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; margin-top: 4px; }

/* ---- carduri servicii ---- */
/* cardurile stau pe acelasi rand cat timp au loc, apoi trec unul sub altul */
.services {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.svc {
  position: relative;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cardIn 0.5s ease-out both;
}
/* colturi de "vizor" in culoarea starii */
.svc::before, .svc::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--c);
  border-style: solid;
  opacity: 0.85;
  transition: border-color 0.5s;
}
.svc::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.svc::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.svc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.svc-head h2 {
  font-family: "poppins-semibold", sans-serif;
  font-weight: normal;
  font-size: 22px;
  line-height: 1.2;
  color: #f0fff8;
}
.svc-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px 12px;
  border: 1px solid var(--c);
  color: var(--c);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.25);
  transition: color 0.5s, border-color 0.5s;
}
.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}
.svc[data-status="operational"] .pill-dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.ecg {
  display: block;
  width: 100%;
  height: 46px;
  margin: 16px 0 6px;
}

.svc-msg { color: var(--c); font-size: 12px; margin-bottom: 4px; }
.svc-msg:empty { display: none; }

/* ---- metrici ---- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.metrics > div {
  background: rgba(2, 8, 5, 0.92);
  border: 1px solid var(--line);
  padding: 10px 12px;
  min-width: 0;
}
.metrics dt {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.metrics dd {
  color: var(--ink);
  font-size: 15px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metrics dd b { color: var(--ok); font-weight: normal; }

.meter {
  display: block;
  height: 3px;
  margin-top: 6px;
  background: var(--none);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}
.meter.warn i { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.meter.bad i  { background: var(--bad);  box-shadow: 0 0 6px var(--bad); }

/* ---- istoric 90 de zile ---- */
.history { margin-top: 18px; }
.history-head, .history-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.history-head b { color: var(--ink); font-weight: normal; letter-spacing: 0.04em; }
.history-foot { margin-top: 6px; letter-spacing: 0.06em; text-transform: none; }

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
  margin-top: 8px;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px;
  background: var(--none);
  transition: transform 0.15s, filter 0.15s;
  cursor: pointer;
}
.bar.ok   { background: var(--ok);   opacity: 0.85; }
.bar.warn { background: var(--warn); }
.bar.bad  { background: var(--bad); }
.bar:hover, .bar.active { transform: scaleY(1.18); filter: brightness(1.3); }

.span-short { display: none; }

.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  padding: 7px 10px;
  border: 1px solid rgba(0, 255, 156, 0.4);
  background: rgba(2, 8, 5, 0.95);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
.tip b { color: var(--c); font-weight: normal; }

/* ---- terminal ---- */
.term {
  margin-top: 26px;
  border: 1px solid var(--line);
  background: rgba(2, 8, 5, 0.85);
}
.term-head {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.refresh-bar { height: 1px; background: var(--line); }
#refresh-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.term-body {
  padding: 10px 14px 12px;
  min-height: 120px;
  font-size: 12px;
  color: var(--muted);
}
.log-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn 0.25s ease-out; }
.log-line:nth-child(n+4) { opacity: 0.6; }
.log-line:nth-child(n+6) { opacity: 0.35; }
.log-time { color: var(--faint); }
.log-line b { color: var(--ok); font-weight: normal; }
.log-line .warn { color: var(--warn); }
.log-line .bad  { color: var(--bad); }
@keyframes logIn {
  from { opacity: 0; transform: translateX(-6px); }
}

/* ---- footer ---- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 24px calc(28px + env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.noscript { text-align: center; padding: 40px; color: var(--warn); position: relative; z-index: 2; }

/* ---- telefon ---- */
@media (max-width: 560px) {
  body { font-size: 13px; }
  .top { padding: 16px 16px 0; }
  .wrap { padding: 26px 16px 18px; }
  .overall { padding: 20px 18px; gap: 16px; }
  .overall-heart { font-size: 28px; }
  .svc { padding: 18px 16px 16px; }
  .svc-head { flex-direction: column; gap: 10px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div { padding: 9px 10px; }
  .metrics dd { font-size: 13px; }
  /* pe ecran ingust aratam ultimele 45 de zile */
  .bar:nth-child(-n+45) { display: none; }
  .span-long { display: none; }
  .span-short { display: inline; }
  .foot { flex-direction: column; padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .overall-heart, .pill-dot, .svc, .log-line { animation: none !important; }
}
