/* Mermaid MicroSim Stylesheet
   Layout: 2/3 diagram panel + 1/3 info panel
   Designed for minimal padding in iframe embedding
*/

/* Reset - minimal padding/margin for iframe embedding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
}

/* Main container: diagram left 2/3, info panel right 1/3 */
.container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Left 2/3: Mermaid diagram */
.diagram-panel {
    width: 66.67%;
    height: 100%;
    background-color: aliceblue;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    overflow: auto;
}

.mermaid {
    width: 100%;
    max-height: 100%;
}

.mermaid svg {
    max-width: 100%;
    max-height: calc(100vh - 20px);
}

/* Right 1/3: Info panel for hover content */
.info-panel {
    width: 33.33%;
    height: 100%;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    padding: 15px;
    overflow-y: auto;
}

.info-panel h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.info-title {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.info-content {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.info-placeholder {
    color: #888;
    font-style: italic;
    font-size: 14px;
}

/* Node hover styling */
.node {
    cursor: pointer;
}

.node:hover rect,
.node:hover circle,
.node:hover polygon {
    filter: brightness(1.1);
}

/* Research workflow handoffs additions */
.node:focus { outline: 3px solid #333; outline-offset: 2px; }
.edgeLabel { cursor: pointer; }
.info-row { margin-bottom: 8px; }
.info-row b { color: #333; }

.progress { font-size: 14px; font-weight: bold; color: #1a5c2e; background: #e6f4ea;
            border: 1px solid #9fcfae; border-radius: 4px; padding: 6px 8px; margin-bottom: 12px; }
.node.clicked rect, .node.clicked path, .node.clicked polygon { stroke: #1a7f37 !important; stroke-width: 4px !important; }

/* xAPI panel (?xapi=teaching): the template fills its frame, so pin the container to its
   production pixel height and let the panel sit below. Does nothing until the panel exists. */
html:has(> body > .xapi-panel) { height: auto; overflow: visible; }
body:has(> .xapi-panel) { height: auto; overflow: visible; }
body:has(> .xapi-panel) .container { height: 640px; }
body:has(> .xapi-panel) .mermaid svg { max-height: 600px; }
body > .xapi-panel { margin: 10px; min-width: 0; }
