/* Variables */
:root {
    --primary-color: #2c5aa0;
    --text-color: #333;
    --text-light: #666;
    --background: #fffef8;
    --border-color: #e5e4df;
    --hover-bg: #f7f6f0;
    --code-bg: #f6f5ed;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #5b8fd8;
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --background: #1a1a1a;
        --border-color: #333;
        --hover-bg: #252525;
        --code-bg: #2a2a2a;
    }
}

/* Force dark mode when manually set */
:root[data-theme="dark"] {
    --primary-color: #5b8fd8;
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --background: #1a1a1a;
    --border-color: #333;
    --hover-bg: #252525;
    --code-bg: #2a2a2a;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background: var(--background);
}

html {
    scroll-behavior: smooth;
}

/* Fix scroll offset for fixed navbar */
section {
    scroll-margin-top: 80px;
}

/* Navigation */
#navbar {
    position: sticky;
    top: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.nav-container a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-container a:hover {
    color: var(--primary-color);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* Section */
/* Section */
.section {
    margin-bottom: 3rem;
    padding-top: 1.5rem;
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3rem;
    align-items: start;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}


.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.about-text h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
    white-space: pre-line;
}

.about-text p a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.about-text p a:hover {
    border-bottom-color: var(--primary-color);
}

.interests {
    margin-bottom: 1.5rem;
}

.interests h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.interests ul {
    list-style: none;
    color: var(--text-light);
}

.interests li {
    padding: 0.3rem 0;
}

.interests li:before {
    content: "▸ ";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Links */
.links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    max-width: 190px;
    margin: 0 auto;
}

.links a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    width: 100%;
    height: 42px;
    padding: 0 0.6rem;
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.links a:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.icon-label {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 0;
    text-align: left;
}
.scholar-icon {
    width: 22px;
    height: 22px;
}

.news {
    margin: 1.5rem 0;
}

.news h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.news ul {
    list-style: none;
    color: var(--text-light);
}

.news-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

.news-text {
    color: var(--text-color);
    font-size: 0.95rem;
}

.news-text a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.news-text a:hover {
    border-bottom-color: var(--primary-color);
}

.cv-icon {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

/* Publications */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0;
}

.publication-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.publication-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.publication-thumbnail {
    width: 150px;
    height: 150px;
    object-fit: contain;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
    background: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 3rem;
}

.publication-thumbnail[data-pdf="true"] {
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--border-color);
}

.publication-thumbnail:hover {
    transform: scale(1.05);
}

.publication-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.publication-content h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.publication-content h3 a:hover {
    color: var(--primary-color);
}

.publication-venue {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-color);
    background: var(--hover-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.publication-authors {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.publication-links {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.publication-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-color);
    background: var(--hover-bg);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.publication-links a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.publication-tldr {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.publication-tldr strong {
    color: var(--text-color);
}

.publications-more {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

#publications-load-more {
    background: var(--hover-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#publications-load-more:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* Experience */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
}

.experience-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--background);
    transition: all 0.2s;
}

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

.experience-callout {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.experience-icon {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

.experience-item h3 {
    font-size: 1.1rem;
    margin: 0 0 0.3rem 0;
    font-weight: 600;
    color: var(--text-color);
}

.experience-company {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0 0 0.2rem 0;
}

.experience-year {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Services */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
}

.service-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.service-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex-shrink: 0;
}

.service-role {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    flex-grow: 1;
}

.service-year {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
    flex-shrink: 0;
}

/* Awards */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
}

.award-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.award-title {
    font-weight: 500;
    color: var(--text-color);
    font-size: 1rem;
    margin: 0;
    flex-grow: 1;
}

.award-year {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Footer */
footer {
    background: var(--hover-bg);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-links {
    max-width: 1000px;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.footer-links-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.footer-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--background);
    transition: all 0.2s;
}

.footer-link:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.footer-link-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.footer-link-desc {
    color: var(--text-light);
    font-size: 0.85rem;
    word-break: break-word;
}

/* Responsive Design */
/* Tablet and medium screens */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    section {
        scroll-margin-top: 120px;
    }

    #navbar {
        padding: 0.75rem 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-section {
        margin: 0 auto;
    }
    
    .profile-photo {
        margin: 0 auto;
    }
    
    .publication-item {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .publication-thumbnail {
        width: 100%;
        height: auto;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .nav-container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .nav-links {
        order: 2;
        width: 100%;
        justify-content: flex-start;
        gap: 1.2rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        white-space: nowrap;
        font-size: 0.95rem;
    }
    
    .theme-toggle {
        order: 1;
        margin-left: auto;
    }
    
    .container {
        padding: 1rem;
    }

    .footer-links {
        margin: 0 auto 1.25rem;
    }
    
    .about-text h1 {
        font-size: 2rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    .experience-item {
        grid-template-columns: 1fr;
    }
}

/* Small phones */
@media (max-width: 480px) {
    section {
        scroll-margin-top: 130px;
    }

    .container {
        padding: 0.75rem;
    }
    
    .publication-item {
        padding: 0.75rem;
    }
    
    .about-text h1 {
        font-size: 1.75rem;
    }
    
    .section h2 {
        font-size: 1.3rem;
    }
    
    .links {
        max-width: 280px;
    }

    .links a {
        width: 100%;
        height: 44px;
        justify-content: center;
        gap: 0.6rem;
        padding: 0 0.8rem;
    }

    .icon-label {
        margin-left: 0;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }
}
