/* graph.css — Styles für die Graph-Ansicht */

#cy {
  width: 100%;
  height: calc(100vh - 130px);
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* ── Breadcrumb im #form-row (dunkler Header) ──────────────── */
.graph-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
}

.graph-bc-item {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.graph-bc-current {
  color: #94a3b8;
}

.graph-bc-link {
  color: #60a5fa;
  cursor: pointer;
  transition: color 0.12s;
}

.graph-bc-link:hover {
  color: #93c5fd;
}

.graph-bc-sep {
  font-size: 11px;
  color: #334155;
  font-weight: 400;
}

/* ── Tooltip ───────────────────────────────────────────────── */
#graph-tooltip {
  position: fixed;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  pointer-events: none;
  z-index: 1000;
  display: none;
  max-width: 200px;
}

#graph-tooltip strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}

#graph-tooltip .tooltip-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Externe Stakeholder */
.tooltip-role-Kunde   { color: #a78bfa; }
.tooltip-role-Nutzer  { color: #93c5fd; }
.tooltip-role-Partner { color: #f9a8d4; }
/* Synthethischer HV-Node */
.tooltip-role-hv      { color: #60a5fa; }
/* Interne Stakeholder */
.tooltip-role-Abteilung { color: #22d3ee; }
.tooltip-role-Rolle     { color: #fcd34d; }

/* ── Modus-Toggle (form-row) ────────────────────────────────── */
.graph-mode-toggle {
  display: flex;
  gap: 4px;
  margin-right: 12px;
}

.graph-mode-btn {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.graph-mode-btn:hover {
  border-color: #475569;
  color: #94a3b8;
}

.graph-mode-btn.active {
  background: #1e293b;
  border-color: #60a5fa;
  color: #60a5fa;
}

/* ── Baum-Ansicht ───────────────────────────────────────────── */
.graph-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
}

.graph-tree-root {
  background: #1e293b;
  border: 2px solid #60a5fa;
  border-radius: 6px;
  color: #60a5fa;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 28px;
}

.graph-tree-drilldown {
  cursor: pointer;
  transition: opacity 0.12s;
}

.graph-tree-drilldown:hover {
  opacity: 0.75;
}

.graph-tree-sep {
  color: #475569;
  font-size: 20px;
  line-height: 1;
  margin: 8px 0;
  user-select: none;
}

.graph-tree-leaves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.graph-tree-leaf {
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 90px;
  padding: 8px 14px;
}

.graph-tree-name {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  text-align: center;
}

.graph-tree-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

/* Leaf-Farben nach Rolle (entspricht den Cytoscape-Node-Farben) */
.graph-tree-leaf-Kunde     { background: #7c3aed; }
.graph-tree-leaf-Nutzer    { background: #1d4ed8; }
.graph-tree-leaf-Partner   { background: #be185d; }
.graph-tree-leaf-Abteilung { background: #0e7490; }
.graph-tree-leaf-Rolle     { background: #b45309; }

/* ── Schichten-Ansicht (7 Spalten: Sh|Dok|K|T|K|Dok|Sh) ─────── */
.graph-layers {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 24px 16px;
  overflow-y: auto;
  position: relative;
}

.graph-layers-col {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  flex: 0 0 120px;
  overflow: hidden;
  padding: 10px;
  width: 120px;
}

.graph-layers-col-t {
}

.graph-layers-col-hd {
  color: #64748b;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
}

.graph-layers-hv-wrap {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.graph-layers-hv {
  background: #1e293b;
  border: 2px solid #60a5fa;
  border-radius: 8px;
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  width: 100%;
}

.graph-layers-cards {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.graph-layers-empty {
  color: #334155;
  font-size: 11px;
}

.graph-layers-card {
  border: 1px solid transparent;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  padding: 5px 8px;
}

.graph-layers-name {
  color: #f8fafc;
  display: block;
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-layers-sub {
  color: rgba(255, 255, 255, 0.6);
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Alle Karten sind klickbar */
.graph-layers-card {
  cursor: pointer;
}

/* Markierte aktive Karte im Pfad */
.graph-layers-card-selected {
  box-shadow: 0 0 0 2px #e879f9, 0 0 8px rgba(232, 121, 249, 0.35);
}

/* Markierte inaktive Karte (noch keine Fähigkeit hinterlegt) */
.graph-layers-card-selected-inactive {
  border: 1px dashed #e879f9;
  box-shadow: 0 0 6px rgba(232, 121, 249, 0.2);
}

/* HV-Karte (T-Spalte) */
.graph-layers-hv-card { background: #2d0a3a; border-color: #e879f9; }
.graph-layers-hv-card .graph-layers-name { color: #e879f9; }

/* Aktive Karten nach Typ */
.graph-layers-sh-Kunde      { background: #7c3aed; }
.graph-layers-sh-Nutzer     { background: #1d4ed8; }
.graph-layers-sh-Partner    { background: #be185d; }
.graph-layers-sh-Abteilung  { background: #0e7490; }
.graph-layers-sh-Rolle      { background: #b45309; }
.graph-layers-doc        { background: #1e3a5f; border-color: #3b82f6; }
.graph-layers-ch         { background: #0c4a4a; border-color: #14b8a6; }

/* Pfad-Reset-Button */
.graph-reset-btn {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  letter-spacing: 0.04em;
  padding: 0 10px;
  transition: border-color 0.1s, color 0.1s;
}
.graph-reset-btn:hover:not(:disabled) {
  border-color: #475569;
  color: #94a3b8;
}
.graph-reset-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

/* Prozessschritt-Button */
.graph-step-btn {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  letter-spacing: 0.04em;
  padding: 0 10px;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.graph-step-btn:hover:not(:disabled) {
  background: #0c1a2e;
  border-color: #60a5fa;
  color: #60a5fa;
}
.graph-step-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

/* ── Prozess-Popup ──────────────────────────────────────────── */
.proc-popup {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  min-width: 320px;
  padding: 14px 16px;
  position: fixed;
  z-index: 500;
}

.proc-popup-row {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.proc-popup-label {
  color: #64748b;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 58px;
}

.proc-popup select,
.proc-popup input[type="text"] {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #f8fafc;
  flex: 1;
  font-family: inherit;
  font-size: 12px;
  height: 28px;
  outline: none;
  padding: 0 8px;
  transition: border-color 0.1s;
}
.proc-popup select:focus,
.proc-popup input[type="text"]:focus {
  border-color: #60a5fa;
}

.proc-popup-newform {
  background: #0c1a2e;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.proc-popup-hint {
  background: #1c1106;
  border: 1px solid #92400e;
  border-radius: 4px;
  color: #fbbf24;
  font-size: 11px;
  margin-bottom: 8px;
  padding: 5px 8px;
}

.proc-popup-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;
}

.proc-popup-save-btn {
  background: #1e3a5f;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  color: #93c5fd;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  letter-spacing: 0.04em;
  padding: 0 12px;
  transition: background 0.1s, color 0.1s;
}
.proc-popup-save-btn:hover {
  background: #1d4ed8;
  color: #eff6ff;
}

.proc-popup-cancel-btn {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  letter-spacing: 0.04em;
  padding: 0 12px;
  transition: border-color 0.1s, color 0.1s;
}
.proc-popup-cancel-btn:hover {
  border-color: #475569;
  color: #94a3b8;
}

/* Speichern-Button */
.graph-save-btn {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  height: 26px;
  letter-spacing: 0.04em;
  padding: 0 10px;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.graph-save-btn:hover:not(:disabled) {
  background: #0c2a1a;
  border-color: #22c55e;
  color: #22c55e;
}
.graph-save-btn:disabled {
  cursor: default;
  opacity: 0.35;
}

/* Shake-Animation (kein Drill-down möglich) */
@keyframes graph-card-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
.graph-layers-card-shake {
  animation: graph-card-shake 0.35s ease;
}

/* Inaktive Karten (kein Capability-Bezug) */
.graph-layers-inactive                    { background: #1e293b; border-color: #334155; }
.graph-layers-inactive .graph-layers-name { color: #475569; }
.graph-layers-inactive .graph-layers-sub  { color: #334155; }
