/* =============================================================================
   Marvin Status Dashboard — Terminal Aesthetic
   ============================================================================= */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  --bg: #0a0e14;
  --bg-light: #1a1e24;
  --bg-card: #141820;
  --text: #c5c8c6;
  --text-dim: #6b7280;
  --green: #98c379;
  --green-bright: #50fa7b;
  --red: #e06c75;
  --yellow: #e5c07b;
  --blue: #61afef;
  --purple: #c678dd;
  --cyan: #56b6c2;
  --orange: #d19a66;
  --border: #2a2e34;
}

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

body {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

.terminal {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
}

.terminal-header {
  background: var(--bg-light);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red {
  background: var(--red);
}
.dot.yellow {
  background: var(--yellow);
}
.dot.green {
  background: var(--green);
}

.title {
  color: var(--text-dim);
  margin-left: 12px;
  font-size: 13px;
}

.terminal-body {
  padding: 24px 20px;
}

/* ASCII Art */
.ascii-art pre {
  color: var(--green);
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 8px;
  overflow-x: auto;
}

.tagline {
  color: var(--yellow);
  font-size: 14px;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 32px;
}

/* Sections */
section {
  margin-bottom: 32px;
}

h2 {
  color: var(--green);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

h2::before {
  content: "> ";
  color: var(--text-dim);
}

/* Status */
.status-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 4px;
  border-left: 3px solid var(--text-dim);
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}

.status-box.healthy {
  border-left-color: var(--green);
}
.status-box.warning {
  border-left-color: var(--yellow);
}
.status-box.critical {
  border-left-color: var(--red);
}
.status-box.loading {
  border-left-color: var(--text-dim);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: pulse 2s infinite;
}

.healthy .status-dot {
  background: var(--green-bright);
}
.warning .status-dot {
  background: var(--yellow);
}
.critical .status-dot {
  background: var(--red);
  animation: pulse-fast 0.5s infinite;
}

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

@keyframes pulse-fast {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.info-line {
  padding: 4px 0;
  font-size: 13px;
}

.label {
  color: var(--text-dim);
  margin-right: 8px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--bg-card);
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.metric-label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
}

.metric-bar {
  height: 4px;
  background: var(--bg-light);
  border-radius: 2px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition:
    width 0.5s ease,
    background-color 0.3s;
  width: 0%;
}

.metric-fill.warn {
  background: var(--yellow);
}
.metric-fill.crit {
  background: var(--red);
}

.metrics-extra {
  padding: 8px 0;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.service-item {
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.svc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.service-item.active .svc-dot {
  background: var(--green-bright);
}
.service-item.inactive .svc-dot {
  background: var(--red);
}

/* Chart */
.chart-container {
  background: var(--bg-card);
  border-radius: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

canvas {
  width: 100% !important;
  height: 250px !important;
}

/* Issues */
.issues-box {
  background: var(--bg-card);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 12px;
}

.issue-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.issue-item:last-child {
  border-bottom: none;
}
.issue-item.critical {
  color: var(--red);
}
.issue-item.warning {
  color: var(--yellow);
}

/* Blog */
.blog-box {
  background: var(--bg-card);
  border-radius: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  max-height: 500px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.blog-nav {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-nav a {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

.blog-nav a:hover {
  border-color: var(--cyan);
  text-decoration: none;
}

/* Comms */
.comms-box {
  background: var(--bg-card);
  border-radius: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.peer-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.peer-item:last-child {
  border-bottom: none;
}

.peer-name {
  color: var(--cyan);
}
.peer-status {
  font-size: 11px;
}
.peer-status.alive {
  color: var(--green);
}
.peer-status.dead {
  color: var(--red);
}

/* Footer */
.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
}

.footer p {
  margin-bottom: 4px;
}

.muted {
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 600px) {
  .terminal-body {
    padding: 16px 12px;
  }
  .ascii-art pre {
    font-size: 10px;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric-value {
    font-size: 16px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}
