/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --border: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
header {
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 16px 0;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent);
    border-radius: 1px;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: border-color 0.2s ease;
}

#theme-toggle:hover {
    border-color: var(--accent);
}

/* Show/hide sun/moon based on theme */
.sun { display: inline; }
.moon { display: none; }

[data-theme="dark"] .sun { display: none; }
[data-theme="dark"] .moon { display: inline; }

/* Main content */
main {
    padding: 48px 0;
}

/* Section headings */
section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* About section */
.about {
    margin-bottom: 64px;
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.about-text {
    flex: 1;
}

.about-image {
    flex-shrink: 0;
}

.about-image img {
    width: 240px;
    height: 320px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px var(--shadow);
}

.about-social {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-bottom: 4px;
}

.about-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.about-social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.about-social a svg {
    width: 22px;
    height: 22px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.about-text p {
    margin-bottom: 16px;
}

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

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

.contact {
    margin-top: 16px;
}

/* Research section */
.research {
    margin-bottom: 64px;
}

.research > p {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.research-list {
    list-style: disc;
    padding-left: 24px;
    margin-top: 16px;
}

.research-list li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.research-list li strong {
    color: var(--text-primary);
}

/* Publications section */
.publications {
    margin-bottom: 64px;
}

.publication {
    margin-bottom: 24px;
    padding: 24px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.publication h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

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

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

.publication .authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.publication .venue {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 12px;
}

.publication .links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.publication .links a {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.publication .links a:hover {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* News section */
.news {
    margin-bottom: 64px;
}

.news-list {
    list-style: none;
}

.news-list li {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

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

.news-date {
    flex-shrink: 0;
    width: 80px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}

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

/* Footer */
footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 640px) {
    .about-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-image img {
        width: 150px;
        height: 200px;
    }

    h1 {
        font-size: 1.75rem;
    }

    nav {
        flex-wrap: wrap;
    }

    .nav-links {
        gap: 12px;
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 12px;
    }

    .nav-links a {
        font-size: 14px;
    }

    #theme-toggle {
        order: 1;
        margin-left: auto;
    }

    .publication {
        padding: 16px;
    }

    .publication .links {
        gap: 8px;
    }

    .publication .links a {
        padding: 5px 10px;
        font-size: 0.85rem;
    }

    .news-list li {
        flex-direction: column;
        gap: 4px;
    }

    .news-date {
        width: auto;
    }
}

/* Print styles */
@media print {
    header,
    #theme-toggle,
    .social-links {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    main {
        padding: 0;
    }

    section {
        page-break-inside: avoid;
        margin-bottom: 24pt;
    }

    .about-content {
        gap: 24pt;
    }

    .about-image img {
        width: 120px;
        height: 120px;
    }

    h1 {
        font-size: 18pt;
    }

    h2 {
        font-size: 14pt;
        border-bottom-color: #000 !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }

    .publication,
    .research-area {
        background: none !important;
        border: 1px solid #ccc !important;
        padding: 12pt;
    }

    .publication .links a {
        border: none !important;
        padding: 0;
        margin-right: 12pt;
    }

    .publication .links a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
}
