:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --card-bg: rgba(15, 23, 42, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(56, 189, 248, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow spheres */
.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.sphere-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
  top: -80px;
  left: 10%;
}

.sphere-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
  top: 250px;
  right: 5%;
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Layout container */
.container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.node-logo-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #16a34a, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  color: #ffffff;
}

.node-icon {
  width: 28px;
  height: 28px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.badge-port {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-weight: 600;
  font-size: 0.82rem;
}

.server-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #34d399;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

/* Hero Section */
.hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  box-shadow: var(--shadow-card);
  align-items: center;
}

@media (max-width: 768px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
}

.hero-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.hero-title {
  font-size: 1.85rem;
  font-family: var(--font-code);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  word-break: break-all;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.hero-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1rem;
  font-family: var(--font-code);
  font-weight: 600;
}

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

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

/* Metrics Section */
.metrics-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-3px);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.metric-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box svg {
  width: 20px;
  height: 20px;
}

.metric-icon-box.cyan {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.metric-icon-box.purple {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-purple);
}

.metric-icon-box.emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

.metric-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.metric-row strong {
  font-family: var(--font-code);
  font-weight: 500;
}

/* API Section */
.api-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.api-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.api-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.api-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.api-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-family: var(--font-code);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: 600;
}

.code-terminal {
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-bar {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
  font-size: 0.78rem;
  font-family: var(--font-code);
  color: var(--text-secondary);
}

.terminal-action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.terminal-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.code-terminal pre {
  padding: 1.25rem;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.5;
  color: #38bdf8;
}

/* Quick CLI Guide */
.quick-guide {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.quick-guide h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.cmd-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.cmd-box code {
  font-family: var(--font-code);
  font-size: 0.88rem;
  color: #34d399;
}

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

.app-footer code {
  font-family: var(--font-code);
  color: var(--accent-cyan);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #000000;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
