/* Modern, Minimal, and Premium Academic Homepage Styles */

/* Font Import - Using system fonts for better performance */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Crimson+Text:wght@400;600&display=swap');

/* CSS Variables for easy customization */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #636363;
    --accent-color: #880000;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --link-color: #2c5aa0;
    --link-hover: #880000;
    --text-primary: #1a1a1a;
    --text-secondary: #636363;
    --max-width: 1100px;
    --spacing-unit: 24px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
#MainDiv {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 40px 60px;
    background-color: #ffffff;
}

#PageContentDiv {
    margin: 0;
}

/* Profile Container - Three Column Layout */
.profile-container {
    display: flex;
    gap: 40px;
    margin-bottom: 48px;
    align-items: flex-start;
}

.profile-photo {
    flex-shrink: 0;
    width: 370px;
}

.profile-photo img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo img:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.profile-info {
    flex: 1;
}

.main-title {
    font-family: 'Crimson Text', serif;
    font-size: 48px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 4px 0;
    padding: 0;
    border: none;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    padding: 0;
    font-style: normal;
}

.affiliation {
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.affiliation a {
    display: inline-block;
    margin-bottom: 2px;
}

.affiliation-logos {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    justify-content: flex-start;
    width: 160px;
}

.affiliation-logos img {
    height: auto;
    width: 100%;
    max-width: 140px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.affiliation-logos img:hover {
    opacity: 1;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.3px;
    margin-top: 0;
    margin-bottom: 0;
}

h1 {
    font-size: 28px;
}

h1.separator {
    font-size: 24px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

h2 {
    font-size: 22px;
}

h3 {
    font-size: 18px;
}

p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Links */
a, a:link, a:active {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

a:hover, a:focus {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Tables - legacy support */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 32px;
}

td {
    padding: 12px;
    vertical-align: top;
}

/* Remove old profile image styles - now handled by .profile-photo */

/* Lists */
ul, ol {
    margin-left: 0;
    padding-left: 24px;
    margin-bottom: 24px;
}

li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

li b {
    color: var(--primary-color);
    font-weight: 600;
}

/* Awards list with two columns */
.awards-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 40px;
    column-gap: 40px;
}

/* Publication List */
ul li ul {
    margin-top: 8px;
    margin-bottom: 16px;
}

/* Inline styles cleanup */
font[color="#E43040"] {
    color: #E43040;
}

small {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Logo Images - legacy support */
img[src*="lamda_logo"], 
img[src*="nju"] {
    opacity: 0.85;
    transition: opacity 0.2s ease;
    max-width: 100%;
    height: auto;
}

img[src*="lamda_logo"]:hover, 
img[src*="nju"]:hover {
    opacity: 1;
}

/* Spotlight Badge */
font[color="#E43040"] b {
    color: #E43040;
}

/* Footer */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 60px 0 20px;
}

div[style*="text-align:right"] {
    text-align: right;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #MainDiv {
        padding: 32px 24px;
    }
    
    .profile-container {
        flex-direction: column;
        gap: 32px;
    }
    
    .profile-photo {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .main-title {
        font-size: 36px;
        text-align: center;
    }
    
    .subtitle {
        font-size: 20px;
        text-align: center;
    }
    
    .affiliation {
        text-align: center;
    }
    
    .affiliation-logos {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        flex-direction: row;
        justify-content: center;
    }
    
    .affiliation-logos img {
        max-width: 140px;
    }
    
    h1.separator {
        font-size: 22px;
        margin-top: 36px;
    }
}

@media (max-width: 480px) {
    #MainDiv {
        padding: 24px 16px;
    }
    
    .main-title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .profile-photo {
        max-width: 240px;
    }
    
    .affiliation-logos {
        max-width: 250px;
    }
    
    .affiliation-logos img {
        max-width: 120px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h1.separator {
        font-size: 20px;
    }
    
    .awards-list {
        grid-template-columns: 1fr;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    #MainDiv {
        padding: 20px;
    }
    
    h1.separator {
        page-break-after: avoid;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
}

/* ClustrMaps styling */
#clustrmaps {
    display: none; /* Hide visitor map for cleaner look */
}

/* Email links */
a[href^="mailto:"] {
    color: var(--link-color);
    font-weight: 500;
}

a[href^="mailto:"]:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Publication links styling */
ul li a[href$=".pdf"]:before,
ul li a[href*="arxiv"]:before,
ul li a[href$=".html"]:before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
}

/* Improve publication list readability */
ul li ul li {
    margin-bottom: 8px;
    padding-left: 8px;
}

/* Remove extra spacing after certain elements */
h1 + br + br {
    display: none;
}



/* Better spacing for section content */
h1.separator + p,
h1.separator + ul {
    margin-top: 0;
}
