/* --- Global Styles & Variables --- */
:root {
    --primary-color: #00529B; /* UF Blue */
    --hover-color: #FA4616; /* UF Orange (used as yellow-ish hover) */
    --text-color: #333333;
    --light-text-color: #555555;
    --bg-color: #FFFFFF;
    --section-bg-color: #F9F9F9;
    --border-color: #E0E0E0;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Palatino, "Palatino Linotype", "Book Antiqua", serif;
    line-height: 1.7;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 17px;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

h1, h2, h3 {
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #000;
}

h1 {
    font-size: 2.8rem;
    font-weight: 600;
}

h2 {
    font-size: 2rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    margin-top: 0.8rem;
}

h3 {
    font-size: 1.4rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

section {
    padding: 40px 0; /* Further reduced from 60px to 40px */
}

/* --- Collapsible Sections --- */
.section-header {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: color 0.3s ease;
}

.section-header:hover {
    color: var(--hover-color);
}

.section-header h2 {
    margin: 0;
    flex-grow: 1;
}

.collapse-arrow {
    font-size: 1.2rem;
    margin-left: 10px;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.section-header.expanded .collapse-arrow {
    transform: rotate(180deg);
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding-top 0.3s ease;
    padding-top: 0;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
}

.section-content.expanded {
    max-height: 20000px; /* Large enough for long publication/project sections */
    opacity: 1;
    padding-top: 20px; /* Add breathing space when expanded */
}

/* About section is always expanded */
#about .section-content {
    max-height: none;
    opacity: 1;
}




/* --- Header & Navigation --- */
#main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    max-width: none;
    margin: 0;
    padding: 0 40px; /* Add padding for content spacing */
}

#main-header .logo a {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
}

#main-header .nav-links {
    list-style: none;
    display: flex;
}

#main-header .nav-links li {
    margin-left: 25px;
}

#main-header .nav-links a {
    font-size: 1rem;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}
#main-header .nav-links a.active,
#main-header .nav-links a:hover {
    color: var(--hover-color);
    border-bottom-color: var(--hover-color);
    text-decoration: none;
}
#main-header .nav-links a i {
    font-size: 0.7em;
    margin-left: 4px;
}

.scroll-progress {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    overflow: hidden;
    background-color: transparent;
    pointer-events: none;
}

.scroll-progress-bar {
    width: 100%;
    height: 100%;
    background-color: var(--hover-color);
    transform: scaleX(0);
    transform-origin: left center;
}


/* --- Main Content Padding --- */
main {
    padding-top: 100px; /* More breathing room from header */
}

/* --- Hero Section (About) --- */
.hero-section {
    padding: 120px 0 100px 0; /* Much more breathing room from header */
    min-height: 70vh;
}

/* Hero Header (Centered Info) */
.hero-header {
    text-align: center;
    margin-bottom: 40px;
}

.hero-header h1 {
    font-size: 3.2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    color: #1a1a1a;
}

.hero-header .subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--light-text-color);
    margin-bottom: 1rem;
    border-bottom: none;
    margin-top: 0;
}

.hero-header .email {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

.hero-header .roles {
    font-size: 1rem;
    color: var(--light-text-color);
    font-style: italic;
    margin-bottom: 0;
}

/* Hero Main Content (Photo + Description) */
.hero-main {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.hero-left {
    flex: 0 0 30%; /* 30% width as requested */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-photo-container {
    width: 100%;
    margin-bottom: 20px;
}

.profile-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.profile-photo:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.hero-description {
    flex: 1;
}

.hero-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* --- Call-to-Action Buttons --- */
.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #003d7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,82,155,0.3);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,82,155,0.2);
    text-decoration: none;
}

/* --- Contact Text Links --- */
.contact-text-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    font-size: 0.9rem;
}

.contact-text-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-text-links a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.separator {
    color: var(--light-text-color);
    margin: 0 4px;
}

.about-research {
    margin-top: 2.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
}

.about-research h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    color: var(--primary-color);
    font-size: 1.18rem;
}

.about-research h3 i {
    font-size: 0.9em;
}

