/* Chapter 1 Concept Map Stylesheet */

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

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

.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

#network {
    width: 100%;
    height: 100%;
    background-color: aliceblue;
}

/* Title */
.title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: bold;
    color: #333;
    background-color: rgba(240, 248, 255, 0.9);
    padding: 5px 15px;
    border-radius: 5px;
    z-index: 10;
    white-space: nowrap;
}

/* Legend  box in the upper left corner */
.legend {
    position: absolute;
    top: 5px;
    left: 10px;
    padding: 10px 12px;
    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;
    max-width: 180px;
}

.legend-title {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 8px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.legend-section {
    margin-bottom: 10px;
}

.legend-section-title {
    font-size: 10px;
    font-weight: bold;
    color: #666;
    margin-bottom: 4px;
}

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

.legend-shape {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border: 2px solid #333;
}

.shape-circle {
    border-radius: 50%;
    background-color: #FFD700;
}

.shape-square {
    background-color: #4A90D9;
}

.shape-diamond {
    background-color: #27AE60;
    transform: rotate(45deg);
    width: 12px;
    height: 12px;
    margin: 2px 8px 2px 4px;
}

.shape-hexagon {
    background-color: #9B59B6;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.shape-rectangle {
    background-color: #E67E22;
    width: 20px;
    height: 12px;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #17A2B8;
    background: transparent;
    border-top: none;
}

/* Edge legend */
.edge-legend {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

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

.edge-line {
    width: 25px;
    height: 3px;
    margin-right: 6px;
}

.edge-solid { background-color: #666; }
.edge-dashed {
    background: repeating-linear-gradient(90deg, #4A90D9, #4A90D9 4px, transparent 4px, transparent 8px);
}
.edge-dotted {
    background: repeating-linear-gradient(90deg, #27AE60, #27AE60 2px, transparent 2px, transparent 5px);
}
.edge-double {
    background-color: #E74C3C;
    height: 4px;
}

/* Right panel */
.right-panel {
    position: absolute;
    top: 5px;
    right: 10px;
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

/* Info panel */
.info-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 120px;
}

.info-title {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.info-category {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
}

.info-definition {
    font-size: 12px;
    line-height: 1.4;
    color: #444;
    margin-bottom: 8px;
}

.info-connections {
    font-size: 11px;
    color: #666;
}

.info-subtitle {
    font-weight: bold;
    font-size: 12px;
    color: #333;
    margin-bottom: 6px;
}

.info-hint {
    font-size: 12px;
    color: #888;
    font-style: italic;
    line-height: 1.5;
}

.example-list {
    font-size: 11px;
    margin-left: 15px;
    color: #444;
}

.example-list li {
    margin: 4px 0;
}

/* Save button (edit mode) */
.save-button {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #27AE60;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 100;
    transition: background-color 0.2s, transform 0.1s;
}

.save-button:hover {
    background-color: #219A52;
}

.save-button:active {
    transform: translateX(-50%) scale(0.98);
}

/* Responsive */
@media (max-width: 700px) {
    .legend {
        max-width: 140px;
        padding: 8px;
    }

    .legend-item {
        font-size: 10px;
    }

    .right-panel {
        width: 180px;
    }

    .title {
        font-size: 16px;
    }
}
