/* ═══════════════════════════════════════════════════ */
/* System Diagram — Grafana/Kiali-inspired Node Graph  */
/* ═══════════════════════════════════════════════════ */

.swtd-sys-diagram__svg-wrap {
  border: 1px solid var(--swtd-border);
  border-radius: 0.5rem;
  background: var(--swtd-dark);
  overflow: hidden;
}

.swtd-sys-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

/* ─── Service Cards (Services Tab) ───────────────── */
.swtd-svc-card {
  background: var(--swtd-card);
  border: 1px solid var(--swtd-border);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}
.swtd-svc-card:hover { border-color: var(--swtd-muted); }

.swtd-svc-dot {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}

/* ─── API List (APIs Tab) ────────────────────────── */
.swtd-api-group {
  background: var(--swtd-card);
  border: 1px solid var(--swtd-border);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}
.swtd-api-group__header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--swtd-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.swtd-api-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(58, 52, 53, 0.4);
  font-size: 0.8rem;
}
.swtd-api-row:last-child { border-bottom: none; }
.swtd-api-method {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  width: 3.25rem;
  text-align: center;
  padding: 0.15rem 0.25rem;
  border-radius: 0.2rem;
  flex-shrink: 0;
}
.swtd-api-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--swtd-light);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toggle switch (reusable) */
.swtd-toggle {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  background: var(--swtd-input);
  border: 1px solid var(--swtd-border);
  border-radius: 9999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.swtd-toggle.on { background: rgba(34,197,94,0.2); border-color: #22c55e; }
.swtd-toggle.off { background: rgba(239,68,68,0.15); border-color: #ef4444; }
.swtd-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 0.875rem; height: 0.875rem;
  border-radius: 50%;
  background: #666;
  transition: transform 0.2s, background 0.2s;
}
.swtd-toggle.on::after { transform: translateX(0.9rem); background: #22c55e; }
.swtd-toggle.off::after { background: #ef4444; }

/* ─── Manipulation Sliders ───────────────────────── */
.swtd-slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 1rem;
}
.swtd-slider-label {
  font-size: 0.75rem;
  color: var(--swtd-muted);
  width: 5rem;
  flex-shrink: 0;
}
.swtd-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--swtd-border);
  border-radius: 2px;
  outline: none;
}
.swtd-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--swtd-red);
  cursor: pointer;
  border: 2px solid var(--swtd-dark);
}
.swtd-slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--swtd-light);
  width: 3.5rem;
  text-align: right;
  flex-shrink: 0;
}

/* ─── DB Cards (Datenbanken Tab) ─────────────────── */
.swtd-db-card {
  background: var(--swtd-card);
  border: 1px solid var(--swtd-border);
  border-radius: 0.5rem;
  padding: 1rem;
}
.swtd-db-conn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--swtd-muted);
  background: var(--swtd-input);
  padding: 0.375rem 0.625rem;
  border-radius: 0.25rem;
  word-break: break-all;
}
.swtd-sql-input {
  width: 100%;
  background: var(--swtd-input);
  border: 1px solid var(--swtd-border);
  color: var(--swtd-light);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.625rem;
  border-radius: 0.375rem;
  resize: vertical;
  min-height: 4rem;
}
.swtd-sql-input:focus { outline: none; border-color: var(--swtd-red); }

/* ─── Seed buttons ───────────────────────────────── */
.swtd-seed-btn {
  background: var(--swtd-input);
  border: 1px solid var(--swtd-border);
  color: var(--swtd-muted);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.swtd-seed-btn:hover { border-color: var(--swtd-red); color: var(--swtd-light); }
.swtd-seed-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .swtd-api-path { font-size: 0.65rem; }
  .swtd-svc-card { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .swtd-toggle, .swtd-toggle::after { transition: none; }
}
