<?php
$title='Author Collaboration Intelligence';
?>

<div class="container-fluid py-4">

<h2 class="mb-4">
<i class="fa-solid fa-user-group"></i>
Author Collaboration Intelligence
</h2>

<div class="row g-3">

<?php if(empty($rows)): ?>

<div class="col-12">
<div class="alert alert-info">
No collaboration intelligence data is available yet.
</div>
</div>

<?php endif; ?>

<?php foreach($rows as $r): ?>

<div class="col-lg-6">

<div class="card shadow-sm h-100">

<div class="card-header">
Conference #<?= (int)($r['conference_id'] ?? 0) ?>
</div>

<div class="card-body">

<div class="row g-3">

<div class="col-md-6">
<h6>Collaboration Score</h6>
<h3><?= htmlspecialchars($r['collaboration_score'] ?? '0') ?></h3>
</div>

<div class="col-md-6">
<h6>Network Level</h6>
<div class="fw-bold fs-5">
<?= htmlspecialchars($r['network_level'] ?? '-') ?>
</div>
</div>

<div class="col-md-6">
<h6>Submissions</h6>
<h4><?= (int)($r['submission_count'] ?? 0) ?></h4>
</div>

<div class="col-md-6">
<h6>Co-authors</h6>
<h4><?= (int)($r['coauthor_count'] ?? 0) ?></h4>
</div>

</div>

<hr>

<p>
<strong>Unique Affiliations:</strong>
<?= (int)($r['unique_affiliations'] ?? 0) ?>
</p>

<p>
<strong>Unique Countries:</strong>
<?= (int)($r['unique_countries'] ?? 0) ?>
</p>

<p>
<strong>Top Collaborator:</strong>
<?= htmlspecialchars($r['top_collaborator'] ?? '-') ?>
</p>

</div>

</div>

</div>

<?php endforeach; ?>

</div>

</div>
