/* MCP Dashboard - Dark Terminal Theme */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-content h1 {
  font-size: 1.4rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.accent {
  color: var(--accent);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.header-meta {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: var(--border);
  color: var(--text-muted);
}

.badge-green {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.badge-red {
  background: rgba(248, 81, 73, 0.15);
  color: var(--red);
}

/* Main content */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.server-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 3rem;
}

/* Server Card */
.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.server-card:hover {
  border-color: var(--accent);
}

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

.server-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.server-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--border);
  font-size: 1rem;
}

.server-name {
  font-weight: 600;
  font-size: 1rem;
}

.server-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Health status */
.status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 1rem;
}

.status-healthy {
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
}

.status-unhealthy {
  background: rgba(248, 81, 73, 0.12);
  color: var(--red);
}

.status-checking {
  background: rgba(210, 153, 34, 0.12);
  color: var(--yellow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-healthy .status-dot { background: var(--green); }
.status-unhealthy .status-dot { background: var(--red); }
.status-checking .status-dot {
  background: var(--yellow);
  animation: pulse 1.2s ease-in-out infinite;
}

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

/* Server details */
.server-details {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.detail-label {
  color: var(--text-muted);
  min-width: 90px;
}

.detail-value {
  color: var(--text);
}

.detail-value a {
  color: var(--accent);
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

/* Config tabs */
.config-section {
  border-top: 1px solid var(--border);
}

.config-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.config-tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.config-tab:hover {
  color: var(--text);
}

.config-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.config-panel {
  display: none;
  position: relative;
}

.config-panel.active {
  display: block;
}

.config-code {
  display: block;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
  border: none;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: var(--border);
  color: var(--text-muted);
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.copy-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.copy-btn.copied {
  background: var(--green);
  color: var(--bg);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer code {
  font-family: var(--font-mono);
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
}

/* Responsive */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  main {
    padding: 1rem;
  }

  .detail-row {
    flex-direction: column;
    gap: 0.1rem;
  }

  .detail-label {
    min-width: unset;
  }

  .config-code {
    font-size: 0.7rem;
  }
}
