/* 
 * Junwen Gu's Personal Website
 * Academic Style CSS
 */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #222;
    background-color: #fff;
}

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

/* ==================== Links ==================== */
a {
    color: #1772d0;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #f09228;
    text-decoration: none;
}

a.disabled {
    color: #999;
    cursor: not-allowed;
}

/* ==================== Header ==================== */
.header {
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    gap: 30px;
    align-items: center;
}

.header-text {
    flex: 1;
}

.header-photo {
    flex-shrink: 0;
    width: 30%;
    max-width: 200px;
    display: flex;
    align-items: center;
}

.name {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 8px;
    text-align: center;
}

.title {
    font-size: 15px;
    font-weight: 300;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.bio {
    margin-bottom: 20px;
}

.bio p {
    margin-bottom: 10px;
    text-align: justify;
}

.bio strong {
    font-weight: 500;
    color: #111;
}

.profile-photo {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================== Contact Links ==================== */
.contact-links {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.contact-links a,
.contact-links .dropdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 14px;
    white-space: nowrap;
}

.contact-links .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Dropdown for CV */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 100px;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

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

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

/* ==================== Sections ==================== */
.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.subsection-title {
    font-size: 18px;
    font-weight: 500;
    margin: 30px 0 15px 0;
    color: #444;
}

/* ==================== Education ==================== */
.education-item {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 0;
    border-left: none;
}

.education-logo {
    width: auto;
    height: 90px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 20px;
}

.education-divider {
    width: 3px;
    height: 90px;
    background-color: #1772d0;
    flex-shrink: 0;
    margin-right: 30px;
}

.education-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.education-school {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.education-degree {
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
}

.education-date {
    font-size: 14px;
    color: #555;
    margin-bottom: 4px;
}

.education-honors {
    font-size: 14px;
    color: #333;
}

.highlight {
    background-color: #ffffd0;
    padding: 1px 4px;
    border-radius: 2px;
}

/* ==================== Research Interests ==================== */
.research-interests {
    list-style: none;
    padding-left: 0;
}

.research-interests li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}

.research-interests li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1772d0;
    font-weight: bold;
}

/* ==================== Publications ==================== */
.publication-note {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.publication-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.publication-image {
    flex-shrink: 0;
    width: 230px;
}

.image-wrapper {
    position: relative;
    width: 230px;
    height: 165px;
}

.image-static {
    width: 230px;
    height: 165px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 230px;
    height: 165px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-hover img {
    width: 230px;
    height: 165px;
    object-fit: contain;
    border-radius: 4px;
}

.publication-content {
    flex: 1;
}

.paper-title {
    font-size: 15px;
    font-weight: 500;
    color: #1772d0;
}

.paper-title:hover {
    color: #f09228;
}

.paper-authors {
    font-size: 14px;
    color: #222;
}

.paper-authors strong {
    font-weight: 500;
}

.paper-venue {
    font-size: 14px;
    color: #333;
}

.paper-venue em {
    font-style: italic;
}

.paper-links {
    font-size: 14px;
}

.paper-links a {
    margin-right: 5px;
}

.paper-abstract {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* ==================== Footer ==================== */
.footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 14px;
    color: #888;
}

.last-updated {
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .header-photo {
        width: 60%;
        max-width: 200px;
        margin-bottom: 20px;
    }

    .name {
        font-size: 26px;
    }

    .bio p {
        text-align: left;
    }

    .contact-links {
        justify-content: center;
    }

    .publication-item {
        flex-direction: column;
    }

    .publication-image {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .image-wrapper,
    .image-static,
    .image-hover,
    .image-hover img {
        width: 100%;
        max-width: 300px;
        height: auto;
        aspect-ratio: 230 / 165;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: 22px;
    }

    .section-title {
        font-size: 20px;
    }

    .contact-links {
        gap: 8px;
    }

    .contact-links a {
        font-size: 13px;
        padding: 3px 6px;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease-out;
}

/* ==================== Print Styles ==================== */
/* Responsive Design */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .header-photo {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
    }

    .name {
        font-size: 28px;
    }

    .contact-links {
        gap: 10px;
    }

    .contact-links a,
    .contact-links .dropdown {
        font-size: 13px;
        padding: 5px 10px;
    }

    /* Education responsive styles */
    .education-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .education-logo {
        height: 50px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .education-divider {
        display: none;
    }
}

@media print {
    .container {
        max-width: 100%;
    }

    .header-photo {
        width: 150px;
    }

    .publication-image {
        display: none;
    }

    a {
        color: #333;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 12px;
        color: #666;
    }
}
