/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2E7D32;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #212121;
  --text-secondary: #757575;
  --border: #E0E0E0;
  --radius: 12px;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --grey: #9ca3af;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --surface: #1f2937;
    --text: #f9fafb;
    --text-secondary: #9ca3af;
    --border: #374151;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* === Layout === */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* === Header === */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* === Main Status === */
.status-hero {
  text-align: center;
  padding: 32px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.status-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.healthy { background: var(--green); }
.status-dot.degraded { background: var(--amber); }
.status-dot.unhealthy { background: var(--red); }
.status-dot.loading { background: var(--grey); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.status-label {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.status-label.healthy { color: var(--green); }
.status-label.degraded { color: var(--amber); }
.status-label.unhealthy { color: var(--red); }
.status-label.loading { color: var(--grey); }

.status-meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* === Component Cards === */
.components {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.component-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.component-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.component-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.component-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.component-badge.ok { background: #dcfce7; color: #166534; }
.component-badge.warn { background: #fef3c7; color: #92400e; }
.component-badge.fail { background: #fee2e2; color: #991b1b; }

@media (prefers-color-scheme: dark) {
  .component-badge.ok { background: #14532d; color: #86efac; }
  .component-badge.warn { background: #78350f; color: #fde68a; }
  .component-badge.fail { background: #7f1d1d; color: #fca5a5; }
}

.component-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 2px 0;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* === Refresh Bar === */
.refresh-bar {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 16px;
}

/* === Language Toggle === */
.lang-toggle {
  text-align: center;
  margin-bottom: 16px;
}

.lang-toggle button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
}

.lang-toggle button.active {
  color: var(--primary);
  font-weight: 600;
}

/* === Footer === */
.footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--primary);
}

/* === Loading skeleton === */
.skeleton {
  background: var(--border);
  border-radius: 4px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
