/* Journey Map Builder - vis-network MicroSim
   Graph view on top, horizontal step-sequence strip below. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: aliceblue;
    color: #212529;
}

/* Container fills the iframe; graph area and strip stack vertically. */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Graph occupies the top region; the strip is a fixed-height sibling below.
   #network is a positioning context ONLY via .container - overlays are siblings. */
#network {
    width: 100%;
    height: 500px;
    flex: 0 0 500px;
    background-color: aliceblue;
    border-bottom: 2px solid #d3e3f3;
}

/* ===== Title (absolute overlay, top center) ===== */
.title {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: bold;
    color: #1a3a6c;
    background-color: rgba(240, 248, 255, 0.85);
    padding: 2px 12px;
    border-radius: 6px;
    z-index: 10;
}

/* ===== Legend (absolute overlay, upper left) ===== */
.legend {
    position: absolute;
    top: 44px;
    left: 10px;
    padding: 6px 8px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 3px 0;
    font-size: 12px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid #333;
}

.color-default { background-color: #a9cce3; }
.color-path { background-color: #ffd54f; }

/* ===== Right panel (absolute overlay) ===== */
.right-panel {
    position: absolute;
    top: 44px;
    right: 10px;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.97);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.control-label {
    font-size: 13px;
    font-weight: bold;
    color: #495057;
}

#goal-select {
    padding: 7px 8px;
    font-size: 14px;
    border: 1px solid #adb5bd;
    border-radius: 6px;
    background-color: white;
}

.btn {
    padding: 9px 16px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary { background-color: #2196f3; color: white; }
.btn-primary:hover { background-color: #1976d2; }
.btn-secondary { background-color: #757575; color: white; }
.btn-secondary:hover { background-color: #616161; }

.infobox {
    background-color: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ffb300;
}

.infobox-title {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
    color: #1a3a6c;
}

.infobox-content {
    font-size: 12px;
    line-height: 1.5;
}

/* ===== Journey step strip (below graph) ===== */
.journey-strip {
    flex: 0 0 auto;
    min-height: 120px;
    width: 100%;
    padding: 12px 16px;
    background-color: #f0f6fc;
    overflow-x: auto;
    overflow-y: hidden;
}

.journey-hint {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
    padding: 24px 0;
    text-align: center;
}

.journey-steps {
    display: none;
    align-items: center;
    gap: 4px;
    min-height: 90px;
    padding: 8px 0;
}

.journey-steps.visible {
    display: flex;
}

.journey-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 10px 12px;
    background-color: #ffd54f;
    border: 2px solid #ffb300;
    border-radius: 22px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.journey-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.journey-step.selected {
    outline: 3px solid #1a3a6c;
    outline-offset: 1px;
}

.journey-step .step-num {
    font-size: 11px;
    font-weight: bold;
    color: #7a5200;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journey-step .step-name {
    font-size: 13px;
    font-weight: bold;
    color: #212529;
    margin-top: 2px;
    line-height: 1.2;
}

.journey-step.goal {
    background-color: #ffca28;
    border-color: #f57f17;
    border-width: 3px;
}

.journey-arrow {
    color: #f57f17;
    font-size: 22px;
    font-weight: bold;
    flex: 0 0 auto;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .title { font-size: 16px; }
    .right-panel { width: 200px; }
    .legend { font-size: 10px; }
    .journey-step { min-width: 80px; }
}
