/* Basic reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
}

/* Navigation - modified for right alignment */
header {
    margin-bottom: 40px;
}

nav ul {
    display: flex;
    list-style: none;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    justify-content: flex-end; /* This aligns items to the right */
}

nav li {
    margin-left: 20px; /* Changed from margin-right to margin-left */
    margin-right: 0;   /* Reset right margin */
}

nav a {
    text-decoration: none;
    color: #495057;
    font-weight: bold;
    transition: color 0.3s;
}

nav a:hover {
    color: #0066cc;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: flex-end; /* Right align items in mobile view */
    }
    
    nav li {
        margin-left: 0;
        margin-bottom: 10px;
    }
}

/* Profile section - side by side layout */
.profile-section {
    display: flex;
    align-items: center;
    margin: 60px 0;
    gap: 50px;
}

.profile-container {
    flex: 0 0 200px; /* Made smaller from 300px to 200px */
}

.profile-photo {
    width: 200px;         /* Fixed width instead of 100% */
    height: 200px;        /* Fixed height to make it square */
    border-radius: 50%;   /* Makes it perfectly round instead of 8px */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    object-fit: cover;    /* Ensures photo fits well in circle */
}

.profile-info {
    flex: 1;
}

.profile-info h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.bio {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #555;
}

.cv-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cv-link:hover {
    background-color: #0056b3;
}

/* Research page specific styles */
.research-section {
    margin-bottom: 60px;
}

.research-section h1 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
}

.research-item {
    margin-bottom: 40px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
}

.research-item h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #1a1a1a;
    line-height: 1.4;
}

.abstract {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    text-align: justify;
    margin: 0;
}

/* Teaching page specific styles - improved design */
.page-section {
    margin-bottom: 60px;
}

.page-section h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 20px;
    font-weight: normal;
}

.title-underline {
    width: 100%;
    height: 3px;
    background-color: #0066cc;
    margin-bottom: 50px;
}

.institution-section {
    margin-bottom: 60px;
}

.institution-section h2 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 40px;
    font-weight: normal;
}

.role-block {
    margin-bottom: 40px;
    margin-left: 30px;
}

.role-block h3 {
    font-size: 1.2rem;
    color: #495057;
    margin-bottom: 20px;
    font-weight: normal;
}

.course-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-left: 30px;
}

.course-name {
    font-size: 1rem;
    color: #333;
    flex: 1;
    margin-right: 20px;
}

.course-semester {
    color: #666;
    font-size: 0.95rem;
    white-space: nowrap;
    min-width: 150px;
    text-align: right;
}

/* General styles */
h2 {
    margin-bottom: 20px;
    color: #343a40;
}

p {
    margin-bottom: 15px;
}

/* Paper download link styling */
.paper-link {
    display: inline-block;
    margin-left: 10px;
    padding: 6px 12px;
    background-color: #0066cc;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: normal;
    transition: background-color 0.3s;
    vertical-align: middle;
}

.paper-link:hover {
    background-color: #0056b3;
}

/* Footer */
footer {
    margin-top: 60px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-section {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-container {
        flex: 0 0 auto;
        max-width: 150px;     /* Made smaller for mobile from 200px to 150px */
        margin: 0 auto 30px;
    }
    
    .profile-photo {
        width: 150px;         /* Smaller size for mobile */
        height: 150px;        /* Smaller size for mobile */
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    /* Mobile responsive for research page */
    .research-item {
        padding: 20px 15px;
        margin-bottom: 30px;
    }
    
    .research-item h2 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .paper-link {
        display: block;
        margin: 10px 0 0 0;
        text-align: center;
        width: fit-content;
    }
    
    .abstract {
        font-size: 0.95rem;
    }
    
    /* Mobile responsive for teaching page */
    .course-row {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 15px;
    }
    
    .course-semester {
        margin-top: 5px;
        text-align: left;
        min-width: auto;
    }
    
    .role-block {
        margin-left: 15px;
    }
    
    .role-block h3 {
        font-size: 1.1rem;
    }
    
    .page-section h1 {
        font-size: 2rem;
    }
    
    .institution-section h2 {
        font-size: 1.5rem;
    }
}
