/* ==========================================================================
   INDEX – public status page styles
   Modern, minimal, clean. Designed to match minimalist screenshot aesthetics.
   ========================================================================== */

/* ----- Layout ----- */
.container {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ----- Header ----- */
header {
  background: transparent;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 840px;
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}
.admin-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 16px;
  border-radius: 20px;
  transition: 0.2s;
}
.admin-link:hover { color: var(--ink); }

/* ----- Main ----- */
main { padding: 0 0 64px; }

/* ----- Status banner (Centered & Minimalist) ----- */
.status-banner {
  background: transparent;
  border: none;
  padding: 64px 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0;
}
.status-indicator-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.status-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.status-subtitle {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-top: 12px;
}

/* Giant status icon replacing the small dot */
.pulse-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}
.pulse-dot.operational {
  background: var(--operational);
  animation: breathe 3s ease-in-out infinite;
}
.pulse-dot.operational::after { content: "✓"; font-weight: bold; }
.pulse-dot.degraded { background: var(--degraded); }
.pulse-dot.degraded::after { content: "!"; font-weight: bold; }
.pulse-dot.down { background: var(--down); }
.pulse-dot.down::after { content: "✕"; font-weight: bold; }
.pulse-dot.maintenance { background: var(--maintenance); }
.pulse-dot.maintenance::after { content: "🔧"; font-size: 20px; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--operational) 30%, transparent); }
  60% { box-shadow: 0 0 0 24px color-mix(in srgb, var(--operational) 0%, transparent); }
}

/* ----- Tabs (Pill style segmented control) ----- */
.tab-nav {
  display: flex;
  width: max-content;
  margin: 0 auto 48px;
  background: var(--surface-sunken);
  padding: 4px;
  border-radius: 30px;
  gap: 4px;
  border: 1px solid var(--border);
}
.tab-btn {
  background: transparent;
  border: none;
  border-radius: 24px;
  padding: 8px 24px;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: 0.2s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ----- Loading / error ----- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-faint);
  padding: 48px 0;
}
.error-state {
  color: var(--down);
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--down) 20%, transparent);
  background: color-mix(in srgb, var(--down) 10%, transparent);
  border-radius: var(--radius);
  text-align: center;
}

/* ----- Groups & cards (Flush & Clean) ----- */
.group-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}
.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.group-name {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.group-toggle {
  font-size: 0.7rem;
  transition: transform 0.2s;
  color: var(--ink-faint);
}
.group-toggle.collapsed { transform: rotate(-90deg); }
.group-count {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  background: transparent;
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
}
.group-container.collapsed .systems-grid { display: none; }

.systems-grid {
  display: flex;
  flex-direction: column;
  gap: 36px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.system-card {
  background: transparent;
  padding: 0;
  position: relative;
}

.system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.system-name {
  font-size: 1rem;
  font-weight: 600;
}

/* Hide legacy status text in favor of sleek UI */
.system-status { display: none; }

.uptime-label {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ----- Modern Uptime Bars ----- */
.uptime-chart-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uptime-chart {
  display: flex;
  gap: 2px;          /* Small gap makes them look cleaner as individual bars */
  height: 26px;
  align-items: flex-end; /* Align bars to the bottom */
  width: 100%;
}

.uptime-bar {
  flex: 1;           /* Allows them to fill space */
  min-width: 4px;    /* Prevents them from becoming invisible lines */
  background: var(--surface-sunken);
  border-radius: 1px;
}

.uptime-bar.operational { background: var(--operational); }
.uptime-bar.degraded { background: var(--degraded); }
.uptime-bar.down { background: var(--down); }
.uptime-bar.maintenance { background: var(--maintenance); }
.uptime-bar.missing { background: var(--border) !important; }

.uptime-bar:hover { opacity: 0.7; }
.uptime-bar::after {
  content: attr(data-date);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.uptime-bar:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.uptime-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ink-faint);
  padding: 0 2px;
}

/* ----- Response chart ----- */
.response-chart {
  margin-top: 16px;
  height: 64px;
  width: 100%;
  position: relative;
}
.response-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.response-chart .y-label {
  font-size: 8px;
  fill: var(--ink-faint);
  font-family: var(--font-mono);
}

/* ----- Incidents & Maintenance ----- */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
}
.incident-list, .maintenance-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.incident-item, .maintenance-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: 0.2s;
}
.incident-item:hover, .maintenance-item:hover {
  background: var(--surface-sunken);
  border-color: var(--border-strong);
}
.incident-header, .maintenance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.incident-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 600;
  flex-wrap: wrap;
}
.incident-date, .maintenance-time {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  margin-top: 6px;
}
.incident-arrow {
  color: var(--ink-faint);
  font-size: 0.7rem;
  transition: transform 0.2s;
  margin-top: 4px;
}
.incident-item.active .incident-arrow { transform: rotate(180deg); }

.incident-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-sunken);
  color: var(--ink);
  border: 1px solid var(--border);
}

.incident-content {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.7;
}
.incident-item.active .incident-content { display: block; animation: fadeIn 0.3s ease; }

.affected-monitors {
  margin-top: 16px;
  font-size: 0.8125rem;
}
.monitor-tag {
  display: inline-block;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  margin: 4px 8px 4px 0;
}
.maintenance-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--surface-sunken);
  color: var(--ink);
  border: 1px solid var(--border);
}
.maintenance-description {
  margin: 12px 0 8px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ----- Modal ----- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.close-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--ink-faint);
  cursor: pointer;
  transition: 0.2s;
}
.close-btn:hover { color: var(--ink); transform: rotate(90deg); }

/* ----- Footer ----- */
footer {
  padding: 32px 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.8125rem;
  margin-top: auto;
  background: transparent;
}

/* ----- Animations ----- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .header-content { height: auto; padding: 16px 0; flex-direction: column; gap: 16px; }
  .status-banner { padding: 40px 0 32px; }
  .status-title { font-size: 1.75rem; }
  .group-container { padding: 20px; }
  .tab-nav { flex-wrap: wrap; }
  .tab-btn { padding: 8px 16px; width: 100%; text-align: center; }
}