/* --- Research Interests --- */
.research-interest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem 1.2rem;
}

.research-interest-item {
    border-left: 2px solid var(--border-color);
    padding-left: 1rem;
    line-height: 1.5;
}

.research-interest-item strong {
    display: block;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.research-interest-item span {
    display: block;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* --- News Section --- */
.news-list {
    list-style: none;
    padding: 0;
}

.news-item {
    display: grid;
    grid-template-columns: 4.4rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.68rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.news-item:first-child {
    padding-top: 0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.news-body p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.91rem;
    line-height: 1.42;
}

/* --- Publications Section --- */
.google-scholar-note {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--light-text-color);
    margin-left: 1rem;
}

.google-scholar-note a {
    color: var(--primary-color);
    text-decoration: none;
}

.google-scholar-note a:hover {
    text-decoration: underline;
}

.publication-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0 0.7rem;
    border-bottom: 1px solid var(--border-color);
}

.publication-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #ffffff;
}

.publication-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 28px;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--light-text-color);
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out);
}

.publication-view-btn:active {
    transform: scale(0.97);
}

.publication-view-btn.active {
    background-color: #f4f6f8;
    color: var(--primary-color);
    box-shadow: none;
}

.publication-view-panel.active {
    animation: publication-panel-in 120ms var(--ease-out);
}

.publication-subsection {
    margin-bottom: 1.15rem;
}

#publication-year-view {
    --publication-timeline-line: 4.95rem;
    --publication-timeline-content: 6.35rem;
    position: relative;
    padding-left: var(--publication-timeline-content);
}

#publication-year-view::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    bottom: 0.4rem;
    left: var(--publication-timeline-line);
    width: 1px;
    background: linear-gradient(180deg, rgba(0, 82, 155, 0.12), rgba(0, 82, 155, 0.3) 12%, rgba(0, 82, 155, 0.3) 88%, rgba(0, 82, 155, 0.12));
}

.publication-subsection-heading,
.publication-year-type-heading {
    margin-bottom: 0.4rem;
}

.publication-heading-main {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.publication-subsection-heading h3,
.publication-year-type-heading h4 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.publication-subsection-heading h3 {
    font-size: 1.08rem;
}

.publication-subsection-heading > div > span {
    display: block;
    margin-top: 0.1rem;
    color: var(--light-text-color);
    font-size: 0.8rem;
    font-style: italic;
}

.publication-list {
    list-style: none;
    padding-left: 0;
}

.publication-list li {
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
    line-height: 1.42;
    font-size: 0.92rem;
}

.publication-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.8rem;
    align-items: flex-start;
}

.publication-entry-main {
    min-width: 0;
}

.publication-list li,
.publication-list li strong,
.publication-list li em,
.publication-list li a,
.publication-entry-text {
    line-height: inherit;
}

.publication-list li em {
    color: var(--light-text-color);
    font-style: italic;
}

.publication-copy-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.26rem;
    margin-top: 0.04rem;
    white-space: nowrap;
}

.publication-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.26rem;
    width: 4.1rem;
    min-height: 1.55rem;
    padding: 0 0.48rem;
    border: 1px solid rgba(0, 82, 155, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-color);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out), box-shadow 140ms var(--ease-out);
}

.publication-copy-btn i {
    font-size: 0.72rem;
}

.publication-copy-btn:hover {
    border-color: rgba(0, 82, 155, 0.34);
    background: #f7fafc;
    box-shadow: 0 3px 8px rgba(0, 82, 155, 0.08);
}

.publication-copy-btn:focus-visible {
    outline: 2px solid rgba(250, 70, 22, 0.45);
    outline-offset: 2px;
}

.publication-copy-btn:active {
    transform: scale(0.97);
}

.publication-copy-btn.copied {
    border-color: rgba(12, 125, 67, 0.28);
    background: #f0fff6;
    color: #0c7d43;
}

.publication-copy-btn.copy-failed {
    border-color: rgba(150, 49, 13, 0.28);
    background: #fff4ef;
    color: #96310d;
}

