/* Causal Loop Diagram MicroSim Styles */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 400;
}

.diagram-description {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95em;
    color: #495057;
}

#network {
    width: 100%;
    height: 450px;
    background: aliceblue;
    border: 1px solid #e9ecef;
}

.details-panel {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    min-height: 120px;
}

.details-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    font-size: 1.1em;
}

.details-content {
    line-height: 1.5;
}

.details-content h4 {
    margin: 10px 0 5px 0;
    color: #333;
}

.details-content p {
    margin: 8px 0;
}

.details-content .label {
    font-weight: bold;
    color: #495057;
}

.loop-info {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 5px;
    margin: 8px 0;
    border-left: 4px solid #007bff;
}

.loop-info.reinforcing {
    border-left-color: #dc3545;
}

.loop-info.balancing {
    border-left-color: #28a745;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.85em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 20px;
    height: 3px;
    display: inline-block;
}

.legend-color.positive {
    background: #28a745;
}

.legend-color.negative {
    background: #dc3545;
}

.legend-loop {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: bold;
}

.legend-loop.reinforcing {
    background: #dc3545;
}

.legend-loop.balancing {
    background: #28a745;
}

/* Styles for menu-hidden mode (iframe embedding) */
body.menu-hidden {
    padding: 0;
    background-color: white;
}

body.menu-hidden .container {
    max-width: none;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.menu-hidden .header,
body.menu-hidden .diagram-description,
body.menu-hidden .details-panel,
body.menu-hidden .legend {
    display: none;
}

body.menu-hidden #network {
    flex: 1;
    height: 100%;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.2em;
    }

    #network {
        height: 350px;
    }

    .legend {
        flex-direction: column;
        gap: 8px;
    }
}
