/* In style.css */

/* --- THEME AND FONT VARIABLES (Same as before) --- */
:root {
    --bg-color: #f4f7f9;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --heading-color: #003366;
    --accent-color: #00539b;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --border-color: #e0e0e0;
}
body.dark-mode {
    --bg-color: #121212;
    --card-bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --heading-color: #87b2de;
    --accent-color: #5d9cec;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --border-color: #444;
}

/* --- GENERAL STYLES --- */
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
a {
    color: var(--accent-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- NEW: SHARED HEADER AND NAVIGATION --- */
.site-header {
    background: var(--card-bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-area {
    display: flex;
    align-items: center;
}
.logo-area img {
    height: 75px; /* Adjust as needed */
    margin-right: 15px;
}
.logo-area h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--heading-color);
}
.main-nav a {
    color: var(--text-color);
    padding: 10px 15px;
    font-weight: 600;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.main-nav a.active, .main-nav a:hover {
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
}

/* --- NEW: SHARED FOOTER --- */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: #888;
}

/* --- CONTENT STYLES --- */
.page-title {
    background-color: var(--heading-color);
    color: #fff;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 30px;
}
.content-section {
    background: var(--card-bg-color);
    padding: 30px;
    margin-top: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* --- NEW: PUBLICATIONS PAGE STYLES --- */

.publication-list {
    list-style-type: none; /* Removes default bullet points */
    padding: 0;
}

.publication-item {
    padding: 20px;
    border-left: 5px solid var(--accent-color);
    background-color: var(--bg-color); /* A slightly different background to stand out */
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0; /* Rounded corners on one side */
    transition: transform 0.3s, box-shadow 0.3s;
}

.publication-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.publication-item p {
    margin: 0 0 8px 0; /* Spacing between lines */
}

.publication-item .title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--heading-color);
}

.publication-item .authors {
    font-style: italic;
    color: #555; /* A consistent color for authors */
}
body.dark-mode .publication-item .authors {
    color: #aaa; /* Lighter author text for dark mode */
}

.publication-item .journal {
    font-size: 1rem;
    color: var(--text-color);
}

/* Add this to the bottom of your publications styles */

.publication-item .title a {
    color: inherit; /* This makes the link take the same color as the parent (.title) */
    text-decoration: none; /* This removes the default underline */
    transition: color 0.3s;
}

.publication-item .title a:hover {
    color: var(--accent-color); /* Changes color on hover to the site's accent color */
    text-decoration: underline; /* Adds an underline ONLY on hover for clear feedback */
}

/* --- NEW: MEMBERS PAGE STYLES --- */

/* Supervisor Profile Section */
.supervisor-profile {
    display: flex;
    align-items: center;
    gap: 30px; /* Space between image and text */
    flex-wrap: wrap; /* Allows it to stack on smaller screens */
}

.supervisor-profile img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--border-color);
}

.supervisor-info {
    flex: 1; /* Allows text to take up remaining space */
}
.supervisor-info h4 {
    font-size: 1.8rem;
    color: var(--heading-color);
    margin: 0 0 5px 0;
}

/* Grid for Current and Past Members */
.member-grid {
    display: grid;
    /* This creates a responsive grid that adds/removes columns automatically */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.member-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.member-card img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--card-bg-color); /* Creates a nice inset effect */
    box-shadow: 0 2px 5px var(--shadow-color);
}

.member-card h4 {
    font-size: 1.3rem;
    color: var(--heading-color);
    margin: 0 0 5px 0;
}

.member-card .role {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin: 0 0 10px 0;
}

.member-card .duration {
    font-size: 0.9rem;
    color: #777;
    margin: 0;
}
body.dark-mode .member-card .duration {
    color: #aaa;
}

.member-card .current-status {
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 10px;
}

/* Style for the links on member names */
.supervisor-info h4 a,
.member-card h4 a {
    color: inherit; /* Makes the link take the color of the h4 tag (var(--heading-color)) */
    text-decoration: none; /* Removes the underline */
    transition: color 0.3s;
}

/* Style for when you hover over the name links */
.supervisor-info h4 a:hover,
.member-card h4 a:hover {
    color: var(--accent-color); /* Changes color to the site's accent color */
    text-decoration: underline; /* Adds an underline on hover */
}


/* --- NEW: RESEARCH PAGE STYLES --- */

.research-theme {
    display: flex;
    align-items: center;
    gap: 40px; /* Space between image and text */
    margin-bottom: 50px; /* Space between theme sections */
    flex-wrap: wrap; /* For responsiveness */
}

/* This is the cool part: every 2nd (even) theme will flip its layout */
.research-theme:nth-child(even) {
    flex-direction: row-reverse;
}

