/* Reset and Base Styles */
:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --text-muted: #666;
    --text-dark: #222;
    --link-color: #0066cc;
    --link-hover: #004499;
    --container-bg: #fff;
    --sidebar-bg: #f9f9f9;
    --border-color: #eee;
    --border-strong: #e0e0e0;
    --shadow-color: rgba(0,0,0,0.08);
    --profile-border: #fff;
    --nav-link-color: #777;
    --nav-link-hover: #000;
    --section-border: #f0f0f0;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --text-muted: #aaa;
    --text-dark: #fff;
    --link-color: #66b2ff;
    --link-hover: #99ccff;
    --container-bg: #1e1e1e;
    --sidebar-bg: #252525;
    --border-color: #333;
    --border-strong: #444;
    --shadow-color: rgba(0,0,0,0.5);
    --profile-border: #333;
    --nav-link-color: #aaa;
    --nav-link-hover: #fff;
    --section-border: #333;
}

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

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Layout Container */
.layout-container {
    display: flex;
    max-width: 1000px;
    margin: 40px auto;
    background: var(--container-bg);
    box-shadow: 0 4px 20px var(--shadow-color);
    min-height: 85vh;
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* Sidebar (Left) */
.sidebar {
    flex: 0 0 280px;
    padding: 40px 30px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    background-color: #ddd;
    border: 4px solid var(--profile-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar h1 {
    font-size: 1.6rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.tagline {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-links {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--container-bg);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: #555;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.social-links a:hover {
    background: var(--link-color);
    color: #fff;
    border-color: var(--link-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Content (Right) */
.content {
    flex: 1;
    padding: 50px 60px;
}

/* Top Navigation */
.top-nav ul {
    display: flex;
    gap: 25px;
    list-style: none;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    align-items: center;
}

.top-nav a {
    color: var(--nav-link-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.top-nav a:hover {
    color: var(--nav-link-hover);
    text-decoration: none;
}

.theme-toggle-li {
    margin-left: auto;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-link-color);
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s ease;
    outline: none;
}

#theme-toggle:hover {
    color: var(--nav-link-hover);
}

/* Sections */
section {
    margin-bottom: 60px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--section-border);
    color: var(--text-dark);
}

p {
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Publications List */
#publications ul {
    list-style: none;
}

#publications li {
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 3px solid var(--border-color);
}

#publications strong {
    color: var(--text-dark);
    font-size: 1.05rem;
}

#publications em {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 2px 0 5px;
}

/* Honors List */
#honors ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

#honors li {
    margin-bottom: 8px;
    color: var(--text-color);
}

/* Projects */
.project-item {
    margin-bottom: 35px;
}

.project-item h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* Experience */
.experience-item {
    margin-bottom: 35px;
}

.experience-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.experience-item .date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-style: italic;
}

.experience-item ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.experience-item li {
    margin-bottom: 8px;
    color: var(--text-color);
}

/* Responsive Design */
@media (max-width: 800px) {
    .layout-container {
        flex-direction: column;
        margin: 0;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        position: relative; /* Enable positioning context for toggle */
    }

    .sidebar {
        flex: auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 40px 20px 30px;
    }

    .content {
        padding: 40px 25px;
    }

    .top-nav ul {
        flex-wrap: wrap;
        gap: 15px 20px;
        justify-content: center; /* Center the links */
    }
    
    .theme-toggle-li {
        position: absolute;
        top: 20px;
        right: 20px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 30px 15px 20px;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }

    .sidebar h1 {
        font-size: 1.4rem;
    }

    .content {
        padding: 30px 15px;
    }

    .top-nav ul {
        justify-content: center;
        gap: 10px 15px;
        margin-bottom: 30px;
    }

    .top-nav a {
        font-size: 0.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }
    
    .project-item h3, .experience-item h3 {
        font-size: 1.1rem;
    }
}
