/* WP Minimal Flowcharts - Frontend Styles */
.wp-minflow-chart {
  position: relative;
  width: 100%;
  min-height: 300px;
  border: 0;
  background: #fff;
  overflow: auto;
}

.wp-minflow-chart .mf-node {
  position: absolute;
  min-width: 300px; /* increased from 200 */
  min-height: 50px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #f2f2f2;
  color: var(--color-primary);
  font-size: 18px; /* increased from 13px */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wp-minflow-chart .mf-node-head {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  font-size: 18px; /* ensure head inherits size */
}

.wp-minflow-chart .mf-node-head .mf-node-icon {
  width: 20px; /* scale with larger font */
  height: 20px;
  flex: 0 0 20px;
  color: var(--color-primary);
}

.wp-minflow-chart .mf-node-head .mf-node-icon path {
  pointer-events: none;
}

.wp-minflow-chart .mf-node-body {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.wp-minflow-chart svg.mf-edges {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.wp-minflow-chart .mf-edge {
  stroke: #2d3748;
  stroke-width: 2;
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.wp-minflow-chart .mf-node-body a {
  text-decoration: underline;
}

.wp-minflow-chart .mf-node-body ul,
.wp-minflow-chart .mf-node-body ol {
  padding-left: 20px;
  margin: 4px 0;
}

.mf-overlay-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 2vw;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9999;
}

.mf-overlay-dialog {
  background: var(--color-primary);
  max-width: 640px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25),
    0 8px 10px -6px rgba(0, 0, 0, 0.2);
  padding: 24px 28px;
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #1a202c;
  position: relative;
  animation: mfOverlayIn 0.18s ease;
  box-shadow: 10px 10px 8px 0 rgba(0, 0, 0, 0.25);
}

.mf-overlay-close {
  transform: scale(1.5);
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  padding: 6px 6px; /* tighter for icon */
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;

  svg {
    color: var(--color-white);

    path {
      fill: var(--color-white);
    }
  }
}

.mf-overlay-close svg {
  width: 14px;
  height: 14px;
  display: block;
  color: #1a202c;
}

.mf-overlay-title {
  margin: 0 0 12px;
  font-size: 25px;
  font-weight: 600;
  color: var(--color-white);
}

.mf-overlay-body {
  max-height: 60vh;
  overflow: auto;
  word-break: break-word;

  * {
    color: var(--color-white);
  }

  a {
    text-decoration: underline;
  }
}

.mf-overlay-body p {
  margin: 0 0 0.75em;
}

.mf-overlay-body ul,
.mf-overlay-body ol {
  padding-left: 20px;
  margin: 0 0 0.75em;
}

@keyframes mfOverlayIn {
  from {
    transform: translateY(-6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