.doi-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 0.25rem;
    overflow-wrap: anywhere;
}

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

.legend {
    color: var(--light-text-color);
    font-style: italic;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.publication-year-group {
    position: relative;
    margin-bottom: 1.55rem;
    padding-top: 0;
}

.publication-year-group:first-child {
    padding-top: 0;
}

.publication-year-group::before {
    content: "";
    position: absolute;
    top: 0.33rem;
    left: calc(var(--publication-timeline-line) - var(--publication-timeline-content));
    width: 7px;
    height: 7px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background: var(--bg-color);
    transform: translateX(-50%);
}

.publication-year-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 0;
    left: calc(-1 * var(--publication-timeline-content));
    width: 4.35rem;
    margin: 0;
    text-align: left;
}

.publication-year-label {
    display: block;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

.publication-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.15rem;
    padding: 0.06rem 0.44rem;
    border: 1px solid rgba(0, 82, 155, 0.18);
    border-radius: 999px;
    background-color: #f7fafc;
    color: var(--light-text-color);
    font-family: inherit;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.publication-year-heading .publication-count {
    margin-top: 0.28rem;
}

.publication-year-type {
    margin-left: 0;
    padding-left: 0;
}

.publication-year-type .publication-list li {
    padding-left: 0;
    border-left: 0;
}

.publication-year-type + .publication-year-type {
    margin-top: 0.95rem;
}

.publication-year-type-heading {
    margin-bottom: 0.35rem;
}

.publication-year-type-heading h4 {
    font-size: 0.95rem;
}

.publication-tags {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: 0.35rem;
    vertical-align: baseline;
}

.publication-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.35em;
    padding: 0.1rem 0.46rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--light-text-color);
    background-color: #f8f9fa;
    font-size: 0.73rem;
    font-style: normal;
    font-weight: 650;
    line-height: 1.1;
    white-space: nowrap;
}

.publication-tag-award {
    border-color: rgba(250, 70, 22, 0.38);
    background-color: #fff3ed;
    color: #96310d;
}

.publication-tag-selective {
    border-color: rgba(0, 82, 155, 0.34);
    background-color: #edf6fd;
    color: var(--primary-color);
}

.publication-tag-status {
    border-color: rgba(85, 85, 85, 0.26);
    background-color: #f5f5f5;
    color: #444444;
}

@keyframes publication-panel-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .publication-view-panel.active {
        animation: none;
    }
}


/* --- Projects Section --- */
.projects-list {
    margin: 0;
    padding: 0;
}

.project-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    align-items: stretch;
}

.project-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.project-image-link {
    flex-shrink: 0;
    width: 220px;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.project-image-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Special handling for CiteBar square app icon */
.citebar-icon {
    object-fit: contain !important;
    background: #f8f9fa;
    width: 70%;
    height: 70%;
    margin: auto;
}

.project-image:hover {
    transform: scale(1.05);
}

.project-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.project-image-link:hover .project-icon {
    color: var(--hover-color);
}

.project-content {
    flex: 1;
    min-width: 0;
}

.project-main {
    margin-bottom: 0.8rem;
}

.project-item h3 {
    margin-bottom: 0.4rem;
    font-size: 1.2rem;
    line-height: 1.3;
}

.project-item h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.project-item h3 a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.project-role {
    font-style: italic;
    color: var(--light-text-color);
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
    color: var(--text-color);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.8rem;
}

.tech-stack span {
    background-color: #e8f4fd;
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #d1e7dd;
}

/* Section headers with icons */
#news h2,
#publications h2,
#projects h2,
#awards h2,
#service h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

section h2 i {
    color: var(--primary-color);
    font-size: 0.9em;
}

/* --- Awards and Professional Service Sections --- */
.subsection {
    margin-bottom: 1.8rem;
}

.subsection > h3 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.45rem;
    margin-bottom: 0.9rem;
    font-size: 1.22rem;
}

.awards-subsection,
.activities-subsection {
    margin-bottom: 1.35rem;
}

