:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #222d44;
  --border-color: #2a374f;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease-in-out;
}

.glass-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

/* Pulsing Status Dot */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.pulse-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}
.pulse-dot.online::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
}

.pulse-dot.offline {
  background-color: var(--accent-red);
}
.pulse-dot.warning {
  background-color: var(--accent-amber);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(0.8); opacity: 0; }
}

/* Terminal / Code stream */
.terminal-stream {
  background: #060911;
  border: 1px solid #1e293b;
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-y: auto;
  max-height: 520px;
}

.terminal-line {
  padding: 6px 12px;
  border-bottom: 1px solid #111a2e;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.15s;
}
.terminal-line:hover {
  background: #0f172a;
}
.terminal-line.outgoing {
  background: rgba(59, 130, 246, 0.05);
}

/* Code block highlighting */
pre.code-sample {
  background: #0d1322;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  font-family: monospace;
  font-size: 13px;
  color: #e2e8f0;
  overflow-x: auto;
  position: relative;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #222e47;
  color: #e5e7eb;
  border: 1px solid var(--border-color);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #2c3a59;
  border-color: #4b5e86;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}
.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.2s ease-in-out;
}
.modal-backdrop.active .modal-window {
  transform: scale(1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

/* Navigation links */
.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
}
.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.nav-tab-btn.active {
  color: #fff;
  background: #1e293b;
  border-bottom: 2px solid var(--accent-cyan);
}
