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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #1a1a2e;
  color: #eee;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #16213e, #0f3460);
  border-radius: 12px;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: #00d9ff;
}

.subtitle {
  color: #888;
  font-size: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  background: #16213e;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #0f3460;
}

.panel.full-width {
  grid-column: 1 / -1;
}

.panel h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #00d9ff;
  border-bottom: 1px solid #0f3460;
  padding-bottom: 10px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #0f3460;
  padding-bottom: 10px;
}

.panel-header h2 {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.status-indicator {
  margin-bottom: 15px;
}

.status {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status.unknown { background: #444; color: #999; }
.status.healthy { background: #0f5132; color: #75b798; }
.status.unhealthy { background: #842029; color: #ea868f; }
.status.checking { background: #664d03; color: #ffda6a; }

.endpoint {
  font-family: monospace;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #0f3460;
  border-radius: 6px;
}

.endpoint-note {
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
  margin-bottom: 15px;
  padding: 0 4px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

button {
  background: #0f3460;
  color: #00d9ff;
  border: 1px solid #00d9ff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

button:hover {
  background: #00d9ff;
  color: #0f3460;
}

.clear-btn {
  background: transparent;
  color: #888;
  border-color: #444;
}

.clear-btn:hover {
  background: #444;
  color: #eee;
  border-color: #666;
}

.results {
  background: #0a0a1a;
  border-radius: 8px;
  padding: 12px;
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.85rem;
}

.results pre {
  white-space: pre-wrap;
  word-break: break-all;
}

.results .success { color: #75b798; }
.results .error { color: #ea868f; }

.request-log {
  background: #0a0a1a;
  border-radius: 8px;
  padding: 12px;
  min-height: 150px;
  max-height: 400px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.8rem;
}

.log-entry {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #16213e;
  border-left: 3px solid #444;
}

.log-entry.success { border-left-color: #75b798; }
.log-entry.error { border-left-color: #ea868f; }

.log-time {
  color: #666;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.log-method {
  font-weight: bold;
  color: #00d9ff;
}

.log-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 8px;
}

.log-status.ok { background: #0f5132; color: #75b798; }
.log-status.fail { background: #842029; color: #ea868f; }

.log-body {
  margin-top: 8px;
  padding: 8px;
  background: #0a0a1a;
  border-radius: 4px;
  font-size: 0.75rem;
  max-height: 150px;
  overflow-y: auto;
}

.log-empty {
  color: #666;
  text-align: center;
  padding: 40px;
}

/* System Health Panel Styles */
.system-health-panel {
  margin-bottom: 20px;
}

.system-health-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topology-container {
  background: #0a0a1a;
  border-radius: 8px;
  padding: 20px;
}

.topology-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topology-node {
  background: #16213e;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 16px;
  min-width: 140px;
  text-align: center;
  transition: all 0.3s ease;
}

.topology-node.unknown {
  border-color: #444;
}

.topology-node.healthy {
  border-color: #75b798;
  box-shadow: 0 0 10px rgba(117, 183, 152, 0.3);
}

.topology-node.degraded {
  border-color: #ffda6a;
  box-shadow: 0 0 10px rgba(255, 218, 106, 0.3);
}

.topology-node.unhealthy,
.topology-node.unreachable {
  border-color: #ea868f;
  box-shadow: 0 0 10px rgba(234, 134, 143, 0.3);
}

.topology-node.checking {
  border-color: #ffda6a;
  animation: pulse 1s infinite;
}

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

.node-icon {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00d9ff;
  margin-bottom: 8px;
}

.node-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #eee;
  margin-bottom: 4px;
}

.node-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
}

.topology-node.healthy .node-status { color: #75b798; }
.topology-node.degraded .node-status { color: #ffda6a; }
.topology-node.unhealthy .node-status,
.topology-node.unreachable .node-status { color: #ea868f; }
.topology-node.checking .node-status { color: #ffda6a; }

.node-deps {
  font-size: 0.7rem;
  color: #666;
  font-style: italic;
}

.topology-connector {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #444, #00d9ff, #444);
}

.overall-status-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: #0f3460;
  border-radius: 8px;
}

.overall-label {
  font-size: 0.9rem;
  color: #888;
}

.system-health-btn {
  background: #00d9ff;
  color: #0f3460;
  border: none;
  font-weight: 600;
}

.system-health-btn:hover {
  background: #00b8d9;
}

.system-health-btn:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}
