/* style.css */
/* Copy ALL CSS rules from the <style> block of your previous HTML */
/* and paste them into this file. */

:root {
    --primary: #4285F4; /* Google Blue */
    --secondary: #34A853; /* Google Green */
    --dark: #202124; /* Google Dark Gray */
    --light: #f8f9fa; /* Google Light Gray */
    --gray: #5f6368; /* Google Medium Gray */
    --white: #ffffff;
    --sidebar-bg: #f1f3f4; /* Slightly different gray for sidebar */
    --sidebar-width: 280px;
    --header-height: 0px; /* No separate header needed with fixed sidebar */
    --font-main: 'Google Sans', Arial, sans-serif; /* Requires loading Google Sans or using fallback */
    
    /* Timeline CSS Variables */
    --accent-color: #4285F4; /* Same as primary */
    --bg-color: #ffffff; /* Same as white */
    --card-bg: #f8f9fa; /* Same as light */
    --text-color: #202124; /* Same as dark */
    --text-secondary: #5f6368; /* Same as gray */
    --border-color: #e0e0e0; /* Light border color */
}

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

/* Consider adding Google Sans font import if desired */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;700&display=swap');

html {
    scroll-behavior: smooth; /* Ensure smooth scroll is globally enabled */
}

body {
    font-family: var(--font-main), sans-serif;
    background-color: var(--white);
    color: var(--dark);
    line-height: 1.6;
    /* Add padding-left to prevent content from going under the fixed sidebar */
    padding-left: var(--sidebar-width);
}

.page-wrapper {
    display: flex; /* This is key but handled by fixed sidebar positioning */
}

/* --- Sidebar Styling --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh; /* Full viewport height */
    position: fixed; /* Fixed position */
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    padding: 30px 20px;
    overflow-y: auto; /* Allow scrolling if content overflows */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center items horizontally */
    border-right: 1px solid #dadce0; /* Subtle border */
    z-index: 100; /* Ensure sidebar is above content */
}

.sidebar-profile {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.sidebar-profile img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.sidebar-profile h1 {
    font-size: 22px;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 5px;
}

.sidebar-profile h2 {
    font-size: 15px;
    color: var(--gray);
    font-weight: 400;
}

.sidebar-nav ul {
    list-style: none;
    width: 100%; /* Make nav take full width of sidebar padding */
    padding-left: 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    font-size: 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar-nav a:hover {
    background-color: #e8eaed; /* Lighter gray on hover */
    color: var(--dark);
}

.sidebar-nav a.active {
    background-color: var(--primary);
    color: var(--white);
    font-weight: 500;
}

.sidebar-social {
    margin-top: auto; /* Pushes social links to the bottom */
    padding-top: 20px; /* Space above social links */
    text-align: center;
    width: 100%;
}

.sidebar-social a {
    color: var(--gray);
    font-size: 18px;
    margin: 0 8px;
    transition: color 0.3s ease;
}

.sidebar-social a:hover {
    color: var(--primary);
}

/* --- Main Content Styling --- */
.main-content {
    /* Removed margin-left, using body padding instead */
    width: 100%; /* Takes remaining width */
    padding: 40px;
    background-color: var(--white);
    min-height: 100vh; /* Ensure it takes at least full height */
}

/* Section Styling (applies to loaded sections) */
.content-section {
    /* Add padding matching the target offset for scroll */
    /* Use scroll-margin-top instead of padding/negative margin for better scrollspy */
    scroll-margin-top: 80px; /* Adjust this value based on any fixed header height or desired offset */
    margin-bottom: 60px;
}

 /* Add specific top padding for the *first* section if needed */
/* This might be less reliable with dynamic loading, handle spacing with margin-bottom */
/* .main-content > .content-section:first-child { ... } */


.section-title {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: inline-block; /* So border only spans the text width */
}

/* Generic Card Grid */
.card-grid {
    display: grid;
    /* Responsive grid: Adjust minmax for desired card size */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Generic Card Styling */
.card {
    background-color: var(--light);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    /* Remove padding here if using card-img */
    /* padding: 20px; */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Ensure vertical stacking */
    overflow: hidden; /* Important if using negative margins on image */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Styling for the Actual Card Image */
.card-img {
    width: 100%;       /* Make image span the card's width */
    height: 180px;      /* Set a fixed height (adjust as needed) */
    object-fit: cover;  /* Scale/crop image */
    display: block;     /* Removes potential extra space */
    /* Top border radius handled by card overflow:hidden */
    /* border-radius: 12px 12px 0 0;  */
}


/* Card Image Placeholder */
.card-img-placeholder {
    height: 180px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary);
     /* Top border radius handled by card overflow:hidden */
    /* border-radius: 12px 12px 0 0; */
}

 .card-content {
    flex-grow: 1; /* Allows content to fill space */
    display: flex;
    flex-direction: column;
    padding: 20px; /* Add padding here now */
}

.card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark);
}

.card p {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 15px;
    /* Removed flex-grow, handle links push down via card-links margin-top: auto */
    /* flex-grow: 1; */
}

.card .date {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.card-links {
    margin-top: auto; /* Pushes links to the bottom */
    padding-top: 10px; /* Space above links */
}

.card-links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    margin-right: 15px;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.card-links a:last-child {
    margin-right: 0;
}

.card-links a:hover {
    color: var(--secondary);
}

/* .card-links a i { margin-left: 4px; } */ /* Replaced by gap */

/* --- Specific Section Styles --- */

/* About Section Specifics */
#about p {
    margin-bottom: 15px;
    max-width: 800px; /* Limit text width for readability */
}
#about .about-stats {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
     gap: 20px;
     margin-top: 30px;
     max-width: 800px;
 }