.research-theme img {
    max-width: 400px;
    flex: 1; /* Allows image to shrink on smaller screens */
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.research-theme video {
    max-width: 400px;
    width: 100%; /* Makes it responsive */
    flex: 1;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.research-theme .theme-description {
    flex: 2; /* Gives the text more space than the image */
}

.research-theme h3 {
    font-size: 1.6rem;
    color: var(--heading-color);
    margin-top: 0;
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
}

.research-theme .keywords {
    font-size: 0.9rem;
    font-style: italic;
    color: #777;
}
body.dark-mode .research-theme .keywords {
    color: #aaa;
}

.media-stack {
    display: flex;
    flex-direction: column; /* This is the key: it stacks items vertically */
    gap: 20px; /* This adds a nice space between your two videos */
    
    /* These next two lines ensure it takes up the same space as the single images/videos */
    max-width: 400px;
    flex: 1;
}

/* We also need to adjust the video rule slightly */
.research-theme video, .media-stack video {
    width: 100%; /* This makes the video fill its container */
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
}


/* --- NEW: HOME PAGE IMAGE GRID STYLES --- */

.image-grid {
    display: grid;
    /* This creates 3 equal-width columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* This is the space between the images */
    margin-top: 30px; /* Space above the grid */
}

.grid-item {
    width: 100%;
    /* This forces a square shape. Adjust if you want rectangles. */
    aspect-ratio: 1 / 1; 
}

.grid-item img {
    width: 100%;
    height: 100%;
    /* This is the key property for uniform images. It prevents stretching. */
    object-fit: cover; 
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.grid-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px var(--shadow-color);
}


/* --- NEW: HOME PAGE ADDRESS SECTION STYLE --- */
#contact-info h3 {
    border-bottom: 3px solid var(--accent-color); /* Matches other section titles */
    padding-bottom: 5px;
}
#contact-info p {
    line-height: 1.7; /* Improves readability */
}


/* --- WHAT'S NEW SCROLLBOX STYLES --- */
.news-scroll-box {
    /* This controls the height. 300px shows about 3-4 items. Adjust as needed. */
    max-height: 300px; 
    
    /* This enables the vertical scrollbar on the side when content is too long */
    overflow-y: auto; 
    
    /* Adds some breathing room inside the box */
    padding-right: 15px; 
    
    /* Optional: Adds a subtle inner shadow or border to show it's a container */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.5); /* Slight tint */
}

/* Custom Scrollbar Styling (Makes it look modern) */
.news-scroll-box::-webkit-scrollbar {
    width: 8px;
}
.news-scroll-box::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}
.news-scroll-box::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 4px;
}
.news-scroll-box::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color); 
}


/* ==========================================================================
   MOBILE RESPONSIVE STYLES
   ========================================================================== */

/* Apply these styles ONLY on screens 768px or smaller */
@media (max-width: 768px) {

    /* --- GENERAL LAYOUT --- */
    .container {
        padding: 15px; /* Reduce padding on the sides for more space */
    }

    /* --- HEADER AND NAVIGATION --- */
    .site-header .container {
        flex-direction: column; /* Stack the logo and nav vertically */
        gap: 15px;
    }
    .logo-area h1 {
        font-size: 1.2rem; /* Make the lab name smaller */
    }
    .main-nav {
        width: 100%;
        display: flex;
        justify-content: space-around; /* Space out nav links */
    }
    .main-nav a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    /* --- PAGE TITLES AND HEADINGS --- */
    .page-title h2 {
        font-size: 1.8rem;
    }
    .content-section h2, .content-section h3 {
        font-size: 1.5rem;
    }

    /* --- RESEARCH PAGE LAYOUT --- */
    .research-theme {
        flex-direction: column !important; /* Stack image/video and text vertically */
        gap: 20px;
    }
    /* This undoes the row-reverse for the even items, so they all stack the same way */
    .research-theme:nth-child(even) {
        flex-direction: column !important;
    }
    .research-theme img,
    .research-theme video,
    .media-stack {
        max-width: 100%; /* Allow media to fill the width */
    }

    /* --- MEMBERS PAGE LAYOUT --- */
    .supervisor-profile {
        flex-direction: column; /* Stack supervisor image and info */
        text-align: center;
    }
    .member-grid {
        /* On mobile, we can force it to be a single column for clarity */
        grid-template-columns: 1fr;
    }
	/* ADD THIS NEW RULE for the image grid */
    .image-grid {
        /* Change to 2 columns on tablets and smaller screens */
        grid-template-columns: repeat(2, 1fr);
    }

}