/* style.css */

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

:root {
  --bg:      #f4f3f0;
  --surface: #ffffff;
  --raised:  #f0efec;
  --text:    #181816;
  --muted:   #6b6b67;
  --hint:    #a0a09b;
  --border:  rgba(0,0,0,0.09);
  --border2: rgba(0,0,0,0.15);
  --r:  8px;
  --rl: 12px;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #141412;
    --surface: #1e1e1c;
    --raised:  #252523;
    --text:    #eeede8;
    --muted:   #8a8a85;
    --hint:    #5a5a56;
    --border:  rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.13);
  }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 5rem;
}

/* sticky header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  margin-bottom: 1.25rem;
  border-bottom: 0.5px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 9px; }

.logo-mark {
  width: 28px; height: 28px;
  background: var(--text);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}

.logo-pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  animation: throb 2s ease-in-out infinite;
}

@keyframes throb {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(0.65); opacity: 0.4; }
}

.logo-text { font-size: 17px; font-weight: 600; letter-spacing: -0.4px; }

.header-right { display: flex; align-items: center; gap: 12px; }

.header-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--hint); font-family: var(--mono); }

.live-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #639922;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

.report-header-btn {
  padding: 6px 14px;
  border-radius: var(--r);
  border: 0.5px solid var(--border2);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.13s;
}
.report-header-btn:hover  { opacity: 0.82; }
.report-header-btn:active { transform: scale(0.97); }

/* search */
.search-wrap { margin-bottom: 1rem; }

.search-wrap input {
  width: 100%;
  padding: 9px 14px;
  border: 0.5px solid var(--border2);
  border-radius: var(--r);
  font-size: 14px;
  font-family: var(--sans);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.13s;
}
.search-wrap input::placeholder { color: var(--hint); }
.search-wrap input:focus { border-color: var(--muted); }

/* filter pills */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.25rem; }

.pill {
  padding: 5px 13px;
  border-radius: 999px;
  border: 0.5px solid var(--border2);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s;
}
.pill:hover  { background: var(--raised); }
.pill.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* summary stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}

.stat-card { background: var(--raised); border-radius: var(--r); padding: 11px 14px; }

.stat-val { font-size: 22px; font-weight: 600; font-family: var(--mono); line-height: 1.2; }

.stat-label { font-size: 11px; color: var(--hint); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px; }

/* banners */
.banner { padding: 9px 14px; border-radius: var(--r); font-size: 13px; margin-bottom: 1rem; border: 0.5px solid; }
.banner-loading { background: var(--raised); border-color: var(--border); color: var(--muted); }
.banner-error   { background: #FCEBEB; border-color: #F7C1C1; color: #A32D2D; }
.banner-info    { background: #E6F1FB; border-color: #B5D4F4; color: #185FA5; }

@media (prefers-color-scheme: dark) {
  .banner-error { background: #2a1010; border-color: #5a2020; color: #F09595; }
  .banner-info  { background: #0d1e30; border-color: #1a3a5c; color: #85B7EB; }
}

/* service cards */
.card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--rl); margin-bottom: 8px; transition: border-color 0.13s; overflow: hidden; }
.card:hover { border-color: var(--border2); }
.card.open  { border-color: var(--border2); }

.card-top { display: flex; align-items: center; gap: 12px; padding: 13px 15px; cursor: pointer; user-select: none; }

.svc-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }

.svc-meta { flex: 1; min-width: 0; }

.svc-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.svc-sub { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 1px; }

.card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* status badges */
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }

.s-ok           { background: #EAF3DE; color: #3B6D11; }
.s-issues       { background: #FAEEDA; color: #854F0B; }
.s-down         { background: #FCEBEB; color: #A32D2D; }
.s-investigating{ background: #E6F1FB; color: #185FA5; }

@media (prefers-color-scheme: dark) {
  .s-ok           { background: #173404; color: #C0DD97; }
  .s-issues       { background: #412402; color: #FAC775; }
  .s-down         { background: #501313; color: #F7C1C1; }
  .s-investigating{ background: #042C53; color: #B5D4F4; }
}

.chevron { color: var(--hint); font-size: 18px; line-height: 1; transform: rotate(90deg); transition: transform 0.18s; display: inline-block; }
.chevron.flip { transform: rotate(-90deg); }

/* spark chart */
.sparks { display: flex; align-items: flex-end; gap: 2px; padding: 0 15px 10px; }
.spark-bar { width: 5px; border-radius: 2px; }
.spark-label { font-size: 10px; color: var(--hint); font-family: var(--mono); margin-left: 6px; align-self: center; }

/* detail panel */
.detail { display: none; border-top: 0.5px solid var(--border); }
.detail.visible { display: block; }

.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 15px; }

.col-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--hint); margin-bottom: 8px; }

.report-line { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 5px; line-height: 1.4; }

.report-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }

.btn-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }

.report-btn { padding: 6px 13px; border: 0.5px solid var(--border2); border-radius: var(--r); background: transparent; color: var(--text); font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: all 0.13s; }
.report-btn:hover  { background: var(--raised); }
.report-btn:active { transform: scale(0.97); }
.report-btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.report-btn.primary:hover { opacity: 0.82; }

.gh-link { display: block; margin-top: 7px; font-size: 12px; color: var(--hint); font-family: var(--mono); text-decoration: none; }
.gh-link:hover { color: var(--muted); }

/* 24h timeline */
.tl-wrap { padding: 0 15px 14px; border-top: 0.5px solid var(--border); }
.tl-wrap .col-head { padding-top: 12px; }
.tl { display: flex; gap: 2px; margin-top: 6px; }
.tl-seg { flex: 1; height: 5px; border-radius: 1px; }
.tl-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--hint); font-family: var(--mono); }

/* misc */
.muted { color: var(--hint); }
.empty { text-align: center; padding: 3rem; color: var(--hint); font-size: 14px; }

.footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 0.5px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--hint); font-family: var(--mono); flex-wrap: wrap; gap: 8px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

@media (max-width: 480px) {
  .stats-row { gap: 8px; }
  .stat-val { font-size: 18px; }
  .detail-cols { grid-template-columns: 1fr; }
  .card-right .badge { display: none; }
  .header-meta { display: none; }
}

/* about button */
.about-header-btn {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border2);
  background: var(--raised);
  color: var(--muted);
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.13s;
}
.about-header-btn:hover { background: var(--hint); color: var(--bg); }
.about-header-btn:active { transform: scale(0.97); }

/* modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: var(--rl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 0.5px solid var(--border);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: -0.3px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--hint);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.13s;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-body p { margin: 0; }
.modal-body strong { color: var(--text); font-weight: 600; }

.about-section { display: flex; flex-direction: column; gap: 6px; }

.about-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hint);
  font-family: var(--mono);
}

.about-statuses {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 10px;
}

.about-status-desc { font-size: 12px; color: var(--muted); }

.about-gh-link {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--hint);
  font-family: var(--mono);
  text-decoration: none;
}
.about-gh-link:hover { color: var(--muted); }
