:root {
    --bg-color: #0f1115;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #1f6feb;
    --border: #30363d;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* --- Top Navigation Bar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 17, 21, 0.95); /* Dark semi-transparent */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0.6rem 2rem;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--accent);
}

/* --- Main Layout Container --- */
.container, .main-container {
    display: block;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem 2rem;
    min-height: 100vh;
}

/* --- Split Intro Section (Hero + About) --- */
.intro-section {
    padding-top: 120px; /* Space for fixed navbar */
    padding-bottom: 2rem;
    /* border-bottom: 1px solid var(--border); */
    margin-bottom: 2rem;
}

.intro-container {
    display: grid;
    grid-template-columns: 350px 1fr; /* Fixed width for profile, rest for text */
    gap: 4rem;
    align-items: start;
}

/* Left Column: Identity */
.intro-profile {
    text-align: center;
    position: sticky;
    top: 100px;
}

.intro-profile .profile-img-container {
    width: 220px;
    height: 220px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card-bg);
    border: 4px solid var(--accent);
}

.intro-profile .profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-profile h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.role {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.role-sub {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--accent);
}

/* Right Column: Bio */
.intro-bio {
    flex: 1;
}

.bio-card {
    border: none;
    background: none;
    padding: 0;
}

.bio-card p {
    font-size: 1.05rem;
    color: #c9d1d9;
    margin-bottom: 1rem;
}

.bio-card strong {
    color: var(--text-primary);
}

.bio-card a {
    color: var(--accent);
    text-decoration: none;
}

/* --- General Sections --- */
.section {
    margin-bottom: 5rem;
    scroll-margin-top: 6rem; /* Ensures navbar doesn't cover heading */
}

.section-title {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* --- Research Interests Grid --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}

.grid-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.grid-item i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.grid-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.grid-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Publications (Scrollable Box + Overflow Fix) --- */
#publication-list {
    max-height: 600px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

#publication-list::-webkit-scrollbar {
    width: 12px;
}

#publication-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

#publication-list::-webkit-scrollbar-thumb {
    background-color: var(--text-secondary);
    border-radius: 6px; 
    border: 3px solid var(--card-bg);
}

#publication-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

.pub-card {
    background: transparent;
    border: none;                /* No individual border */
    border-bottom: 1px solid var(--border); /* Just a separator line */
    border-radius: 0;            /* Rounded corners */    
    margin-bottom: 0;            /* Gap between items */
    padding: 1.5rem;    
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    transition: background 0.2s; /* Smooth hover effect */
}

.pub-content {
    flex: 1;
    min-width: 0; /* CRITICAL: Allows text to wrap */
}

.pub-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    white-space: normal;
    overflow-wrap: break-word;
}

.pub-title-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.pub-title-link:hover { color: var(--accent); }

.authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    overflow-wrap: break-word;
}

.venue {
    font-size: 0.9rem;
    color: var(--accent);
    font-style: italic;
}

.pub-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-link, .btn-bib, .btn-action {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.btn-link:hover, .btn-bib:hover, .btn-action:hover {
    background: var(--border);
    color: var(--text-primary);
}

.bibtex-hidden {
    display: none;
    width: 100%;
    margin-top: 1rem;
    background: #0d1117;
    padding: 1rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #8b949e;
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

.exp-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.exp-logo {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
}

.exp-info { flex: 1; min-width: 200px; }
.exp-info h3 { font-size: 1.1rem; margin: 0; color: var(--text-primary); }
.exp-role { font-size: 0.95rem; color: var(--accent); margin: 0; }
.exp-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}
.exp-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    padding-left: 60px;
}

/* --- Talks List --- */
.talks-list {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}
.talk-item { margin-bottom: 0.5rem; }

.venue-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}
.venue-link:hover { color: var(--accent); text-decoration: underline; }

/* --- Contact & Footer --- */
.contact-minimal {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-contact {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: all 0.2s ease;
}

.btn-contact:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

.footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
    .nav-menu { display: none; } /* Add hamburger later if needed */
    
    .intro-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .intro-profile {
        position: static;
        border-bottom: 1px solid var(--border);
        padding-bottom: 2rem;
    }
    
    .intro-bio { text-align: left; }
    
    .exp-desc { padding-left: 0; margin-top: 0.5rem; }
    
    .contact-minimal {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .pub-card { flex-direction: column; gap: 1rem; }
    .pub-actions { width: 100%; justify-content: flex-start; }
}

/* --- Publication Sub-Page Styles --- */
.paper-title-large { font-size: 2rem; margin-bottom: 1rem; color: var(--text-primary); }
.paper-meta { margin-bottom: 2rem; color: var(--text-secondary); font-size: 1.1rem; }
.paper-actions-row { display: flex; gap: 1rem; margin-bottom: 2rem; }
.abstract-card { margin-top: 2rem; }
.abstract-card h3 { margin-bottom: 1rem; font-family: var(--font-mono); color: var(--accent); }

/* --- Experience & Education (Clean List View) --- */

.experience-box {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 0;   /* Reduced from 1.5rem */
    padding: 0;
}

.experience-card {
    background: transparent;
    padding: 1rem 0;           /* Vertical spacing only */
    border: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    border-radius: 0;
}

.experience-card:last-child {
    border-bottom: none;
}

/* --- Layout Tweaks --- */

/* Reduce gap between Experience and Education */
#experience {
    margin-bottom: 2rem; 
}

/* Pull items closer to the header */
#experience .section-title,
#education .section-title {
    margin-bottom: 1.5rem;
}

/* Remove extra space above the VERY FIRST item in the list */
.experience-card:first-child {
    padding-top: 0;
}


/* --- Beautiful Horizontal Research Row --- */
.research-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 25px;
    margin-top: 35px;
}

.research-item {
    flex: 1; /* Forces all 4 columns to be exactly the same width */
    text-align: center; /* Centers the icon and text inside each column */
}

.research-item h3 {
    display: flex;
    align-items: center;
    justify-content: center; /* Keeps the title and icon centered in the column */
    gap: 10px; /* Space between the icon and the text */
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    color: #ffffff;
}

.research-item i {
    font-size: 1.4rem; /* Scaled down slightly to look balanced inline */
    color: #4a90e2;
    margin-bottom: 0; /* Removed the old bottom margin */
}

.research-item p {
    font-size: 0.9rem;
    color: #a0a0a0;
    line-height: 1.5;
    margin: 0;
}

/* Makes sure it stacks nicely if someone views it on a phone */
@media (max-width: 768px) {
    .research-row {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
}
