/* ===== Variables ===== */
:root {
  --bg: #05050d;
  --bg2: #0d0d1e;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --green-glow: rgba(16, 185, 129, 0.25);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --red-glow: rgba(239, 68, 68, 0.25);
  --yellow: #f59e0b;
  --yellow-dim: rgba(245, 158, 11, 0.12);
  --yellow-glow: rgba(245, 158, 11, 0.25);
  --blue: #6366f1;
  --blue-dim: rgba(99, 102, 241, 0.12);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }

/* ===== Background ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}
.bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Layout ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ===== Header / Nav ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.logo span { color: var(--text); }
.logo em {
  font-style: normal;
  color: var(--green);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { opacity: 0.85; transform: translateY(-1px); }

/* ===== Hero ===== */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--green-dim);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hero h1 {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 24px;
}
.gradient-text {
  background: linear-gradient(135deg, #10b981 0%, #6366f1 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.7;
  font-weight: 400;
}

/* ===== Main Status Card ===== */
.status-section { padding-bottom: 48px; }

.main-status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 24px;
  transition: border-color 0.4s, background 0.4s;
  position: relative;
  overflow: hidden;
}
.main-status-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.02), transparent 40%);
  pointer-events: none;
}
.main-status-card.status-up {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), var(--card));
}
.main-status-card.status-down {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), var(--card));
}
.main-status-card.status-degraded {
  border-color: rgba(245, 158, 11, 0.25);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), var(--card));
}

/* Status Indicator (pulsing circle) */
.status-indicator {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: pulse-ring 2.5s ease-out infinite;
}
.pulse-ring-2 {
  animation-delay: 0.8s;
}
.pulse-core {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pulse-core svg {
  width: 20px;
  height: 20px;
  color: #fff;
  stroke: #fff;
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Loading spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-indicator.loading { color: var(--text-muted); }
.status-indicator.up { color: var(--green); }
.status-indicator.down { color: var(--red); }
.status-indicator.degraded { color: var(--yellow); }

.status-text { flex: 1; }
.status-text h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.status-text p { color: var(--text-secondary); font-size: 15px; }

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.refresh-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border-color: var(--border-hover);
}
.refresh-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s;
}
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }

/* ===== Components Grid ===== */
.components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.component-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.component-card:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}
.component-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.component-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.15;
}
.component-card.operational .component-dot { background: var(--green); color: var(--green); border-color: var(--green); }
.component-card.degraded .component-dot { background: var(--yellow); color: var(--yellow); }
.component-card.partial .component-dot { background: #fb923c; color: #fb923c; }
.component-card.major .component-dot { background: var(--red); color: var(--red); }
.component-card.maintenance .component-dot { background: var(--blue); color: var(--blue); }

.component-card.operational { border-color: rgba(16,185,129,0.12); }
.component-card.degraded { border-color: rgba(245,158,11,0.15); }
.component-card.partial { border-color: rgba(251,146,60,0.15); }
.component-card.major { border-color: rgba(239,68,68,0.15); }
.component-card.maintenance { border-color: rgba(99,102,241,0.15); }

.component-info { flex: 1; min-width: 0; }
.component-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.component-status {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.last-updated {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.last-updated span { color: var(--text-secondary); }

/* ===== Error state ===== */
.error-state {
  text-align: center;
  padding: 32px;
  color: var(--text-secondary);
}
.error-state p { margin-top: 8px; font-size: 14px; }

/* ===== Info section ===== */
.info-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-dim);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.info-card-icon svg { width: 22px; height: 22px; color: #818cf8; stroke: #818cf8; }
.info-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.info-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ===== CTA Section ===== */
.cta-section {
  padding: 48px 0 80px;
}
.cta-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.1) 50%, rgba(16,185,129,0.08) 100%);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 24px;
  padding: 56px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.12), transparent 70%);
  pointer-events: none;
}
.cta-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 16px;
}
.cta-card h2 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
  line-height: 1.15;
}
.cta-card p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  transition: all 0.25s;
  box-shadow: 0 0 40px rgba(99,102,241,0.3);
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(99,102,241,0.5);
  background: linear-gradient(135deg, #818cf8, #a78bfa);
}
.cta-button svg { width: 18px; height: 18px; stroke: #fff; }

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.footer-logo em { font-style: normal; color: var(--green); }
.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 680px;
}
.footer-disclaimer strong { color: var(--text-secondary); font-weight: 600; }
.footer-disclaimer a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.footer-disclaimer a:hover { color: var(--text); }
.footer-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links a { transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Skeleton loader ===== */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero { padding: 64px 0 48px; }
  .main-status-card {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
    gap: 20px;
  }
  .refresh-btn { align-self: center; }
  .cta-card { padding: 40px 24px; }
  .components-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .hero h1 { letter-spacing: -1px; }
  .components-grid { grid-template-columns: 1fr; }
  .nav-cta { display: none; }
  .info-grid { grid-template-columns: 1fr; }
}
