body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #fdfdfd;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex; /* Enable flexbox for sidebar layout */
}
.sidebar {
    width: 220px; /* Fixed width for the sidebar */
    background-color: #f0f0f0;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    min-height: 100vh; /* Make sidebar fill the height */
}
.sidebar h2 {
    color: #333;
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 20px;
}
.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.sidebar li {
    margin-bottom: 10px;
}
.sidebar a {
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
    display: block;
    padding: 5px 0;
    border-radius: 4px;
}
.sidebar a:hover {
    text-decoration: underline;
    background-color: #e0e0e0;
}
/* This class highlights the current page in the menu */
.sidebar a.active {
    color: #111;
    font-weight: 900;
}

.main-content {
    flex-grow: 1; /* Main content takes remaining space */
    max-width: 900px;
    padding: 20px 40px;
}
header {
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}
h1 {
    color: #111;
    margin: 0;
    font-size: 2.2em; /* Adjusted for longer title */
}

/* --- Profile Section (index.html only) --- */
.profile-section {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    gap: 30px; /* Space between image and text */
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.profile-image {
    width: 150px; /* Fixed width for the profile image */
    height: 150px;
    border-radius: 5px; /* Slightly rounded corners */
    object-fit: cover; /* Ensures image covers area without distortion */
    border: 1px solid #ddd; /* Small border around image */
}
.profile-details {
    flex-grow: 1;
}
.profile-details p {
    margin: 5px 0;
    font-size: 1.1em;
    color: #444;
}
.profile-details a {
    color: #0056b3;
    text-decoration: none;
}
.profile-details a:hover {
    text-decoration: underline;
}

/* --- General Content Styles --- */
h2 {
    font-size: 1.8em;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 40px;
}
h3 {
    font-size: 1.3em;
    color: #444;
    margin-top: 25px;
}
ul {
    list-style-type: none;
    padding-left: 0;
}
ul.nested-list { /* For teaching page */
    list-style-type: disc;
    padding-left: 30px;
    margin-top: 10px;
}
li {
    margin-bottom: 15px;
}

/* --- Publication List Style --- */
.publication-list li {
    padding-left: 20px;
    position: relative;
}
.publication-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #555;
}
.authors {
    font-weight: bold;
}
.journal {
    font-style: italic;
    color: #555;
}

/* --- Skills List Style --- */
.skills p {
    margin: 10px 0;
    font-size: 1.1em;
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 50px;
    font-size: 0.9em;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/*
=========================================
   MOBILE RESPONSIVE STYLES
=========================================
*/
@media (max-width: 768px) {
    body {
        display: block; /* Stack sidebar and content */
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 15px;
        box-sizing: border-box; /* Include padding in width */
    }
    
    .main-content {
        padding: 20px 15px; /* Reduce side padding on mobile */
    }

    h1 {
        font-size: 1.8em; /* Smaller main title */
    }

    .profile-section {
        flex-direction: column; /* Stack image on top of details */
        align-items: center; /* Center the image */
        gap: 20px;
        text-align: center;
    }
    
    .profile-details p {
        font-size: 1em;
    }
}