/* Ekalix - the MySQL pages and their replication map.   web\mysqlview.css   (CONTRACT-V29 M)
 *
 * Every class here starts with myv- (the map) or myp- (the pages), so nothing can collide with
 * styles.css or another module. Every colour is one of the product's own custom properties, so all
 * five themes work without a line of their own: surfaces and text from the theme, severities
 * through the .t-* tone classes (--tone, --tone-bg, --tone-bd) that styles.css defines.
 *
 * The map reads standing still: lines, colours, glyphs and words carry the meaning. The dots that
 * flow along a running line are invisible unless their animation really runs, because a still dot
 * reads as traffic too (mongoview.css says the same of its particles): they run only when the
 * reader allows motion - data-motion="on", or no reduced-motion request and not data-motion="off".
 */

/* ---------- the pages ---------------------------------------------------------------------------- */

.myp-q { display: inline-block; max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.myp-names { display: flex; flex-wrap: wrap; gap: 6px; }
.myp-names .tagc.t-serious, .myp-names .tagc.t-warning { border-color: var(--tone-bd); background: var(--tone-bg); }

/* ---------- the replication map: the panel ------------------------------------------------------ */

.myv {
  position: relative;
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px 18px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  box-shadow: var(--shadow);
  color: var(--text);
  font-family: var(--font);
}
/* The haze behind the picture takes the topology's tone: red when replication stopped, a faint
   green when all is well. Quiet by design - the servers should draw the eye. */
.myv::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px 220px at 50% 55%, var(--tone-bg), transparent 72%);
  opacity: .85;
}
.myv.t-ok::before, .myv.t-info::before { opacity: .4; }
.myv > * { position: relative; }
.myv.is-compact { padding: 10px 12px; }

.myv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
.myv-titles { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 auto; }
.myv-kicker {
  flex: 0 0 auto;
  font: 700 var(--fs-micro)/1 var(--font);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.myv-name { min-width: 0; font: 700 15px/1.15 var(--font); color: var(--text); }
.myv-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.myv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.25;
}
.myv-chip[class*=" t-"] { border-color: var(--tone-bd); background: var(--tone-bg); }
.myv-chip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.myv-chip i { flex: 0 0 auto; font-style: normal; color: var(--tone); font-weight: 800; }
.myv-said { margin-top: 6px; font-size: var(--fs-small); color: var(--text-3); line-height: 1.45; }

/* ---------- the picture ---------------------------------------------------------------------------- */

.myv-svg { display: block; width: 100%; height: auto; max-height: 520px; margin-top: 8px; overflow: visible; }
.myv-svg text { font-family: var(--font); }
.myv-links, .myv-nodes { pointer-events: none; }

.myv-base { stroke: var(--tone); stroke-opacity: .55; stroke-width: 2; stroke-linecap: round; }
.myv-link.t-muted .myv-base { stroke: var(--text-3); stroke-opacity: .45; stroke-dasharray: 4 5; }
.myv-link.is-ghost .myv-base { stroke-dasharray: 2 6; stroke-opacity: .35; }
.myv-link.is-broken .myv-base { stroke: var(--critical); stroke-opacity: .85; stroke-dasharray: 6 5; }
.myv-x circle { fill: var(--surface-1); stroke: var(--critical); stroke-width: 1.4; }
.myv-x path { fill: none; stroke: var(--critical); stroke-width: 1.6; stroke-linecap: round; }
.myv-lag {
  font-size: var(--fs-small);
  font-weight: 700;
  fill: var(--tone);
  paint-order: stroke;
  stroke: var(--surface-1);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.myv-link.t-ok .myv-lag { fill: var(--text-2); }

/* the changes on their way: dots, one period of the dash pattern per loop, so the loop is seamless */
.myv-flow {
  stroke: var(--tone);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: .1 16;
  opacity: 0;
  filter: drop-shadow(0 0 3px var(--tone-bd));
}
@keyframes myv-flow { from { stroke-dashoffset: 16.1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="off"]) .myv-flow { opacity: .95; animation: myv-flow 1.1s linear infinite; }
  :root:not([data-motion="off"]) .myv-flow.is-mid { animation-duration: 2.2s; }
  :root:not([data-motion="off"]) .myv-flow.is-slow { animation-duration: 4s; }
  :root:not([data-motion="off"]) .myv-node.is-self .myv-halo { animation: myv-breathe 3s ease-in-out infinite; }
}
:root[data-motion="on"] .myv-flow { opacity: .95; animation: myv-flow 1.1s linear infinite; }
:root[data-motion="on"] .myv-flow.is-mid { animation-duration: 2.2s; }
:root[data-motion="on"] .myv-flow.is-slow { animation-duration: 4s; }
:root[data-motion="on"] .myv-node.is-self .myv-halo { animation: myv-breathe 3s ease-in-out infinite; }
@keyframes myv-breathe { 0%, 100% { opacity: .1; } 50% { opacity: .24; } }

/* ---------- the servers ------------------------------------------------------------------------------ */

.myv-halo { fill: var(--tone); opacity: .14; }
.myv-body { fill: var(--tone); stroke: var(--bg); stroke-width: 1.2; filter: drop-shadow(0 0 4px var(--tone-bd)); }
.myv-node.is-self .myv-body { filter: drop-shadow(0 0 9px var(--tone-bd)); }
.myv-node.t-serious .myv-body, .myv-node.t-critical .myv-body { filter: drop-shadow(0 0 6px var(--tone)); }
/* nobody there: a hollow, dashed ring */
.myv-node.is-ghost .myv-body, .myv-node.t-muted .myv-body {
  fill: var(--surface-1);
  stroke: var(--text-3);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
  filter: none;
}
.myv-node.is-more .myv-body { fill: var(--surface-3); stroke: var(--text-3); stroke-dasharray: none; }
.myv-gl { font-size: 12px; font-weight: 800; fill: var(--on-accent); }
.myv-node.is-self .myv-gl { font-size: 15px; }
.myv-node.t-muted .myv-gl, .myv-node.is-more .myv-gl { fill: var(--text-2); }
.myv-label { font-size: var(--fs-small); font-weight: 650; fill: var(--text); paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px; stroke-linejoin: round; }
.myv-node.is-self .myv-label { font-size: 13.5px; font-weight: 700; }
.myv-node.t-muted .myv-label, .myv-node.is-ghost .myv-label { fill: var(--text-3); font-weight: 600; }
.myv-sub { font-size: var(--fs-micro); fill: var(--text-3); paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px; stroke-linejoin: round; }
.myv-svg.is-narrow { max-height: none; }
.myv-svg.is-narrow .myv-label { font-size: 13px; }
.myv-svg.is-narrow .myv-sub { font-size: 11px; }
