:root {
    --sidebar-bg: #88b99a;
    --sidebar-text: #ffffff;
    --content-bg: #ffffff;
    --text-color: #333;
    --heading-color: #111;
    --link-color: #2c5e40;
    --link-hover: #74a586;
    --border-color: #eee;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 40px 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    left: 0;
    top: 0;
    z-index: 1000;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    transform: scale(1.3);
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    align-self: center;
}

.sidebar-name {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    align-self: center;
}

.nav-menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.nav-item {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.nav-item:hover {
    opacity: 1;
    font-weight: 600;
}

.nav-item.active {
    color: #fff;
    font-weight: 700;
    border-left: 3px solid #fff;
    padding-left: 10px;
    margin-left: -10px;
}

.social-links {
    margin-top: auto;
    display: flex;
    gap: 20px;
    padding-top: 30px;
    align-self: center;
}

.social-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.social-link:hover {
    color: #fff;
    transform: scale(1.15);
}

/* Main Content Styles */
.main-content {
    margin-left: 280px;
    padding: 60px 80px;
    max-width: 1000px;
    width: 100%;
    background: #fff;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #222;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--sidebar-bg);
    padding-bottom: 8px;
    margin-top: 50px;
    margin-bottom: 25px;
    color: #222;
    display: inline-block;
    padding-right: 20px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    font-weight: 400;
}

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

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

/* Updates List */
.updates-list {
    list-style: none;
}

.update-item {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.update-date {
    font-weight: 700;
    color: var(--link-color);
    margin-right: 8px;
}

/* Publications */
.paper-item {
    margin-bottom: 25px;
}

.paper-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #000;
    margin-bottom: 4px;
}

.paper-authors {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.paper-venue {
    font-style: italic;
    color: #222;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Experience Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid var(--sidebar-bg);
    margin-left: 20px;
}

.timeline-item {
    margin-bottom: 40px;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -39px;
    top: 5px;
    width: 16px;
    height: 16px;
    background-color: var(--sidebar-bg);
    border-radius: 50%;
    border: 3px solid var(--content-bg);
    z-index: 1;
}

/* Company Group Styles */
.timeline-item.company-group {
    background-color: #f5f9f7;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--sidebar-bg);
    margin-bottom: 50px;
}

.timeline-item.company-group::before {
    display: none;
}

.company-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--sidebar-bg);
}

.company-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.company-info h3 {
    font-size: 1.5rem;
    color: var(--heading-color);
    margin-bottom: 5px;
}

.company-duration {
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

.roles-container {
    padding-left: 20px;
}

.role-item {
    margin-bottom: 25px;
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #ccc;
}

.role-item:last-child {
    margin-bottom: 0;
}

.role-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: #ccc;
    border-radius: 50%;
    border: 2px solid white;
}

