/* --- On-Scroll Animation Styles --- */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* Root Variables */
:root {
    --accent-color: #00ADB5;
    --background-color: #222831;
    --card-background: #393E46;
    --header-height: 120px; /* Default, will be updated by JavaScript */
}

/* Global Styles & Resets */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-padding-top: var(--header-height);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: #fff;
    
    /* Space for the fixed header */
    padding-top: var(--header-height);
    padding-bottom: 60px; 
    
    /* Text rendering settings */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    
    /* Ensure the pseudo-element sits behind the content */
    position: relative;
    min-height: 100vh;
}

/* --- NEW: Smooth Fixed Background for Mobile --- */
body::before {
    content: "";
    position: fixed; /* This locks the layer, not the image attachment */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Puts it behind your text */
    
    /* Move your background properties here */
    background-image: url('../assets/img/background-picture-rhizosphere.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    
    /* Optional: Tells the browser to optimize this layer for the GPU */
    will-change: transform; 
}

/* Header Styling */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(38, 38, 38, 0.75);
    padding: 0.5rem 1rem;
    text-align: center;
    transition: background-color 0.3s ease;
}

/* Modern enhancement with fallback for compatibility */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    header {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* Logo Styling */
.logo {
    width: 50vw;
    max-width: 350px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Navigation Menu */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

nav ul li a:hover {
    color: var(--accent-color);
}

/* Section Styling */
section {
    padding: 4rem 2rem;
    background-color: rgba(38, 38, 38, 0.85);
    max-width: 1000px;
    margin: 3rem auto;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

section h2 {
    margin-top: 0;
    font-size: 2.5rem;
    color: #fff;
}

section p {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Team Member Profiles */
.people {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tier {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.tier-1 .team-member {
    flex: 0 1 400px;
    margin: 1rem;
}

.tier-2 {
    gap: 2rem;
}

.tier-2 .team-member {
    flex: 1 1 300px;
    max-width: 350px;
}

.team-member {
    perspective: 1500px;
    cursor: pointer;
}

.card {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    will-change: transform; /* Performance hint for animation */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-radius: 8px;
    aspect-ratio: 3 / 4; /* Modern way to set aspect ratio */
}

/* Fallback for older browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 3 / 4) {
    .card::before {
        content: "";
        display: block;
        padding-top: 133.33%; /* 4:3 ratio */
    }
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden; /* For Safari */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

.card-front {
    background: #444;
}

.card-back {
    background-color: var(--card-background);
    transform: rotateY(180deg);
    padding: 1.5rem;
    text-align: left;
    justify-content: flex-start;
    overflow-y: auto;
}

/* Flip Effect */
.team-member.flipped .card {
    transform: rotateY(180deg);
}

.card-front h3, .card-front p {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    margin: 0;
    padding: 1.5rem 1rem 1rem;
    text-align: left;
}

.card-front h3 {
    padding-bottom: 2.5rem;
    font-size: 1.5rem;
}

.card-front p {
    font-size: 1rem;
    font-style: italic;
}

/* New styles for card images as backgrounds */
.card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* This applies our anti-copying rules to the div itself */
    pointer-events: none;
    user-select: none;
}

/* Assigning the specific images to each card */
#image-dthoms {
    background-image: url('../assets/img/dthoms_portrait.jpg');
}

#image-gdexter {
    background-image: url('../assets/img/gdexter_portrait.jpeg');
}

#image-dhiott {
    background-image: url('../assets/img/dhiott_portrait.jpg');
}
#image-mquarles {
    background-image: url('../assets/img/mquarles_portrait.jpg');
}
#image-cturner {
    background-image: url('../assets/img/cturner_portrait.jpeg');
}

#image-mwolfe {
    background-image: url('../assets/img/mwolfe_portrait.jpg');
}

/* Publications Grid */
.publications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    text-align: left;
}

.publication {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publication:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.publication h3 {
    margin: 0 0 0.5rem 0;
}
.publication a {
    font-weight: bold;
}

/* Contact Form */
#contactForm {
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: left;
}

#contactForm label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

#contactForm input {
    width: 100%;
    padding: 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contactForm input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 173, 181, 0.3);
    outline: none;
}

