/* Root variables for consistent theming */
:root {
    --primary-color: #2196F3;
    --text-color: #333;
    --background-color: #fff;
}

/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation styles */
nav {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

nav .container {
    display: flex;
    justify-content: flex-end; /* This moves the nav to the right */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}

/* Profile section styles */
.profile-section {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.profile-container {
    text-align: center;
}

.profile-container h1 {
    margin: 0.5rem 0 0.25rem 0; /* Reduced top margin from 1rem to 0.5rem */
    color: var(--text-color);
    font-size: 2rem;
}

.profile-container h2 {
    margin: 0 0 1rem 0;
    font-weight: normal;
    color: #666;
    font-size: 1rem; /* Match the size of social links */
}

.profile-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem; /* Reduced from 1rem to 0.5rem */
}

.profile-info h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
    font-weight: bold; /* Make 'About' bold */
}

/* Social links styles */
.social-links {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.social-links li {
    margin-bottom: 0.5rem;
}

.social-links a {
    text-decoration: none;
    color: black;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.social-links a:hover {
    text-decoration: underline;
}

.social-links i {
    margin-right: 0.5rem;
    color: var(--primary-color);
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Section styles */
.section {
    margin: 2rem 0;
}

.section h2 {
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* News items styles */
.news-item {
    margin-bottom: 1rem;
}

/* General link styles */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Publication styles */
.publication-list {
    margin-top: 2rem;
}

.publication-item {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.publication-item h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.publication-item .authors {
    color: #666;
    margin: 0.5rem 0;
}

.publication-item .venue {
    color: #888;
    font-style: italic;
    margin: 0.5rem 0;
}

.publication-links {
    margin-top: 0.5rem;
}

.paper-link {
    margin-right: 1rem;
}

.paper-link i {
    margin-right: 0.25rem;
}

/* Research page styles */
.section h3 {
    color: var(--text-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.25rem;
}

.section ul {
    list-style-type: none;
    padding-left: 0;
}

.section ul li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.project-item {
    margin-bottom: 2rem;
}

.project-item h4 {
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.project-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* Teaching page styles */
.course-section {
    margin-top: 1rem;
}

.course-item {
    margin-bottom: 2rem; /* Keep space between courses */
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

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

.course-item h3 {
    color: var(--text-color);
    margin: 0 0 0.5rem 0; /* Reduced margin after course title */
    font-size: 1.3rem;
}

.course-details {
    margin: 0.5rem 0; /* Reduced margin around details section */
}

.course-details p {
    margin: 0; /* Remove margins between detail lines */
    color: #666;
    line-height: 1.4; /* Slightly reduced line height */
}

.course-details strong {
    color: var(--text-color);
}

.course-description {
    margin-top: 0.5rem; /* Reduced margin before description */
}

.course-description p {
    margin: 0;
    line-height: 1.4; /* Slightly reduced line height */
}

/* Research interests dropdown styles */
.research-interests {
    margin-top: 1rem;
}

.research-category {
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.research-category:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-color);
    transition: background 0.3s ease;
    user-select: none;
}

.category-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.category-header.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1976D2 100%);
    color: white;
}

.category-icon {
    margin-right: 0.75rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.category-header.active .category-icon {
    color: white;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.category-header.active .dropdown-arrow {
    color: white;
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background: #fafafa;
    padding: 0 1.25rem; /* Set default padding to 0 */
}

.category-content.active {
    max-height: 500px;
    padding: 1rem 1.25rem;
}

.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subcategory-item {
    padding: 0.4rem 0;
    color: #555;
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.5rem;
    transition: color 0.2s ease;
}

.subcategory-item:hover {
    color: var(--primary-color);
}

.subcategory-item::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    opacity: 0.7;
}

/* Legacy research list styles - keeping for backward compatibility */
.research-list {
    list-style-type: none;
    padding-left: 0;
}

.research-list > li {
    margin-bottom: 1rem;
    font-weight: 500;
}

.research-list ul {
    list-style-type: none;
    padding-left: 1.5rem;
    margin-top: 0.25rem;
}

.research-list ul li {
    font-weight: normal;
    margin: 0.25rem 0;
    color: #666;
}

.research-list > li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.research-list ul li::before {
    content: "-";
    color: #666;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Responsive design */
@media (max-width: 768px) {
    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-image {
        margin: 0 auto;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Additional responsive styles for dropdowns */
    .category-header {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .category-content.active {
        padding: 0.875rem 1rem;
    }
}
