<?php

function h($v){
return htmlspecialchars(
(string)$v
);
}

?>
<?php

$img=null;

if(
!empty(
$profile['profile_image']
)
){

$file=
basename(
(string)
$profile['profile_image']
);

$img=
'/easychair/storage/uploads/profile/'
.
$file;

}

?>
<link
href="https://fonts.googleapis.com/css2?family=Cairo:wght@300;500;700;900&display=swap"
rel="stylesheet"
>

<style>

body{

font-family:Cairo;

background:
linear-gradient(
180deg,
#f6f9ff,
#eef4ff
);

}

.ec-cover{

max-width:1280px;

margin:28px auto;

}

.ec-hero{

background:
linear-gradient(
135deg,
#0f172a,
#1d4ed8,
#2563eb
);

padding:48px;

border-radius:32px;

color:#fff;

box-shadow:
0 30px 80px rgba(
37,
99,
235,
.20
);

}

.ec-avatar{

width:170px;

height:170px;

border-radius:50%;

object-fit:cover;

background:#fff;

border:6px solid rgba(
255,
255,
255,
.18
);

}

.ec-card{

background:#fff;

padding:28px;

border-radius:24px;

margin-top:22px;

box-shadow:
0 10px 40px rgba(
15,
23,
42,
.06
);

}

.ec-grid{

display:grid;

grid-template-columns:
repeat(
auto-fit,
minmax(
260px,
1fr
)
);

gap:18px;

}

.ec-chip{

padding:10px 18px;

background:#eff6ff;

border-radius:999px;

display:inline-block;

margin:4px;

}

.ec-link{

display:block;

padding:16px;

background:#f8fafc;

border-radius:18px;

text-decoration:none;

color:#0f172a;

}

</style>

<div class="ec-cover">

<div class="ec-hero">

<div
style="
display:flex;
gap:30px;
align-items:center;
flex-wrap:wrap;
"
>

<div>

<?php if($img): ?>

<img
src="<?= h($img) ?>"
class="ec-avatar"
>

<?php else: ?>

<div
class="ec-avatar"
style="
display:flex;
align-items:center;
justify-content:center;
font-size:64px;
color:#2563eb;
"
>

<?= strtoupper(
substr(
$profile['name']
??
'U',
0,
1
)
) ?>

</div>

<?php endif; ?>

</div>

<div>

<h1>

<?= h(
$profile['name']
??
'Academic Profile'
) ?>

</h1>

<div>

<?= h(
$profile['affiliation']
??''
) ?>

</div>

<br>

<span class="ec-chip">

<?= h(
$profile['academic_rank']
??'Academic'
) ?>

</span>

<span class="ec-chip">

<?= h(
$profile['major']
??''
) ?>

</span>

<span class="ec-chip">

<?= h(
$profile['specialization']
??''
) ?>

</span>

</div>

</div>

</div>

<div style="
display:grid;
grid-template-columns:repeat(4,1fr);
gap:18px;
margin:20px 0;
">

<?php foreach([

'ORCID'=>!empty($profile['orcid']),
'Scopus'=>!empty($profile['scopus_id']),
'Scholar'=>!empty($profile['google_scholar']),
'Profile'=>!empty($profile['bio'])

] as $k=>$v): ?>

<div
style="
background:#fff;
padding:18px;
border-radius:18px;
text-align:center;
">

<div style="
font-size:28px;
font-weight:900;
color:#2563eb;
">

<?= $v ? '✓' : '—' ?>

</div>

<div>

<?= $k ?>

</div>

</div>

<?php endforeach; ?>

</div>

<div class="ec-grid">

<div class="ec-card">

<h3>
Research Interests
</h3>

<?= nl2br(
h(
$profile['research_interests']
??''
)
) ?>

</div>

<div class="ec-card">

<h3>
Biography
</h3>

<?= nl2br(
h(
$profile['bio']
??''
)
) ?>

</div>

</div>

<div class="ec-card">

<h3>
Research Links
</h3>

<?php
$links=[

'ORCID'=>$profile['orcid']??'',

'Scopus'=>$profile['scopus_id']??'',

'Google Scholar'=>$profile['google_scholar']??'',

'Website'=>$profile['personal_website']??'',

'LinkedIn'=>$profile['linkedin_url']??''

];

foreach($links as $k=>$v):

if(!$v) continue;
?>

<a
class="ec-link"
target="_blank"
href="<?= h($v) ?>"
>

<?= h($k) ?>

</a>

<?php endforeach; ?>

<?php if(!empty($profile['cv_file'])): ?>

<br>

<a
class="ec-link"
target="_blank"
href="/easychair/<?= h($profile['cv_file']) ?>"
>

Download CV

</a>

<?php endif; ?>

</div>

</div>

