/* ===================================================
   Cyberwolf Industries NOC Dashboard – style.css
   =================================================== */

/* ── Reset & base ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #21262d;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --accent:      #58a6ff;
  --green:       #3fb950;
  --yellow:      #d29922;
  --red:         #f85149;
  --orange:      #db6d28;
  --radius:      6px;
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:        'Cascadia Code', 'Fira Mono', 'Consolas', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ────────────────────────────────────── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: .75rem; }

.brand-logo {
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.brand-sub {
  font-size: .8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.header-meta {
  font-size: .8rem;
  color: var(--text-muted);
  text-align: right;
}

/* ── Incident banner ───────────────────────────── */
#incident-banner {
  padding: .7rem 0;
  text-align: center;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .02em;
  display: none; /* shown by JS when incident=1 */
}

#incident-banner.no-incident {
  display: block;
  background: #1a2a1a;
  color: var(--green);
  border-bottom: 1px solid var(--border);
}

#incident-banner.active-incident {
  display: block;
  background: #2a1a1a;
  color: var(--red);
  border-bottom: 2px solid var(--red);
}

#incident-banner.maintenance {
  display: block;
  background: #2a2210;
  color: var(--yellow);
  border-bottom: 2px solid var(--yellow);
}

#incident-banner .banner-icon { margin-right: .4rem; }

/* ── Main ──────────────────────────────────────── */
main { padding: 2rem 0 3rem; }

/* ── Section titles ────────────────────────────── */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

/* ── Grid layout ───────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* ── Overall status card ───────────────────────── */
.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.status-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}

.status-indicator.green  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-indicator.yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); animation: none; }
.status-indicator.red    { background: var(--red);   box-shadow: 0 0 8px var(--red); animation: none; }

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

.status-label {
  font-size: 1.15rem;
  font-weight: 600;
}

.status-detail { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Pill badges ───────────────────────────────── */
.pill {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pill-green  { background: #1e3a22; color: var(--green); }
.pill-yellow { background: #2e2a10; color: var(--yellow); }
.pill-red    { background: #2e1410; color: var(--red); }
.pill-blue   { background: #102030; color: var(--accent); }
.pill-gray   { background: var(--surface2); color: var(--text-muted); }

/* ── Data table ────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }

.data-table th,
.data-table td {
  padding: .55rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--surface2);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table td:last-child { color: var(--text-muted); font-family: var(--mono); font-size: .82rem; }

/* ── KV list (contact / info rows) ─────────────── */
.kv-list { list-style: none; }

.kv-list li {
  display: flex;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  flex-wrap: wrap;
}

.kv-list li:last-child { border-bottom: none; }

.kv-key {
  color: var(--text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 120px;
  padding-top: .1rem;
}

/* ── Useful links ──────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .85rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s;
}

.link-card:hover { border-color: var(--accent); text-decoration: none; }

.link-card-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.link-card-desc  { font-size: .78rem; color: var(--text-muted); }

/* ── Maintenance block ─────────────────────────── */
.maintenance-block {
  background: var(--surface2);
  border-left: 3px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .9rem 1rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.maintenance-block + .maintenance-block { margin-top: .75rem; }

/* ── Section spacing ───────────────────────────── */
.section { margin-bottom: 2rem; }

/* ── Footer ────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: .82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── Responsive tweaks ─────────────────────────── */
@media (max-width: 600px) {
  .header-meta { display: none; }
  .status-card { flex-direction: column; align-items: flex-start; }
}