#about .stat-card {
     background-color: var(--light);
     border-radius: 8px;
     padding: 20px;
     text-align: center;
     border-top: 3px solid var(--secondary);
 }
 #about .stat-card:nth-child(1) { border-top-color: var(--primary); }
 #about .stat-card:nth-child(3) { border-top-color: #EA4335; } /* Define --red if not already */
 #about .stat-card:nth-child(4) { border-top-color: #FBBC05; } /* Define --yellow if not already */

 #about .stat-card h3 {
     font-size: 32px;
     color: var(--dark);
     margin-bottom: 5px;
 }

 #about .stat-card p {
     color: var(--gray);
     font-size: 14px;
     margin-bottom: 0;
 }

/* Publication Card Specific Styles (if using cards) */
.publication-card .card-content { /* Or just .card-content if consistent */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.publication-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark);
}
.publication-card h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}
.publication-card h3 a:hover { color: var(--primary); }
.publication-card .authors {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
    font-style: italic;
}
.publication-card .authors strong {
    font-weight: 600;
    font-style: normal;
    color: var(--dark);
}
.publication-card .venue {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 12px;
    font-weight: 500;
}
.publication-card .venue em { font-style: italic; }
.publication-card .abstract {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.5;
}
/* Specific icon colors (optional) */
.publication-card .card-links a[title*="PDF"] i { color: #e63946; }
.publication-card .card-links a[title*="Code"] i,
.publication-card .card-links a[title*="GitHub"] i { color: #2b3137; }
.publication-card .card-links a[title*="Model"] i,
.publication-card .card-links a[title*="Hugging Face"] i { color: #ffc107; }
.publication-card .card-links a[title*="Slides"] i { color: #ff7f50; }

/* Publication List Styles (Text format) */
.publication-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
}
.publication-entry {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    line-height: 1.6;
}
.publication-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.publication-entry .authors {
    display: block;
    margin-bottom: 4px;
    color: var(--gray);
    font-size: 0.95em;
}
.publication-entry .authors strong {
    font-weight: 600;
    color: var(--dark);
}
.publication-entry .year {
    font-weight: 500;
    margin-right: 5px;
    color: var(--gray);
}
.publication-entry .title {
    font-weight: 500;
    color: var(--dark);
}
.publication-entry .publication-title-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--primary);
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}
.publication-entry .publication-title-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.publication-entry .venue {
    display: block;
    margin-top: 2px;
    font-size: 0.95em;
    color: var(--secondary);
}
.publication-entry .venue em { font-style: italic; }
.publication-entry .details {
    font-size: 0.9em;
    color: var(--gray);
    margin-left: 5px;
}
.publication-entry .links {
    display: block;
    margin-top: 8px;
    font-size: 0.9em;
}
.publication-entry .links a {
    text-decoration: none;
    color: var(--primary);
    margin-right: 12px;
    white-space: nowrap;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.publication-entry .links a:hover { color: var(--secondary); }
/* .publication-entry .links a i { margin-right: 3px; } */ /* Replaced by gap */
.publication-entry .links a i.fa-file-pdf { color: #e63946; }
.publication-entry .links a i.fa-github { color: #2b3137; }
.publication-entry .links a i.fa-brain { color: #ffc107; }
.publication-entry .links a i.fa-chalkboard-teacher { color: #ff7f50; }


/* --- Footer --- */
.footer {
    text-align: center;     /* Make sure it's centered */
    padding: 30px 20px;     /* Adjust padding as needed */
    margin-top: 40px;       /* Space above the footer */
    font-size: 14px;
    color: var(--gray);
    border-top: 1px solid #e0e0e0; /* Separator line */
    /* width: 100%; /* Should be block level by default, taking width of container */
}


/* --- Responsive --- */
@media (max-width: 992px) {
    body {
        padding-left: 0; /* Remove body padding */
    }

    .sidebar {
        width: 100%;
        height: auto; /* Auto height */
        position: static; /* Change from fixed to static */
        border-right: none;
        border-bottom: 1px solid #dadce0; /* Add bottom border */
        flex-direction: row; /* Arrange items horizontally */
        flex-wrap: wrap; /* Allow wrapping */
        justify-content: space-between; /* Space out profile/nav */
        padding: 15px;
        z-index: auto; /* Reset z-index */
    }

    .sidebar-profile {
         margin-bottom: 0;
         text-align: left;
         display: flex;
         align-items: center;
         width: auto; /* Allow shrinking */
         flex-grow: 1; /* Take available space */
    }
    .sidebar-profile img {
         width: 50px;
         height: 50px;
         margin-right: 15px;
         margin-bottom: 0;
    }
     .sidebar-profile h1 { font-size: 18px; margin-bottom: 0;}
     .sidebar-profile h2 { display: none; } /* Hide subtitle on small screens */

    .sidebar-nav {
        order: 3; /* Move nav below profile/social */
        width: 100%;
        margin-top: 10px;
    }
    .sidebar-nav ul {
         display: flex;
         justify-content: center;
         flex-wrap: wrap;
         gap: 5px;
     }
    .sidebar-nav li { margin-bottom: 0; }
    .sidebar-nav a { padding: 8px 12px; font-size: 14px; }

    .sidebar-social {
        margin-top: 0; /* Reset margin */
        padding-top: 0;
        display: flex;
         align-items: center;
         width: auto; /* Allow shrinking */
    }
    .sidebar-social a { margin: 0 5px; font-size: 16px;}


    .main-content {
        padding: 20px;
    }
     .content-section {
         /* Adjust scroll margin for potentially smaller fixed header or none */
         scroll-margin-top: 60px;
         margin-bottom: 40px;
     }


    .section-title {
        font-size: 24px;
    }

    .card-grid {
         gap: 20px;
    }
}

 @media (max-width: 576px) {
      .card-grid {
          grid-template-columns: 1fr; /* Force single column */
      }
      .sidebar {
          flex-direction: column; /* Stack items vertically */
          align-items: center;
      }
      .sidebar-profile {
           /* Stack profile text */
           /* align-items: flex-start; */
           width: 100%;
           justify-content: center;
           margin-bottom: 15px;
       }
       .sidebar-profile div { /* Wrap text */
           display: flex;
           flex-direction: column;
           align-items: center; /* Center text below image */
           text-align: center;
       }
        .sidebar-profile img { margin-right: 0; }
       .sidebar-profile h1 { margin-bottom: 0; }

        .sidebar-nav { order: 2; margin-top: 0; margin-bottom: 15px; }
        .sidebar-social { order: 3; }

 }

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--accent-color);
    border: 4px solid var(--bg-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}

.timeline-content {
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-date {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.timeline-content h3 {
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.timeline-content h4 {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
    font-weight: normal;
}

.timeline-projects {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.timeline-projects h5 {
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.timeline-projects ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-projects li {
    margin-bottom: 10px;
}

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

.timeline-projects strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 5px;
}

/* Responsive Timeline */
@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-dot {
        left: 23px;
    }
    
    .timeline-item:nth-child(even) .timeline-dot {
        left: 23px;
    }
}

/* Show More/Show Less Button Styles */
.show-more-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.show-more-btn:hover {
    background-color: var(--secondary);
}

.expandable-content {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.expandable-content.show {
    opacity: 1;
    max-height: 500px;
    display: block !important;
}

.projects-list {
    margin-bottom: 0;
}