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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background-color: #fff;
    color: #333;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

nav .nav-list {
    position: relative;
}

nav a {
    color: #333;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #0066cc;
}

/* Dropdown Navigation */
.has-dropdown {
    position: relative;
}

/* Add padding to parent to bridge the gap */
.has-dropdown > a.nav-link {
    padding-bottom: 1rem;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    margin-top: -0.5rem; /* Negative margin to overlap and prevent gap */
    padding: 0.5rem 0;
    padding-top: 1rem; /* Extra padding at top for smooth transition */
    z-index: 1000;
}

.has-dropdown:hover .dropdown {
    display: block;
}

.dropdown li {
    list-style: none;
}

.dropdown a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.dropdown a:hover {
    background-color: #f5f5f5;
    color: #0066cc;
}

/* Dropdown arrow indicator */
.has-dropdown > a.nav-link::after {
    content: ' ▾';
    font-size: 0.8em;
    opacity: 0.6;
}

/* Sections */
.section {
    padding: 4rem 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-weight: 600;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #1a1a1a;
    font-weight: 600;
}

h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
    font-weight: 600;
}

/* About Section */
.bio {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bio-text {
    flex: 1;
    min-width: 300px;
}

.bio-text p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.bio-text a {
    color: #0066cc;
    text-decoration: none;
}

.bio-text a:hover {
    text-decoration: underline;
}

.education {
    margin-top: 2rem;
}

.education h3 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.education p {
    margin-bottom: 0.8rem;
}

/* Publications Section */
.year-filter {
    display: none;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 3px;
    text-align: center;
}

.year-filter strong {
    margin-right: 0.5rem;
    color: #1a1a1a;
}

.year-link {
    color: #0066cc;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    transition: background-color 0.2s ease;
}

.year-link:hover {
    text-decoration: underline;
    background-color: #e8f4ff;
    border-radius: 3px;
}

.year-heading {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0066cc;
    font-weight: 600;
    scroll-margin-top: 80px; /* Account for sticky header */
}

.year-heading:first-of-type {
    margin-top: 0;
}

.publication {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #fafafa;
    border-left: 3px solid #0066cc;
    transition: box-shadow 0.3s ease;
    scroll-margin-top: 80px; /* Account for sticky header when jumping to citation */
}

.publication:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.publication-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.publication-authors {
    font-style: italic;
    margin-bottom: 0.3rem;
    color: #555;
}

.publication-venue {
    color: #666;
    margin-bottom: 0.5rem;
}

.publication-doi,
.publication-url {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
    font-family: 'Monaco', 'Courier New', monospace;
}

.publication-doi strong,
.publication-url strong {
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.publication-year {
    color: #888;
    font-weight: 500;
}

.publication-links {
    margin-top: 0.5rem;
}

.publication-links a {
    display: inline-block;
    margin-right: 1rem;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
}

.publication-links a:hover {
    text-decoration: underline;
}

/* Projects Section */
.project {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background-color: #fafafa;
    border-radius: 3px;
    scroll-margin-top: 80px; /* Account for sticky header */
}

.project:target {
    background-color: #fffacd;
    transition: background-color 0.5s ease;
}

.project h3 {
    margin-top: 0;
    color: #1a1a1a;
}

.project p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.project ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.project a {
    color: #0066cc;
    text-decoration: none;
}

.project a:hover {
    text-decoration: underline;
}

/* Citation Links */
.citation-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.citation-link:hover {
    text-decoration: underline;
}

.citation-missing {
    color: #d9534f;
    font-weight: bold;
}

/* Project References Section */
.project-references {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.project-references h4 {
    color: #1a1a1a;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.project-references ul {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.reference-item {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    text-indent: -1.5rem;
    line-height: 1.6;
    color: #555;
}

.reference-item a {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9em;
}

.reference-item a:hover {
    text-decoration: underline;
}

/* Publication highlighting when linked from citation */
.publication:target {
    background-color: #fffacd;
    border-left-color: #f0ad4e;
    transition: background-color 0.5s ease;
}

/* Contact Section */
.contact-info {
    background-color: #fafafa;
    padding: 2rem;
    border-radius: 3px;
}

.contact-item {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.contact-item strong {
    color: #1a1a1a;
    display: inline-block;
    min-width: 80px;
}

.contact-item a {
    color: #0066cc;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #f5f5f5;
    color: #666;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid #e0e0e0;
}

/* Loading States */
#publications-loading,
#projects-loading {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .bio {
        flex-direction: column;
        align-items: center;
    }
    
    .profile-photo {
        width: 150px;
        height: 150px;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    /* Mobile dropdown behavior - tap to toggle */
    .has-dropdown {
        position: relative;
    }
    
    .dropdown {
        left: 0;
        transform: none;
        min-width: 200px;
    }
    
    /* On mobile, make nav items stack better */
    nav .nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .has-dropdown {
        width: 100%;
        text-align: center;
    }
}
