/* General Body Styles */
body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    background-color: #f8f9fa; /* Light gray background */
    color: #343a40; /* Darker gray for text */
    margin: 0;
}

a {
    color: #0056b3; /* A nice blue for links */
    text-decoration: none;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Header and Navigation */
.header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: flex-end; /* Pushes nav to the right on desktop */
    align-items: center;
    max-width: 1250px; 
    margin: 0 auto;
    height: 64px;
}

.header-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #343a40;
    margin: 0;
    display: none; /* Hide on desktop by default */
}

.topnav {
    display: flex; /* Ensure nav items are in a row on desktop */
}

.topnav a {
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
}

.topnav a:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.topnav a.active {
    background-color: #0056b3;
    color: white;
    font-weight: 600;
}

.header .icon {
    display: none; /* Hidden on desktop */
    font-size: 1.5rem;
    color: #343a40;
    cursor: pointer;
}

/* --- Two Column Layout --- */
.site-container {
    display: flex;
    max-width: 1250px; 
    margin: 1.5rem auto; /* Reduced top/bottom margin */
    padding: 0 1rem;
    gap: 2rem; 
    align-items: flex-start;
}

.left-panel {
    flex: 0 0 320px; 
    position: sticky;
    top: 80px; /* Adjusted sticky position */
}

.main-content {
    flex: 1; /* Main content takes the remaining space */
}
/* --- End Two Column Layout --- */


/* Card Style */
.card {
    background-color: white;
    border-radius: 12px;
    margin-bottom: 1.25rem; /* Reduced margin */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.card-content {
    padding: 1.25rem; 
}

.main-content .card:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.25rem; 
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
}

/* Profile Card Specifics */
.profile-card {
    padding: 1.25rem; 
    text-align: center;
}

.profile-card #name {
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.profile-card p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
}

.profile-card b {
    font-weight: 600;
}

.profile-img {
    max-width: 220px; /* Constrain image width */
    width: 100%;
    height: auto; 
    display: block;
    margin: 0 auto 1.5rem; /* Center the image */
    border-radius: 12px;
}

/* --- Link and List Styles --- */
.btn-link {
    display: inline-block;
    background-color: #e9ecef;
    color: #343a40;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.btn-link:hover {
    background-color: #dee2e6;
    color: #212529;
    text-decoration: none;
}

.link-group {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.styled-list, .research-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0.75rem;
}

.styled-list li, .research-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.styled-list li::before, .research-list li::before {
    content: '■';
    position: absolute;
    left: 0;
    top: 1px;
    color: #0056b3;
    font-size: 0.8rem;
}

/* --- Publication/Event List Styles --- */
.publication-list, .event-list {
    margin-top: 0;
    padding-left: 0;
    list-style-type: none;
}

.preprints-list { counter-reset: pub-counter 30; }
.papers-list { counter-reset: pub-counter 24; }

.publication-item {
    position: relative;
    padding-left: 2.2rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    counter-increment: pub-counter -1;
}

.publication-item::before {
    content: counter(pub-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    color: #6c757d;
}

.publication-item:last-child, .event-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.publication-item p, .event-item p { margin: 0; }
.publication-title, .event-title { font-weight: 600; }
.publication-authors, .event-details {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0.25rem 0 0.5rem;
}
.publication-links, .event-link { font-size: 0.9rem; }

.publication-note {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 1.5rem;
    text-align: center;
}

.event-item {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* --- Other/Thesis Styles --- */
.thesis-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-top: 1.5rem;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive Design for Mobile */
@media (max-width: 992px) {
    body { font-size: 14px; }
    .site-container {
        flex-direction: column;
        margin: 0.75rem auto;
        gap: 0.75rem;
    }
    .card { margin-bottom: 0.75rem; }
    .card-content { padding: 0.85rem; }
    .card-content p { margin-bottom: 0.85rem; }
    .section-title { font-size: 1.25rem; }
    .main-content { order: 1; }
    .left-panel {
        order: 2;
        position: static;
        width: 100%;
        flex-basis: auto;
    }
    .profile-card {
        overflow: auto;
        padding: 0.85rem;
    }
    .profile-img {
        float: left;
        width: 140px;
        margin: 0 1rem 0.5rem 0;
    }
    .profile-card #name { display: none; }
    .profile-card p {
        margin-bottom: 0.25rem;
        font-size: 12px;
        line-height: 1.4;
    }
    .publication-item { padding-left: 1.75rem !important; }
    .publication-item p { margin-bottom: 0.0rem !important; }
    .publication-item .publication-authors { margin: 0.0rem !important; }
    
    /* Hide profile panel on non-home pages on mobile */
    .left-panel:not(.home-profile-panel) {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content { justify-content: space-between; }
    .header-name {
        display: block;
        flex-grow: 1;
    }
    .topnav { display: none; }
    .topnav.responsive {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid #e9ecef;
    }
    .topnav.responsive a {
        display: block;
        padding: 0.75rem;
        text-align: left;
    }
    .header .icon { display: block; }
}