.role-item .timeline-date {
    font-weight: 600;
    color: var(--link-color);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.role-title {
    font-size: 1.1rem;
    color: var(--heading-color);
    margin-bottom: 8px;
    font-weight: 600;
}

/* Experience with Logo */
.exp-with-logo {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.exp-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.timeline-date {
    font-weight: 700;
    color: var(--link-color);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.timeline-content {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.timeline-content h3 {
    font-size: 1.15rem;
    color: var(--heading-color);
    margin-bottom: 5px;
}

.timeline-content h4 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
    font-weight: normal;
}

.timeline-content .exp-summary {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    margin-top: 10px;
}

.timeline-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-top: 10px;
}

.timeline-content ul li {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #444;
}

/* Teaching Section */
.teaching-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.teaching-item {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.teaching-item:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--sidebar-bg);
}

.teaching-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.teaching-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.teaching-info {
    flex: 1;
}

.teaching-role {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 5px;
}

.teaching-institution {
    font-size: 1.05rem;
    color: #555;
    font-weight: 600;
    margin-bottom: 5px;
}

.teaching-period {
    font-size: 0.9rem;
    color: var(--link-color);
    font-weight: 600;
    background: rgba(136, 185, 154, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

.teaching-courses {
    list-style: none;
    margin-left: 0;
    margin-top: 15px;
    padding-left: 80px;
}

.teaching-courses li {
    margin-bottom: 10px;
    color: #444;
    font-size: 0.95rem;
    position: relative;
    padding-left: 20px;
    line-height: 1.5;
}

.teaching-courses li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--sidebar-bg);
    font-weight: bold;
}

@media (max-width: 850px) {
    .teaching-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .teaching-courses {
        padding-left: 0;
    }
}

/* Skills Section - Fancy Tags */
.skills-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-category {
    background: linear-gradient(135deg, #f8faf9 0%, #e8f5eb 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--sidebar-bg);
}

.skill-category-title {
    font-weight: 700;
    color: var(--heading-color);
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-category-title i {
    color: var(--sidebar-bg);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: white;
    color: #444;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    cursor: default;
}

.skill-tag:hover {
    background: var(--sidebar-bg);
    color: white;
    border-color: var(--sidebar-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(136, 185, 154, 0.3);
}

/* Legacy skills list fallback */
.skills-list {
    list-style: none;
}

.skills-list li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Research Tabs */
.research-tabs {
    display: flex;
    background-color: #eee;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    flex: 1;
    text-align: center;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: #e0e0e0;
}

.tab-btn.active {
    background-color: var(--sidebar-bg);
    color: #fff;
}

.tab-content {
    display: none;
    background-color: #f9f9f9;
    padding: 30px;
    border: 1px solid #eee;
    border-top: none;
}

.tab-content.active {
    display: block;
}

/* Education Grid */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.edu-card {
    text-align: left;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.edu-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.edu-logo-placeholder {
    width: 140px;
    height: 140px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: #888;
    font-size: 0.8rem;
    border: 2px solid #eee;
    overflow: hidden;
    padding: 20px;
}

.edu-logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
}

/* UCSD logo specific styling */
.edu-logo-placeholder.ucsd-logo {
    padding: 10px;
}

.edu-logo-placeholder.ucsd-logo img {
    width: 130%;
    height: 130%;
    max-width: none;
}

.edu-school {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 5px;
}

.edu-period {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.edu-details {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.5;
}

.edu-details p {
    margin-bottom: 5px;
}

/* Paper Row Layout */
.paper-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.paper-thumb {
    flex-shrink: 0;
    width: 350px;
    height: 250px;
    background-color: transparent;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.paper-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.paper-content {
    flex-grow: 1;
}

.paper-desc {
    font-size: 0.9rem;
    color: #555;
    margin-top: 8px;
    line-height: 1.5;
}

.paper-link {
    display: inline-block;
    background-color: var(--sidebar-bg);
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.paper-link:hover {
    background-color: var(--link-hover);
    text-decoration: none;
}

/* Projects Grid Layout */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--sidebar-bg);
}

.project-content {
    flex-grow: 1;
}

.tech-stack {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-family: monospace;
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.exp-role {
    font-weight: 700;
    font-size: 1.15rem;
    color: #222;
    flex: 1;
}

.exp-date {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.exp-list {
    margin-left: 20px;
    margin-top: 12px;
    list-style-type: none;
}

.exp-list li {
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95rem;
    position: relative;
    padding-left: 20px;
}

.exp-list li:before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--sidebar-bg);
    font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 850px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 30px 20px;
        align-items: center;
    }
    
    .main-content {
        margin-left: 0;
        padding: 30px 20px;
    }
    
    .nav-menu {
        align-items: center;
        margin-bottom: 20px;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }
    
    .timeline {
        padding-left: 20px;
        margin-left: 0;
    }
    .timeline-item::before {
        left: -11px;
    }
    
    .paper-row {
        flex-direction: column;
    }
    .paper-thumb {
        width: 100%;
        height: 150px;
    }
    
    .project-card {
        flex-direction: column;
    }
    .project-thumb {
        max-width: 100%;
        height: 200px;
    }
}