.awards-subsection > h3,
.activities-subsection > h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--primary-color);
    border-bottom: 1px solid rgba(0, 82, 155, 0.14);
    padding-bottom: 0.38rem;
    margin-bottom: 0.58rem;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: 0;
}

.awards-subsection > h3::before,
.activities-subsection > h3::before {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background-color: var(--hover-color);
    opacity: 0.82;
    flex: 0 0 auto;
}

/* Awards List */
.awards-list {
    list-style: none;
    padding: 0;
}

.awards-list li,
.activities-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: baseline;
    gap: 0.08rem 0.9rem;
    margin-bottom: 0;
    padding: 0.46rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.awards-list li:first-child,
.activities-list li:first-child {
    padding-top: 0;
}

.awards-list li:last-child,
.activities-list li:last-child {
    border-bottom: none;
}

.compact-awards li {
    padding: 0.4rem 0;
}

.award-item,
.activity-item {
    display: contents;
}

.award-title,
.activity-title {
    font-weight: 600;
    color: var(--text-color);
    min-width: 0;
    line-height: 1.28;
}

.award-date,
.activity-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.32rem;
    padding: 0.08rem 0.48rem;
    border: 1px solid rgba(0, 82, 155, 0.16);
    border-radius: 999px;
    background-color: #f7fafc;
    color: var(--primary-color);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.award-venue,
.activity-venue {
    grid-column: 1 / -1;
    color: var(--light-text-color);
    font-style: italic;
    font-size: 0.86rem;
    line-height: 1.3;
    margin-top: 0.02rem;
    margin-bottom: 0;
}

.award-description {
    grid-column: 1 / -1;
    color: var(--text-color);
    font-size: 0.84rem;
    line-height: 1.36;
    margin-top: 0.2rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(0, 82, 155, 0.18);
}

/* Activities List */
.activities-list {
    list-style: none;
    padding: 0;
}



/* Service Section */
.service-section {
    margin-bottom: 1.25rem;
}

.service-section h4 {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    column-gap: 1.4rem;
    row-gap: 0;
}

.service-list span {
    padding: 0.42rem 0;
    color: var(--text-color);
    font-size: 0.92rem;
    line-height: 1.32;
    border-bottom: 1px solid #f0f0f0;
}

.reviewer-list {
    list-style: none;
    padding: 0;
}

.reviewer-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: baseline;
    gap: 1rem;
    padding: 0.44rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.reviewer-item:first-child {
    padding-top: 0;
}

.reviewer-item:last-child {
    border-bottom: none;
}

.reviewer-title {
    color: var(--text-color);
    font-size: 0.92rem;
    line-height: 1.35;
}

.reviewer-years {
    color: var(--light-text-color);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
}



/* --- Footer --- */
footer {
    background-color: #f8f9fa;
    padding: 40px 0 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-social {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: white;
    color: var(--light-text-color);
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.footer-social a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,82,155,0.2);
}

.footer-text {
    text-align: center;
    color: var(--light-text-color);
    font-size: 0.9rem;
}

.footer-text p {
    margin-bottom: 0.3rem;
}

.footer-location {
    color: var(--primary-color);
    font-weight: 500;
}

/* --- Back to Top Button --- */
#back-to-top-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 18px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#back-to-top-btn:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
}

/* --- Mobile Menu Toggle --- */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* --- Responsive Design --- */
@media (max-width: 1100px) {
    #main-header nav {
        padding: 0 24px;
    }

    #main-header .nav-links li {
        margin-left: 16px;
    }

    #main-header .nav-links a {
        font-size: 0.92rem;
    }
}

