@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    /* "Darker, or less involved colour scheme" */
    --primary-gradient-start: #2c3e50; /* Dark Slate Blue */
    --primary-gradient-end: #4ca1af;   /* Muted Teal/Blue */
    --accent-color: #2c3e50; /* Matching the dark theme */
    --accent-highlight: #34495e;

    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-color: #333;
    --light-text: #666;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --max-width: 1100px;
    --header-padding: 60px 0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
}

/* Links in the main body text */
main a {
    color: #007685;           /* A deep, saturated teal (distinct from black text) */
    font-weight: 600;         /* Bold enough to catch the eye */
    text-decoration: none;
    transition: all 0.2s ease;
}

main a:hover {
    color: #005a66;           /* Darkens on hover */
    border-bottom: 1.5px solid #005a66; /* Underline becomes solid */
    background-color: rgba(0, 118, 133, 0.05); /* Very faint highlight "glow" */
}

/* Keeps the Navigation links clean so they don't get too bulky */
.nav a {
    font-weight: 500;
    border-bottom: none;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: white;
    padding: var(--header-padding);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.header h1 {
    font-size: 3rem;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: white;
    font-family: var(--font-main);
}

.header h1 a {
    color: white;
    text-decoration: none;
}

.header .subtitle {
    font-size: 1.3rem;
    margin-bottom: 15px;
    opacity: 0.9;
    font-weight: 300;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Navigation */
.nav {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Center nav items */
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav a:hover, .nav a.active {
    background: var(--accent-color);
    color: white;
    text-decoration: none;
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 40px auto;
    padding: 0 20px;
    min-height: 60vh;
}

h2, h3 {
    color: var(--text-color);
    margin-top: 1.5em;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid #eee; /* Clean divider */
    padding-bottom: 10px;
    margin-bottom: 30px;
}

/* Home Profile Section */

/* Updated Profile Section for larger Desktop image */
.profile-section {
    display: grid;
    grid-template-columns: 340px 1fr; /* Increased from 280px */
    gap: 40px;
    align-items: start;
    /* align-items: center; /* This centers the image vertically against the text block */ */
    margin-bottom: 40px;
}

/* Updated Profile Image with right-side crop */
.profile-img {
    position: relative; /* This is the key */
    top: 5px;          /* This "pushes" it down from its top edge */
    width: 100%;
    max-width: 340px;   /* Increased width for computer */
    height: 280px;      /* Decreased height to make it wider vs taller */
    border-radius: 13px;
    
    /* Adding "border" on both sides */
    /* padding: 8px;       /* This creates a gap between the image and the shadow */ */
    /* background: white;  /* This acts as a frame/border */ */

    
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    object-fit: cover;
    object-position: 60% center; 
}

.intro-text h1 {
    margin-top: 0;
    font-size: 2.2rem;
    color: var(--accent-color);
}

.affiliation-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.affil-tag {
    background: #f0f4f8;
    color: var(--accent-color) !important;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(44, 62, 80, 0.1);
}

.research-pillars h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.research-pillars ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.research-pillars li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.research-pillars i {
    color: #4ca1af; /* Your muted teal icon color */
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border-left: 5px solid var(--accent-color);
    margin-bottom: 25px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.25rem;
    color: var(--accent-color);
}

.card p {
    margin: 10px 0;
    color: #555;
}

/* Lists and Items */
/* Restoring the Card Look with a Flex twist */
.publication-item.card {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Centers the [Link] button vertically against the text */
    gap: 15px;
    padding: 15px 20px;
    border-left: 4px solid var(--accent-color); /* #007685;  Your bold teal border */
    margin-bottom: 12px; /* Reduced space between separate cards from 25px to 12px */
}

/* Make sure the title stays that nice accent color */
.publication-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-color); /*#007685;  Your colorful teal title */
    margin-bottom: 4px;
}

.pub-content {
    flex: 1; /* This pushes the links to the far right */
}

.pub-authors {
    color: #333;
    margin-bottom: 2px;
}

.pub-venue {
    color: #666;
    font-size: 0.95rem;
}

/* Styling the Link as a clean "Action" button */
.pub-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pub-link-btn {
    background: #f0f7f8;
    color: #007685 !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(0, 118, 133, 0.2);
    text-align: center;
    transition: all 0.2s ease;
}

.pub-link-btn:hover {
    background: #007685;
    color: white !important;
}

/* Mobile Fix: Stack them if the screen is too narrow */
@media (max-width: 600px) {
    .publication-item.card {
        flex-direction: column;
        align-items: flex-start;
    }
    .pub-links {
        width: 100%;
        margin-top: 10px;
    }
}

/* Container for the Video Label and Frame */
.video-section {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.video-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #c4302b; /* YouTube Red */
    margin-bottom: 10px;
}

/* Aspect Ratio Box to keep video from looking squashed */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Small Badge for the Award inside the card */
.award-badge-small {
    background: #fff9e6;
    color: #b8860b;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #ffeeba;
}

.comp-meta {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;  /* Add the 't', the ': 1.4', and the ';' */
}

.event-details {
    color: #666;
    font-size: 0.9rem;
}

.comp-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--accent-color); /* This uses your Dark Slate for the Title */
}

