/* ===================================
   ACADEMIC WEBSITE STYLESHEET
   Author: Emanuele Luzzi
   Description: Clean, professional styling for academic portfolio
   =================================== */

/* ===================================
   1. CSS RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================================
   2. CSS VARIABLES
   =================================== */
:root {
    /* Color Palette */
    --primary-color: #2c3e50;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --link-color: #2980b9;
    --paperbox-color: #f0f7ff;
    
    /* Layout */
    --max-width: 1100px;
    --nav-height: 60px;
    
    /* Spacing */
    --section-spacing: 100px;
    --content-padding: 40px;
}

/* ===================================
   3. GLOBAL STYLES
   =================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: white;
    font-size: 16px;
}

html {
    scroll-behavior: smooth;
}

/* ===================================
   4. NAVIGATION STYLES
   =================================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: white;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 20px 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    font-weight: 400;
}

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


/* ===================================
   5. MAIN CONTENT CONTAINER
   =================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 120px var(--content-padding) 80px;
}

/* ===================================
   6. SECTION STYLES
   =================================== */
section {
    margin-bottom: var(--section-spacing);
    scroll-margin-top: 80px;
}

.section-divider {
    width: 100%;
    height: 3px;
    margin: 50px 0;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 40px;
    color: var(--primary-color);
    letter-spacing: -0.3px;
}

/* ===================================
   7. INTRODUCTION/HOME SECTION - UPDATED
   =================================== */
.intro {
    margin-bottom: 120px;
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.profile-image-container {
    flex-shrink: 0;
}

.profile-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
}

.intro-content {
    flex: 1;
}

.intro h1 {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.intro .subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 400;
}

.intro .affiliation {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.intro .interests {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* Bio - More prominent, direct style */
.intro .bio {
    font-size: 16px;
    line-height: 1.7;
    color: #444;
    margin-top: 24px;
    margin-bottom: 20px;
    max-width: 700px;
}

.contact-links {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.contact-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 5px;
}

.contact-links a:hover {
    background: var(--light-gray);
    border-color: var(--border-color);
}

/* ===================================
   8. RESEARCH SECTION WITH SUBSECTIONS
   =================================== */

/* Research subsection styling */
.research-subsection {
    margin-bottom: 60px;
}

.research-subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Papers list styling */
.papers-list, .wip-list, .publications-list {
    margin-top: 0;
}

.paper-item {
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--paperbox-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.wip-list .paper-item {
    background: white;
    border-left: 3px solid #e0e0e0;
    padding: 12px 16px;
    box-shadow: none;
}

.wip-list .paper-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left-color: #2980b9;
}

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

.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.paper-title-section {
    flex: 1;
}

.paper-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
    line-height: 1.5;
}

.paper-coauthors {
    font-size: 14px;
    color: #666;
    margin-top: 3px;
    font-style: normal;
}

.paper-status {
    font-size: 14px;
    color: #2980b9;
    margin-top: 3px;
    font-weight: 500;
}

.paper-conference {
    font-size: 13px;
    color: #888;
    margin-top: 3px;
    font-style: normal;
}

.paper-prizes {
    font-size: 14px;
    color: #27ae60;
    margin-top: 3px;
    font-weight: 500;
}

.expand-icon {
    font-size: 13px;
    color: var(--link-color);
    border: 1px solid var(--link-color);
    border-radius: 4px;
    padding: 3px 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
    margin-top: 2px;
}

.paper-item:hover .expand-icon {
    background: var(--link-color);
    color: white;
}

.paper-item.expanded .expand-icon {
    content: "Less ‹";
    background: var(--link-color);
    color: white;
}

.paper-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.paper-item.expanded .paper-details {
    max-height: 2000px;
    margin-top: 25px;
}

/* Paper Content - Two-panel side by side */
.paper-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
}

.paper-text {
    flex: 1;
    min-width: 0;
}

.paper-figure {
    flex: 0 0 420px;
    width: 420px;
}

.paper-figure img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: white;
    padding: 10px;
}

.figure-caption {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.abstract-label {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.abstract-text {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
    text-align: justify;
}

.paper-links {
    display: flex;
    gap: 8px;
    margin-top: 0;
}

.paper-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid var(--link-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.paper-links a:hover {
    background: var(--link-color);
    color: white;
}

/* ===================================
   9. DISCUSSIONS & TEACHING (compact)
   =================================== */

.discussions-content,
.teaching-content {
    font-size: 14px;
    line-height: 1.5;
}

.discussion-item,
.course-item {
    margin-bottom: 4px;
    padding: 6px 14px;
    background: white;
    border-left: 3px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    transition: all 0.3s ease;
}

.discussion-item:hover,
.course-item:hover {
    border-left-color: var(--link-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.discussion-title,
.course-title {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 15px;
    margin-bottom: 0;
}

.discussion-authors,
.course-role {
    width: 100%;
    color: #666;
    font-size: 13px;
    font-style: normal;
    margin-top: 1px;
    margin-bottom: 0;
}

.discussion-date {
    color: #888;
    font-size: 13px;
    font-style: italic;
    margin-bottom: 0;
}

.course-details {
    color: #888;
    font-size: 13px;
    font-style: normal;
    margin-bottom: 0;
}

.discussion-link {
    margin-left: auto;
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
}

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

.course-description,
.discussion-desc {
    width: 100%;
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}

/* ===================================
   10. PAPER FOOTER ROW
   =================================== */
.paper-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.paper-footer-links {
    display: flex;
    gap: 8px;
}

.paper-footer-links a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid var(--link-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.paper-footer-links a:hover {
    background: var(--link-color);
    color: white;
}

.paper-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ===================================
   11. FOOTER
   =================================== */
footer {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 12px;
    border-top: 1px solid var(--border-color);
}

/* ===================================
   12. RESPONSIVE DESIGN (MOBILE)
   =================================== */
@media (max-width: 768px) {
    .paper-header {
        flex-direction: column;
        gap: 10px;
    }

    nav {
        padding: 12px 0 10px;
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-links {
        gap: 18px;
        flex-wrap: wrap;
    }

    .nav-links a {
        font-size: 13px;
    }
    
    .container {
        padding: 120px 20px 60px;
    }
    
    .intro {
        flex-direction: column;
        gap: 30px;
    }
    
    .profile-image {
        display: block;
        margin: 0 auto;
    }
    
    .intro h1 {
        font-size: 28px;
    }

    .intro .subtitle {
        font-size: 16px;
    }

    .intro .bio {
        font-size: 15px;
    }

    h2 {
        font-size: 20px;
    }
    
    .contact-links {
        flex-wrap: wrap;
    }
    
    .paper-content {
        flex-direction: column;
    }

    .paper-figure {
        flex: none;
        width: 100%;
    }
    
    .paper-header {
        flex-direction: column;
        gap: 10px;
    }

    .expand-icon {
        align-self: flex-start;
    }
}