.h-captcha {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

#contactForm button {
    width: 100%;
    padding: 0.85rem;
    background-color: var(--accent-color);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#contactForm button:hover {
    background-color: #007B83;
    transform: scale(1.02);
}

/* Footer Styling */
footer {
    background-color: rgba(38, 38, 38, 0.9);
    color: #ccc;
    text-align: center;
    padding: 1.5rem 0;
    position: relative;
    width: 100%;
    margin-top: 3rem;
}

/* --- Social Links on Team Cards --- */
.contact-links {
    margin-top: 1.5rem; /* More space */
    border-top: 1px solid #555; /* Separator line */
    padding-top: 1rem;
    text-align: left;
}

.contact-links a {
    display: inline-block;
    color: #ccc; /* Icon color */
    margin-right: 1rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Remove text decoration from icon links */
.contact-links a:hover {
    transform: scale(1.2);
    color: var(--accent-color); /* Icon color on hover */
    text-decoration: none;
}

/* --- Research Section Styles --- */

.research-intro {
    max-width: 800px;
    margin: 0 auto 3rem auto; /* Center the intro text */
    text-align: center;
    line-height: 1.7;
}

.research-intro h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
}

.research-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    text-align: left;
}

.research-item {
    background-color: var(--card-background);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    border-left: 5px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.research-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.research-item h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #fff;
}


/* --- New styles to add to styles.css --- */

/* Styling for the new Lab Alumni section */
.alumni-section {
    text-align: center; /* Center the heading */
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.alumni-section h3 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: #fff;
}

/* Replace your existing .alumni-list rule with this */
.alumni-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    text-align: left;
    
    /* --- New properties for scrollability --- */
    max-height: 18rem; /* Approx. 3 rows. Adjust as needed. */
    overflow-y: auto; /* Enable vertical scroll if content exceeds max-height */
    padding-right: 1rem; /* Make space for the scrollbar */
}

.alumni-list li {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.alumni-list strong {
    color: #fff;
    font-weight: bold;
    display: block; /* Puts name on its own line */
    margin-bottom: 0.25rem;
}

/* --- Custom Scrollbar for Alumni List --- */
/* Works on WebKit browsers (Chrome, Safari, Edge) */
.alumni-list::-webkit-scrollbar {
  width: 8px;
}

.alumni-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.alumni-list::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.alumni-list::-webkit-scrollbar-thumb:hover {
  background-color: #00c9d4;
}

/* General Link Styling */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding-top: var(--header-height);
    }
    section {
        padding: 3rem 1rem;
        margin: 2rem auto;
    }
    section h2 {
        font-size: 2rem;
    }
    .tier-1 .team-member, .tier-2 .team-member {
        flex-basis: 90%;
        max-width: 350px;
    }
    .publications-grid {
        grid-template-columns: 1fr;
    }

    
}

/* Styling for the new Lab undergraduate section */
.undergraduate-section {
    text-align: center; /* Center the heading */
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.undergraduate-section h3 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: #fff;
}

/* Replace your existing .undergraduate-list rule with this */
.undergraduate-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    text-align: left;
    
    /* --- New properties for scrollability --- */
    max-height: 18rem; /* Approx. 3 rows. Adjust as needed. */
    overflow-y: auto; /* Enable vertical scroll if content exceeds max-height */
    padding-right: 1rem; /* Make space for the scrollbar */
}

.undergraduate-list li {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.undergraduate-list strong {
    color: #fff;
    font-weight: bold;
    display: block; /* Puts name on its own line */
    margin-bottom: 0.25rem;
}

/* --- Custom Scrollbar for undergraduate List --- */
/* Works on WebKit browsers (Chrome, Safari, Edge) */
.undergraduate-list::-webkit-scrollbar {
  width: 8px;
}

.undergraduate-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.undergraduate-list::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.undergraduate-list::-webkit-scrollbar-thumb:hover {
  background-color: #00c9d4;
}

/* --- Mobile Fix for Lists --- */
@media (max-width: 768px) {
    .alumni-list,
    .undergraduate-list {
        /* Force a single column that takes up 1 fraction of the available space */
        grid-template-columns: 1fr; 
        
        /* Optional: Reduces side padding slightly on mobile to give text more room */
        padding-left: 0; 
        padding-right: 10px; 
    }
}