/* Intent Preservation Matrix Stylesheet
 * ============================================
 * vis-network hierarchical layout showing traceability
 * from learning objectives to specification details
 */

/* ===========================================
   RESET & BASE STYLES
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ===========================================
   MAIN CONTAINER & NETWORK CANVAS
   =========================================== */
.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

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

/* ===========================================
   TITLE (Top Center)
   =========================================== */
.title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: bold;
    color: #333;
    background-color: rgba(245, 245, 245, 0.95);
    padding: 8px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

/* ===========================================
   LEGEND (Upper Left)
   =========================================== */
.legend {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    max-width: 200px;
}

.legend-title {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Color swatches for hierarchy levels */
.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    margin-right: 10px;
    border: 2px solid #333;
}

.level-objective { background-color: #1a365d; border-color: #0d1b2a; }
.level-concept { background-color: #2563eb; border-color: #1d4ed8; }
.level-feature { background-color: #60a5fa; border-color: #3b82f6; }
.level-detail { background-color: #94a3b8; border-color: #64748b; }
.level-orphan { background-color: #ef4444; border-color: #dc2626; }
.level-highlighted { background-color: #fbbf24; border-color: #f59e0b; }

/* ===========================================
   RIGHT PANEL (Controls & Info)
   =========================================== */
.right-panel {
    position: absolute;
    top: 50px;
    right: 10px;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

/* ===========================================
   CONTROLS
   =========================================== */
.controls {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 10px 15px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary.active {
    background-color: #ef4444;
}

.btn-primary.active:hover {
    background-color: #dc2626;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* ===========================================
   INFO PANEL
   =========================================== */
.info-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
}

.info-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2563eb;
    color: #333;
}

.info-text {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
}

.info-text p {
    margin-bottom: 8px;
}

.info-text hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.info-text .rationale {
    background-color: #f0f9ff;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #2563eb;
    margin-top: 8px;
}

.info-text .level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.info-text .level-badge.objective { background-color: #1a365d; color: white; }
.info-text .level-badge.concept { background-color: #2563eb; color: white; }
.info-text .level-badge.feature { background-color: #60a5fa; color: #1a365d; }
.info-text .level-badge.detail { background-color: #94a3b8; color: white; }

/* ===========================================
   VIS-NETWORK NAVIGATION BUTTONS
   =========================================== */
div.vis-network div.vis-navigation div.vis-button {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
}

div.vis-network div.vis-navigation div.vis-button:hover {
    background-color: rgba(37, 99, 235, 0.2);
    border-color: #2563eb;
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */
@media (max-width: 768px) {
    .title {
        font-size: 16px;
        top: 5px;
        padding: 6px 12px;
    }

    .legend {
        padding: 8px 10px;
        max-width: 160px;
    }

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

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

    .legend-color {
        width: 14px;
        height: 14px;
    }

    .right-panel {
        width: 180px;
        top: 40px;
    }

    .info-panel {
        padding: 10px;
        max-height: 300px;
    }

    .info-title {
        font-size: 13px;
    }

    .info-text {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .legend {
        display: none;
    }

    .right-panel {
        width: 150px;
    }

    .btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}