@media (max-width: 768px) {
    /* Base Typography */
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    /* Header Mobile */
    #main-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    #main-header nav {
        height: 60px;
        position: relative;
        padding: 0 20px; /* Reduce padding for mobile */
    }
    
    #main-header .logo a {
        font-size: 1rem;
        font-weight: 600;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    #main-header .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    #main-header .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    #main-header .nav-links li {
        margin: 0;
        text-align: center;
        padding: 10px 0;
    }
    
    #main-header .nav-links a {
        font-size: 1.1rem;
        padding: 15px 20px;
        display: block;
        border-bottom: none;
        border-radius: 8px;
        margin: 0 20px;
        transition: all 0.3s ease;
    }
    
    #main-header .nav-links a:hover {
        background-color: var(--primary-color);
        color: white;
    }
    
    /* Main Content Mobile - Override desktop padding */
    main.container {
        padding-top: 140px !important; /* Extra space to prevent overlap with fixed header */
    }
    
    /* Hero Section Mobile */
    main .hero-section#about {
        padding: 20px 0 60px 0 !important; /* Reduced top padding since main already has padding */
        min-height: auto !important;
    }
    
    .hero-header {
        margin-bottom: 30px;
        padding: 0 10px;
    }
    
    .hero-header h1 {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .hero-header .subtitle {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-header .email {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-header .roles {
        font-size: 0.85rem;
        line-height: 1.4;
        padding: 0 10px;
    }
    
    .hero-main {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .hero-left {
        flex: none;
        width: 100%;
        align-items: center;
    }
    
    .profile-photo-container {
        width: 180px;
        margin-bottom: 15px;
    }
    
    .hero-description {
        padding: 0 10px;
    }
    
    .hero-description p {
        font-size: 0.9rem;
        text-align: left;
        line-height: 1.6;
        margin-bottom: 1.2rem;
    }
    
    .cta-buttons {
        width: 180px;
        gap: 8px;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .contact-text-links {
        justify-content: center;
        width: 100%;
        font-size: 0.8rem;
        line-height: 1.4;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    /* Research Interests Mobile */
    .research-interest-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .research-interest-item span {
        font-size: 0.9rem;
    }

    .news-item {
        grid-template-columns: 1fr;
        gap: 0.12rem;
        padding: 0.6rem 0;
    }

    .news-date {
        font-size: 0.78rem;
    }

    .news-body p {
        font-size: 0.84rem;
        line-height: 1.42;
    }

    /* Publications Mobile */
    .publication-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 0.55rem;
        padding-bottom: 0.65rem;
    }

    .publication-view-toggle {
        width: 100%;
    }

    .publication-view-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.82rem;
    }

    #publication-year-view {
        --publication-timeline-line: 0.28rem;
        --publication-timeline-content: 1.55rem;
        padding-left: var(--publication-timeline-content);
    }

    #publication-year-view::before {
        left: var(--publication-timeline-line);
    }

    .publication-year-group {
        margin-bottom: 1.25rem;
    }

    .publication-year-group::before {
        top: 0.36rem;
    }

    .publication-heading-main {
        gap: 0.35rem;
    }

    .publication-year-heading {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.4rem;
        position: static;
        width: auto;
        text-align: left;
        margin-bottom: 0.45rem;
    }

    .publication-year-label {
        display: inline;
        font-size: 1rem;
    }

    .publication-year-heading .publication-count {
        margin-top: 0;
    }

    .publication-year-type {
        margin-left: 0;
        padding-left: 0;
    }

    .publication-list li {
        font-size: 0.85rem;
        line-height: 1.42;
        margin-bottom: 0.55rem;
        padding-left: 0.65rem;
    }

    .publication-item {
        grid-template-columns: 1fr;
        gap: 0.34rem;
    }

    .publication-copy-actions {
        margin-top: 0;
        flex-wrap: wrap;
    }

    .publication-copy-btn {
        min-height: 1.7rem;
        font-size: 0.7rem;
    }

    .doi-link {
        display: inline;
        margin: 0 0 0 0.2rem;
        overflow-wrap: anywhere;
    }

    .publication-tags {
        margin-left: 0.25rem;
    }

    .publication-tag {
        font-size: 0.68rem;
    }
    
    .google-scholar-note {
        font-size: 0.75rem;
        display: block;
        margin-top: 0.5rem;
        margin-left: 0;
    }
    
    /* Projects Mobile */
    .project-item {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.2rem;
        text-align: center;
    }
    
    .project-image-link {
        width: 180px;
        height: 100px;
        align-self: center;
        min-height: auto;
    }
    
    .project-content {
        text-align: left;
    }
    
    .project-item h3 {
        font-size: 1.1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .project-role {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .project-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .tech-stack {
        gap: 4px;
        margin-top: 0.6rem;
    }
    
    .tech-stack span {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .project-icon {
        font-size: 2rem;
    }
    
    /* Awards Section Mobile */
    .awards-list li,
    .activities-list li {
        grid-template-columns: 1fr;
        gap: 0.16rem;
        padding: 0.5rem 0;
    }
    
    .award-date,
    .activity-date {
        justify-self: start;
        margin-top: 0;
        margin-bottom: 0;
    }

    .award-venue,
    .activity-venue,
    .award-description {
        grid-column: 1;
    }
    
    .service-list {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .service-list span {
        font-size: 0.85rem;
        padding: 6px 0;
    }

    .reviewer-item {
        grid-template-columns: 1fr;
        gap: 0.08rem;
        padding: 0.48rem 0;
    }

    .reviewer-title {
        font-size: 0.85rem;
        line-height: 1.32;
    }

    .reviewer-years {
        color: var(--light-text-color);
        font-size: 0.78rem;
        text-align: left;
    }
    
    /* Footer Mobile */
    .footer-social {
        gap: 12px;
    }
    
    .footer-social a {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .footer-text {
        font-size: 0.8rem;
    }
    
    /* Back to Top Button Mobile */
    #back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* --- Chatbot Styles --- */
.chip-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chip-chatbot-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 82, 155, 0.3);
}

.chip-chatbot-toggle:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(250, 70, 22, 0.4);
}

.chatbot-icon {
    font-size: 18px;
}

.chip-chatbot-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Full width chat mode */
.chip-chatbot-window.full-width {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 50%;
    width: 50%;
    height: 100vh;
    border-radius: 0;
    border-left: 1px solid var(--border-color);
    z-index: 999;
    /* Ensure proper viewport handling */
    height: 100dvh;
    min-height: 100vh;
}

/* Body adjustment for full width chat */
body.chat-full-width {
    margin-right: 50%;
    transition: margin-right 0.3s ease;
}

.chatbot-header {
    background: var(--primary-color);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: white;
}

.chatbot-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Full width toggle button special styling */
#full-width-toggle {
    background: rgba(255, 255, 255, 0.15);
}

#full-width-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Enhanced chat messages for full width mode */
.chip-chatbot-window.full-width .chat-messages {
    padding: 20px;
    gap: 16px;
    /* Ensure messages don't overlap with input area */
    padding-bottom: 100px;
}

.message {
    max-width: 80%;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
}

/* Full width message adjustments */
.chip-chatbot-window.full-width .message {
    max-width: 70%;
}

.chip-chatbot-window.full-width .user-message {
    max-width: 70%;
}

.chip-chatbot-window.full-width .assistant-message {
    max-width: 70%;
}

.message p {
    margin: 0;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 14px;
}

/* Enhanced text size for full width mode */
.chip-chatbot-window.full-width .message p {
    font-size: 16px;
    padding: 12px 18px;
}

/* Desktop full-width input container adjustments */
.chip-chatbot-window.full-width .chat-input-container {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    /* Ensure input area is always visible */
    z-index: 10;
}

.user-message {
    align-self: flex-end;
}

.user-message p {
    background: var(--primary-color);
    color: white;
}

.assistant-message {
    align-self: flex-start;
}

.assistant-message p {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* Markdown HTML elements styling */
.assistant-message p a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease;
}

.assistant-message p a:hover {
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

.assistant-message p strong {
    font-weight: 600;
    color: var(--text-color);
}

.assistant-message p em {
    font-style: italic;
    color: var(--text-color);
}

.assistant-message p code {
    background: #f8f9fa;
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    border: 1px solid #e9ecef;
}

/* Loading message styles */
.loading-message p {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f0f0;
    color: var(--light-text-color);
    font-style: italic;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

.dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    border-color: var(--primary-color);
}

#chat-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.send-btn:hover:not(:disabled) {
    background: var(--hover-color);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Confirmation Modal Styles */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modal-slide-in 0.3s ease-out;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h4 {
    color: var(--text-color);
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
}

.modal-content p {
    color: var(--light-text-color);
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-confirm, .btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.btn-confirm {
    background: #dc3545;
    color: white;
}

.btn-confirm:hover {
    background: #c82333;
    transform: translateY(-1px);
}

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

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Chrome mobile specific variables */
    :root {
        --chrome-bottom-spacing: 35px;
        --chrome-safe-area: 15px;
    }
    
    .chip-chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chip-chatbot-window {
        width: calc(100vw - 30px);
        right: 0;
        bottom: 70px;
        height: 450px;
    }
    
    /* Full width mode for mobile */
    .chip-chatbot-window.full-width {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        z-index: 999;
        /* Ensure proper mobile viewport handling */
        height: 100dvh; /* Use dynamic viewport height for mobile */
        min-height: 100vh; /* Fallback for older browsers */
    }
    
    /* Mobile body adjustment */
    body.chat-full-width {
        margin-right: 0;
        overflow: hidden;
    }
    
    .chatbot-text {
        display: none;
    }
    
    .chip-chatbot-toggle {
        padding: 12px;
        border-radius: 50%;
        min-width: 48px;
        min-height: 48px;
        justify-content: center;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn-confirm, .btn-cancel {
        width: 100%;
    }
    
    /* Enhanced mobile chat messages */
    .chip-chatbot-window.full-width .chat-messages {
        padding: 16px;
        gap: 12px;
        /* Ensure messages don't overlap with input area - optimized spacing */
        padding-bottom: 90px;
        /* Smooth scrolling for mobile */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .chip-chatbot-window.full-width .message p {
        font-size: 15px;
        padding: 10px 14px;
    }
    
    .chip-chatbot-window.full-width .message {
        max-width: 85%;
    }
    
    /* Mobile full-width input container adjustments */
    .chip-chatbot-window.full-width .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        border-top: 1px solid var(--border-color);
        padding: 16px;
        /* Ensure input is above mobile browser UI */
        z-index: 1000;
        /* Enhanced safe area padding for Chrome mobile - reduced spacing */
        padding-bottom: calc(var(--chrome-safe-area) + env(safe-area-inset-bottom) + 30px);
        /* Ensure proper mobile positioning */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        /* Additional Chrome mobile optimization */
        min-height: 65px;
    }
    
    /* Chrome mobile specific styling */
    .chip-chatbot-window.full-width .chat-input-container.chrome-mobile {
        /* Optimized Chrome mobile spacing */
        padding-bottom: calc(var(--chrome-safe-area) + env(safe-area-inset-bottom) + 25px);
        /* Ensure input is always visible above Chrome UI */
        z-index: 1001;
        /* Force Chrome mobile positioning */
        position: fixed !important;
        bottom: 0 !important;
        /* Additional Chrome mobile safeguards */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* Chrome mobile input field optimization */
    .chip-chatbot-window.full-width.chrome-mobile #chat-input {
        /* Prevent Chrome zoom on focus */
        font-size: 16px !important;
        /* Ensure proper touch target size */
        min-height: 44px;
    }
    
    /* Optimize mobile input container spacing */
    .chip-chatbot-window.full-width .chat-input-container {
        /* Reduce unnecessary padding on mobile */
        padding-top: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom) + 20px);
    }
    
    /* Mobile input field optimization */
    .chip-chatbot-window.full-width #chat-input {
        /* Optimize mobile input size */
        padding: 10px 14px;
        margin-bottom: 0;
    }
    
    /* Mobile send button optimization */
    .chip-chatbot-window.full-width .send-btn {
        /* Optimize mobile button size */
        padding: 10px 16px;
        margin-bottom: 0;
    }
    
    /* Ensure input and button are properly sized on mobile */
    .chip-chatbot-window.full-width #chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    .chip-chatbot-window.full-width .send-btn {
        padding: 12px 20px;
        font-size: 16px;
    }
}
