/* UptimeBrelp - Modern Monitoring Dashboard Stylesheet */
:root {
  --bg-body: #0b1120;
  --bg-surface: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263349;
  --border-color: rgba(148, 163, 184, 0.16);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-primary: #3b82f6;
  --status-up: #10b981;
  --status-degraded: #f59e0b;
  --status-down: #ef4444;
  --status-paused: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

[x-cloak] {
  display: none !important;
}

/* Top Navbar */
.ub-navbar {
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.ub-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Navigation Pills */
.ub-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ub-nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.ub-nav-btn.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}

/* Cards & Panels */
.ub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

/* Anomaly Filter KPI Tiles */
.kpi-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.kpi-filter-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.kpi-filter-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.11);
}

.kpi-filter-card.active-danger {
  border-color: var(--status-down);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.12);
}

.kpi-filter-card.active-warning {
  border-color: var(--status-degraded);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.12);
}

.kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Group Filter Pills */
.group-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.group-pill:hover {
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.35);
}

.group-pill.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: #3b82f6;
  color: #fff;
}

/* Monitor Row / Card */
.monitor-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.monitor-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(148, 163, 184, 0.28);
}

.monitor-row.row-down {
  border-left: 4px solid var(--status-down);
}

.monitor-row.row-degraded {
  border-left: 4px solid var(--status-degraded);
}

.monitor-row.row-up {
  border-left: 4px solid var(--status-up);
}

.monitor-row.row-paused {
  border-left: 4px solid var(--status-paused);
  opacity: 0.72;
}

/* Status Dot & Pulse */
.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.up {
  background-color: var(--status-up);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.degraded {
  background-color: var(--status-degraded);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.status-dot.down {
  background-color: var(--status-down);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  animation: pulseDown 1.6s infinite;
}

.status-dot.paused,
.status-dot.pending {
  background-color: var(--status-paused);
}

@keyframes pulseDown {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.75; }
  100% { transform: scale(1); opacity: 1; }
}

/* Heartbeat Pill Bars */
.heartbeat-strip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
}

.hb-pill {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.hb-pill:hover {
  transform: scaleY(1.28);
}

.hb-pill.up {
  background-color: var(--status-up);
}

.hb-pill.degraded {
  background-color: var(--status-degraded);
}

.hb-pill.down {
  background-color: var(--status-down);
}

.hb-pill.empty {
  background-color: rgba(148, 163, 184, 0.18);
}

/* Badges */
.ub-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.ub-badge-up {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ub-badge-degraded {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.ub-badge-down {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.ub-badge-neutral {
  background: rgba(148, 163, 184, 0.13);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

/* High-Density Table Mode (For Hundreds of Domains) */
.ub-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.ub-table th {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.ub-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  vertical-align: middle;
}

.ub-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Sticky Bulk Action Bar */
.bulk-action-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid #3b82f6;
  border-radius: 14px;
  padding: 0.7rem 1.25rem;
  z-index: 1040;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 95vw;
}

/* Form Controls in Dark UI */
.form-control,
.form-select {
  background-color: #0f172a;
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
  background-color: #0f172a;
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

.form-control::placeholder {
  color: #64748b;
}

/* Modals Overlay */
.ub-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.76);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ub-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.ub-modal-header {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ub-modal-body {
  padding: 1.25rem 1.35rem;
  overflow-y: auto;
}

.ub-modal-footer {
  padding: 0.9rem 1.35rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Minimalist Neutral Landing Page */
.minimal-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(30, 41, 59, 0.45) 0%, #0b1120 70%);
}

/* Toast Notification */
.ub-toast {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 1080;
  min-width: 280px;
  max-width: 420px;
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  background: #1e293b;
  border-left: 4px solid #3b82f6;
  color: #f8fafc;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
  .heartbeat-strip {
    display: none;
  }
  .kpi-value {
    font-size: 1.25rem;
  }
}