.comp-award {
    color: #007685;  /* Darker teal for better visibility */
    font-style: italic;
    font-weight: 600;           /* Increased weight makes color more visible */
    margin-top: 0;
    display: block;             /* Ensures it sits on its own line */
}

/* For hosting images in gallery */
.project-gallery-icons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail-icon {
    width: 120px;         /* Set the exact size of the "icon" */
    height: 120px;        /* Keep it square */
    object-fit: cover;   /* Crops the image to fit the square */
    border-radius: 8px;
    border: 2px solid #eee;
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.thumbnail-icon:hover {
    transform: scale(1.1);
    border-color: #4ca1af; /* Your accent teal */
}

/* Service Section */
.service-entry {
    border-left: 3px solid #007685; /* Your dark teal */
    padding-left: 20px;
    margin-bottom: 40px;
}

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

.service-org {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.service-role {
    font-weight: 600;
    color: #4ca1af; /* Muted teal */
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}

.journal-list {
    margin-top: 15px;
    padding: 12px;
    background-color: #fcfcfc;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

.journal-list ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.journal-list li {
    font-size: 0.85rem;
    background: #eee;
    padding: 2px 10px;
    border-radius: 4px;
    color: #555;
}

/* Hide the default tiny black triangle */
/* 1. Hides the default arrow on Chrome/Android/Desktop */
details summary::-webkit-details-marker {
    display: none;
}

/* 2. Hides the default arrow on Safari (iPhone/Mac) */
details summary {
    display: block; /* Required for Safari to hide the marker */
    list-style: none;
}

/* 3. The rotation - Works on all modern mobile browsers */
details[open] .toggle-chevron {
    transform: rotate(180deg);
}

.toggle-chevron {
    transition: transform 0.3s ease;
    display: inline-block; /* Required for rotation to work */
}

/* Styling for the multi-year range line */
.featured-year-line {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
    margin-top: 2px;
}

/* Styling for the single year inline */
.featured-year-inline {
    font-size: 1.1rem;
    color: #888;
    font-weight: 400;
    margin-left: 5px;
}

/* Ensure the featured card stays tight */
.featured-header {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}

.featured-role {
    font-weight: 600;
    color: #4ca1af;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.featured-details {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

/* Fix for TA Grid (Corrected Typo) */
.ta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Removed the double 'grid-template-columns:' */
    gap: 10px;
    margin-bottom: 30px;
}

/* Minimalist Teaching style */
.teaching-minimal {
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
    margin-bottom: 20px;
}

.teaching-minimal p {
    margin: 0;
    line-height: 1.5;
}

.teaching-minimal small {
    color: #666;
    display: block;
    margin-top: 4px;
}

.ta-item {
    padding: 5px 15px;      /* Added 15px on the left/right for breathing room */
    border-left: 2px solid rgba(44, 62, 80, 0.1); /* A softer version of your Slate */
    background: rgba(44, 62, 80, 0.02); /* Extremely faint tint to "box" it in */
    border-bottom: none;     /* Removed the old bottom line for a cleaner look */
    transition: border-color 0.3s ease;
}

.ta-item strong {
    color: #444;      /* Lightened from the default near-black (#333) */
    font-weight: 600; /* Medium-bold instead of the "heavy" default bold */
    font-size: 0.95rem;  /* Keeps it legible but not oversized */
}

.ta-year-inline {
    font-size: 0.85rem;
    color: #888;
    margin-left: 4px;
    white-space: normal; /* Allows long year strings to wrap to the next line naturally */
}

/* Ensure TA Grid still stacks on mobile */
@media (max-width: 768px) {
    .ta-grid {
        grid-template-columns: 1fr;
    }
}

/* Mentorship Items */

.mentorship-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 30px; /* Space between the two columns */
}

.mentee-item {
    margin-bottom: 0; /* Let the grid gap handle spacing */
    padding-bottom: 15px;
    border-bottom: 1px dashed #ddd;
    align-self: start; /* Prevents items from stretching to match height */
}

.mentee-header {
    display: flex;
    justify-content: space-between;
}

.award-card.card {
    border-left: 5px solid #b8860b; /* A soft gold/bronze border */
    background-color: #fffdf5;     /* Very faint gold tint */
}

/* --- Project Tabs (The Binder Look) --- */
.project-tabs {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid var(--accent-color);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 5px;
}

.tab-btn {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 20px;
    transition: 0.3s;
    font-size: 1rem;
    font-family: var(--font-main);
    color: #555;
    border-radius: 8px 8px 0 0; /* Rounded top corners like a file tab */
    margin-bottom: 0; /* Sits right on the line */
}

.tab-btn:hover {
    background-color: #ddd;
    color: var(--accent-color);
}

.tab-btn.active {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

/* --- The Carousel Area --- */
.projects-display-area {
    position: relative;
    min-height: 400px; /* Ensures the arrows sit nicely even if content is short */
    background: #fff;
    padding: 20px;
    border-radius: 0 0 12px 12px;
}

.category-container {
    position: relative;
    width: 100%;
}

/* --- The Navigation Arrows --- */
/* --- The Arrow Base --- */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(44, 62, 80, 0.1);
    color: var(--accent-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    
    /* 1. Only animate specific things, NEVER 'all' or 'pointer-events' */
    transition: background-color 0.2s, color 0.2s, opacity 0.2s; 
    
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow:hover {
    background: var(--accent-color);
    color: white;
}

.nav-arrow.left { left: 0; }
.nav-arrow.right { right: 0; }

/* --- The Robust Disabled State --- */
.nav-arrow.disabled,
.nav-arrow.disabled:hover { /* 2. This overrides the sticky mobile hover */
    opacity: 0.5 !important;
    background: #f0f0f0 !important; /* A solid light grey, never transparent */
    color: #ccc !important;
    cursor: default;
    pointer-events: none; /* Physically prevents clicking */
    box-shadow: none;
}

/* --- The Slide Content --- */
.slides-wrapper {
    padding: 0 50px; /* Make room for arrows on left/right */
}

.project-slide {
    display: none; /* Hidden by default */
    animation: fadeEffect 0.5s; /* Smooth fade in */
}

.project-slide.visible {
    display: block; /* Only the active slide shows */
}

.slide-title {
    text-align: center;
    color: var(--accent-color);
    margin-top: 0;
    border-bottom: none; /* Override default H2 line */
    font-size: 1.8rem;
}

.slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Split visual and text */
    gap: 30px;
    align-items: center;
    margin-top: 20px;
}

/* --- Full Width Layout (No Image) --- */
.slide-content.no-media-layout {
    grid-template-columns: 1fr; /* Switch from 2 columns to 1 */
    text-align: left;
}

.slide-content.no-media-layout .slide-text {
    max-width: 800px; /* Prevents text from stretching ridiculously wide */
    margin: 0 auto;   /* Centers the text block in the middle of the slide */
}

/* Images & Videos */
.slide-visual img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.slide-text {
    font-size: 1.05rem;
    color: #444;
    line-height: 1.7;
}

/* --- Animation --- */
@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* --- Mobile Stack --- */
@media (max-width: 768px) {
    .slide-content {
        grid-template-columns: 1fr; /* Stack vertically on phones */
    }
    
    .nav-arrow {
        width: 30px; 
        height: 30px;
        font-size: 1rem;
    }
    
    .slides-wrapper {
        padding: 0 35px;
    }
    
    .tab-btn {
        flex: 1 1 40%; /* Make tabs grow to fill rows on mobile */
        font-size: 0.9rem;
        padding: 10px;
    }
}

/* --- Gallery Stacking --- */
.visual-stack {
    position: relative;
    width: 100%;
}

.media-item {
    display: none; /* Hide everyone by default */
    animation: fadeEffect 0.4s;
}

.media-item.active {
    display: block; /* Only show the chosen one */
}

/* --- The 1-2-3 Buttons --- */
.media-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.media-dot {
    background: none;
    border: 1px solid #ddd;
    color: #888;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.media-dot:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.media-dot.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

/* --- Project Links --- */
.project-links {
    margin-top: 15px;
}

.repo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Space between icon and text */
    background-color: white;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none; /* Removes the underline */
}

.repo-btn:hover {
    background-color: var(--accent-color);
    color: white !important; /* Forces white text on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Mobile Specific Tweaks --- */
@media (max-width: 768px) {
    /* Stack mentorship back to 1 column on phones */
    .mentorship-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    margin-top: 10px;
}

.btn:hover {
    background: var(--accent-highlight);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Footer */
footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

/* Responsive adjustments for Phone */
@media (max-width: 768px) {
    /* Make the header description smaller on phones */
    .header .subtitle {
        font-size: 1rem; /* Reduced from 1.3rem */
        padding: 0 10px;
    }

    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .profile-img {
        margin: 0 auto;
        max-width: 300px; /* Your preferred phone width */
        height: 400px;    /* Your preferred phone height */
        padding: 0;       /* Removing the frame for phone to save space */
        
        /* Keep your crop settings */
        object-fit: cover;
        object-position: 60% center;
    }

    .intro-text {
        text-align: left;
    }

    .nav ul {
        gap: 10px;
    }

    .nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .header h1 {
        font-size: 2.2rem;
    }
}
