/* flowchart-3column.css - Three Column Flowchart / Swimlane Timeline */
:root {
  --primary-color: #2196F3;
  --secondary-color: #4CAF50;
  --accent-color: #FF9800;
  --timeline-width: 3px;
  --step-padding: 20px;
}

/***** Three Column Timeline Flow *****/
.tri-flow-timeline {
  position: relative;
  max-width: 1100px;
  margin: 40px auto 0;
  padding-top: 40px;
}

/* Background vertical swimlane dividing lines */
.tri-flow-timeline::before,
.tri-flow-timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: #e0e0e0;
  top: 30px;
  bottom: 0;
  z-index: 0;
}

.tri-flow-timeline::before {
  left: 33.333%;
}

.tri-flow-timeline::after {
  left: 66.666%;
}

/* Role / Swimlane Headers */
.tri-flow-header-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: table;
  width: 100%;
  table-layout: fixed;
  z-index: 2;
  border-bottom: 2px solid #ccc;
  padding-bottom: 8px;
}

.tri-flow-role-header {
  display: table-cell;
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  color: #2c3e50;
  width: 33.333%;
}

/* Flow Step Container */
.tri-flow-step {
  padding: 10px var(--step-padding);
  position: relative;
  width: 33.333%;
  margin: 15px 0;
  z-index: 1;
  box-sizing: border-box;
}

/* Column positioning */
.tri-flow-step.col-1 {
  left: 0;
}

.tri-flow-step.col-2 {
  left: 33.333%;
}

.tri-flow-step.col-3 {
  left: 66.666%;
}

/* Card Styles */
.tri-flow-card {
  position: relative;
  min-height: 60px;
  display: block;
  padding: 12px 15px;
  background: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  border-radius: 6px;
  border-top: 3px solid var(--primary-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tri-flow-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.tri-flow-card h4 {
  margin: 0 0 6px 0;
  color: #2c3e50;
  font-size: 1em;
}

.tri-flow-card p {
  margin: 0;
  font-size: 0.88em;
  color: #666;
  line-height: 1.4;
}

/* Color accents per column */
.tri-flow-step.col-1 .tri-flow-card { border-top-color: var(--primary-color); }
.tri-flow-step.col-2 .tri-flow-card { border-top-color: var(--secondary-color); }
.tri-flow-step.col-3 .tri-flow-card { border-top-color: var(--accent-color); }

/* Horizontal Flow Connectors */
.tri-flow-connector {
  position: absolute;
  height: 2px;
  background: #cbd5e1;
  top: 50%;
  z-index: 1;
}

.tri-flow-step.to-right .tri-flow-connector {
  left: 100%;
  width: 100%;
}

.tri-flow-step.to-left .tri-flow-connector {
  right: 100%;
  width: 100%;
}

/* Responsive Styles */
@media (max-width: 850px) {
  .tri-flow-timeline::before,
  .tri-flow-timeline::after,
  .tri-flow-header-container,
  .tri-flow-connector {
    display: none;
  }

  .tri-flow-step {
    width: 100% !important;
    left: 0 !important;
    padding-left: 15px;
    padding-right: 15px;
    margin: 15px 0;
  }

  .tri-flow-card::before {
    content: attr(data-role);
    display: inline-block;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
  }
}


/* Container to align parallel steps in the same row */
.tri-flow-row {
  display: flex;
  position: relative;
  width: 100%;
  z-index: 1;
}

/* Ensure steps inside a row keep their specific widths without overlapping */
.tri-flow-row .tri-flow-step {
  position: relative;
  top: auto;
  bottom: auto;
  margin: 15px 0;
}

/* Clear manual column offsets when steps sit inside a flex row */
.tri-flow-row .tri-flow-step.col-1 { left: 0; }
.tri-flow-row .tri-flow-step.col-2 { left: 0; }
.tri-flow-row .tri-flow-step.col-3 { left: 0; }

/* Handle column alignment inside flexible rows */
.tri-flow-row:has(.col-1) .tri-flow-step.col-2 { margin-left: 0; }
.tri-flow-row:has(.col-2) .tri-flow-step.col-3 { margin-left: 0; }

/* Mobile fallback for rows */
@media (max-width: 850px) {
  .tri-flow-row {
    flex-direction: column;
  }
}
