/* -------------------------------------------
Project : THOR Neuromorphic Commons
Author  : Tej Pandit
Date    : Oct 2025
------------------------------------------- */

/* Fonts and Icons */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100;200;300;400;500;600;700;800;900&display=swap");
@import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css);

/* General Body Styles */
html, body {
    font-family: "Outfit", sans-serif;
    font-size: 16px;
    font-weight: 300;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll from AOS animations */
}
 
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
/* ------------------------------------------- */
 
/* Header Styles */
.main-header {
    color: #fff;
    padding: 1rem 0;
    background: rgba(20, 20, 20, 0.5); /* Subtle background for dark sections */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 990;
    transition: background 0.3s ease; /* Smooth transition for header background */
    backdrop-filter: blur(10px);
}

.main-header.header-light {
    background: rgba(255, 255, 255, 0.2); /* Light background for light sections */
}
 
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px; /* Adjust as needed */
    filter: invert(0); /* Default: Makes the logo white (assuming original is dark) */
    transition: filter 0.3s ease; /* Smooth transition for logo color change */
}
.main-header.header-light .logo img {
    filter: invert(1); /* Revert to original (dark) color for light sections */
}
/* ------------------------------------------- */ 

/* Navigation Bar Styles */
.nav-menu {
    padding: 0;
    list-style: none;
    margin: 0;
}
 
.nav-menu li {
    display: inline;
    margin-right: 20px;
}
 
.nav-menu li:last-child {
    margin-right: 0;
}
 
.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease; /* Smooth transition for link color */
}
.main-header.header-light .nav-menu a {
    color: #333; /* Dark link color for light sections */
}
/* ------------------------------------------- */

/* Mobile Menu Specifics */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
}
 
.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 5px 0;
    transition: background 0.3s ease; /* Smooth transition for hamburger color */
}
.main-header.header-light .menu-toggle span {
    background: #333; /* Dark hamburger color for light sections */
}
 
.mobile-menu-fullscreen {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.98);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-menu-fullscreen.is-open {
    display: flex; /* Show the menu */
}

.mobile-menu-fullscreen .nav-menu li {
    display: block;
    margin: 0 0 2rem 0;
    text-align: center;
}

.mobile-menu-fullscreen .nav-menu a {
    font-size: 1.8rem;
}

.menu-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-close-btn .fa-times {
    color: #fff;
    font-size: 2rem;
}
/* ------------------------------------------- */

/* START Test Banner Section  TODO => remove after launch Nov 12, 2025*/
.test-banner {
    background-image: url('../img/home/lsnc.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center; /* Vertically center content */ 
    text-align: left;
}

.test-banner .container {
    padding-top: 25rem; /* Adjust this value to position banner content */
    width: 100%;
}
 
.test-banner h1 {
    margin: 0 0 1rem 0;
    font-size: 4.5rem;
    font-weight: 300;
    line-height: 1.1;
    text-shadow: 8px 8px 12px rgb(0, 0, 0);
}
/* END Test Banner Section  TODO => remove after launch Nov 12, 2025*/

/* ------------------------------------------- */

/* Main Banner Section */
.main-banner {
    background-image: url('../img/home/Spin2Array.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center; /* Vertically center content */ 
    text-align: left;
}

.main-banner .container {
    padding-top: 25rem; /* Adjust this value to position banner content */
    width: 100%;
}
 
.main-banner h1 {
    margin: 0 0 1rem 0;
    font-size: 4.5rem;
    font-weight: 300;
    line-height: 1.1;
    text-shadow: 8px 8px 12px rgb(0, 0, 0);
}

.main-banner h1 span{
    font-weight: 600;
}
 
.main-banner p {
    margin: 0;
    font-size: 1.3rem;
    max-width: 500px; /* Constrain line length for readability */
}

.banner-actions {
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px; /* Rounded corners */
    margin-right: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-primary {
    background-color: #ffa304; /* Yellow */
    color: #333;
}

.btn-primary:hover {
    background-color: #f0d06f;
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
}
/* ------------------------------------------- */

/* Research Section */
.home-ecosystem-section {
    padding: 5rem 0;
    position: relative;
}

/* .home-ecosystem-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background: linear-gradient(180deg,rgba(18, 18, 18, 1) 26%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
} */

.ecosystem-grid-wrapper {
    padding: 2rem 0;
}

.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-item {
    border: 1px solid #ddd;
    background-color: #fff; /* Fallback and background for text */
    position: relative; /* Required for the pseudo-element */
    padding-top: 160px; /* 16:9 Aspect Ratio for the image area */
}

/* Create a pseudo-element for the background image on mobile */
.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px; /* Match the padding-top to define image height */
    background-size: cover;
    background-position: center;
}

/* Reset link styling for grid items that are links */
.grid-item {
    text-decoration: none;
    color: inherit;
}

.grid-item-content {
    padding: 1rem;
}

.grid-item-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #111;
}

.grid-item-content p {
    margin: 0;
}

/* Add images for each item */
.grid-item:nth-child(1)::before { background-image: url('../img/home/spinnaker2.jpg'); }
.grid-item:nth-child(2)::before { background-image: url('../img/home/code.jpg'); }
.grid-item:nth-child(3)::before { background-image: url('../img/home/Neuro Community.jpg'); }
.grid-item:nth-child(4)::before { background-image: url('../img/home/tutorial-session.jpg'); }

/* ------------------------------------------- */

/* Ecosystem Page Specifics */
.ecosystem-hardware {
    padding-top: 80px; /* Space for fixed header */
    padding-bottom: 5rem;
    background-color: #121212;
}

.ecosystem-software {
    padding-top: 80px; /* Space for fixed header */
    padding-bottom: 5rem;
    /* background-color: #121212; */
}

.ecosystem-banner {
    background-size: cover;
    background-position: center 30%;
    color: #fff;
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 3rem;
}

.ecosystem-hardware .ecosystem-banner{
    background-image: url('../img/home/neuromorphic_hardware.jpg');
}

.ecosystem-software .ecosystem-banner{
    background-image: url('../img/home/neuromorphic_software.jpg');
}

.ecosystem-banner::after { /* Add an overlay for better text readability */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

.ecosystem-banner .banner-content {
    position: relative;
    z-index: 2;
}

.ecosystem-banner h1 {
    font-size: 3rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.ecosystem-hardware .ecosystem-intro-content p {
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
}

.ecosystem-software .ecosystem-intro-content p {
    color: #303030;
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
}

/* Hardware Systems Grid */
.hardware-systems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.software-systems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.hardware-card {
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.hardware-card.thor-available {
    border: 1px solid #ffa304;
    position: relative; /* Needed for banner positioning */
    overflow: hidden; /* To contain the banner */
}

.thor-available-banner {
    position: absolute;
    top: 12px;
    right: -35px;
    background-color: #ffa304;
    color: #1f1f1f;
    padding: 5px 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.software-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.hardware-card:hover,
.software-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.hardware-card-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 600;
}

.software-card-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3rem;
    color: #303030;
    font-weight: 600;
}

.hardware-developer,
.software-developer {
    font-size: 0.9rem;
    color: #9e9e9e;
    display: block;
    margin-bottom: 1rem;
}

.hardware-card-body,
.software-card-body {
    flex-grow: 1; /* Pushes footer to the bottom */
}

.hardware-card-body p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify;
    max-height: 120px; /* Set a maximum height for the paragraph */
    overflow-y: auto; /* Enable vertical scrolling */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.hardware-card-body p::-webkit-scrollbar {
    display: none;
}

.software-card-body p {
    color: #303030;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify;
    max-height: 120px; /* Set a maximum height for the paragraph */
    overflow-y: auto; /* Enable vertical scrolling */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari, and Opera */
.software-card-body p::-webkit-scrollbar {
    display: none;
}

.hardware-card-footer,
.software-card-footer {
    margin-top: 1rem;
}

.btn-link {
    color: #ffa304;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #f0d06f;
}


/* News Section */
.home-news-section {
    padding: 5rem 0;
    background-color: #121212;
    color: #fff;
}

.home-news-section h2 {
    /* text-align: center; */
    /* font-size: 2.5rem; */
    font-weight: 600;
    margin-bottom: 3rem;
}

.news-carousel-wrapper {
    position: relative;
}

.news-carousel {
    width: 100%;
    height: 100%;
}

.news-item {
    background-color: #1f1f1f;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure items in a row have same height */
    max-height: 600px;
    padding-left: 10px;
    padding-right: 10px;
}

.news-item img {
    width: 100%;
    height: 240px; /* Fixed height for images */
    object-fit: cover; /* Ensures image covers the area without distortion */
    display: block;
    margin-top: 10px;
    border-radius: 5px;
}

.news-item-content {
    padding: 1.5rem;
    flex-grow: 1; /* Allows content to fill remaining space */
}

.news-item-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.news-item-content .news-date {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 1rem;
}

.news-item-content p {
    margin: 0;
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.6;
    text-align: justify;
    height: 100%;
    max-height: 200px;
    overflow-y: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.news-item-content p::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}



/* Custom Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    color: #ffa304; /* Match your primary button color */
    width: 50px;
    height: 50px;
    background-color: rgba(31, 31, 31, 0.8);
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.2rem; /* Smaller arrow icons */
    font-weight: bold;
}

/* About Section */
.about-content {
    display: flex;
    flex-direction: row; /* Side-by-side on desktop */
    text-align: left;
    align-items: center;
    gap: 3rem;
}
.about-text {
    flex: 1; /* Allows the text block to grow and fill available space */
}
.about-text .text-thin {
    font-weight: 200;
}

.about-text p {
    margin-top: 50px;
    margin-right: 40px;
    text-align: justify;
}

.about-image {
    flex: 0 0 40%; /* Don't grow, don't shrink, base width of 40% */
    max-width: 450px; /* Prevents the image from becoming excessively large */
}

.about-image img {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    display: block; /* Removes any extra space below the image */
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background-color: #f4f4f4;
}

/* ------------------------------------------- */

/* Partner Section */
.partner-section {
    padding: 5rem 0;
    background-color: #f4f4f4;
}

.partner-section h1 {
    margin-bottom: 100px;
}

.partner-section .section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #333;
}

.partner-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.partner-item {
    position: relative;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    flex-basis: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.partner-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.partner-item img {
    max-width: 80%;
    /* max-height: 60px; */
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.partner-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

.partner-lead {
    background-color: #ffffff; /* Slightly different background */
    transform: scale(1.05);
}

.partner-lead-title {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffa304;
    color: #fff;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 60%;
    text-align: center;
}

.support-agency img {
    max-width: 300px;
}

.support-agency-grid {
    justify-content: left;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 20px;
    background: #333;
    color: #fff;
}
/* ------------------------------------------- */



/* Basic Responsive: Hide desktop nav on small screens */
@media (max-width: 768px) {
    .desktop-menu {
        display: none;
    }
    .menu-toggle {
        display: block;
    }

    .main-header .container {
        /* Ensure toggle is on the far right */
        justify-content: space-between;
    }

    .main-nav {
        /* Ensure toggle is part of the nav flow */
        display: flex;
        align-items: center;
    }

    .mobile-nav a:hover {
        color: #ffa304;
    }

    .main-banner h1 {
        font-size: 3rem;
    }

    .ecosystem-details {
        display: none;
    }

    .news-item {
        padding-left: 40px;
        padding-right: 40px;
    }

    .about-content {
        flex-direction: column; /* Stack items vertically */
        text-align: center;
    }

    .about-image {
        margin-top: 2rem;
        max-width: 400px; /* Constrain image size on mobile */
    }
    .ecosystem-banner h1 {
        font-size: 2.5rem;
    }
    .hardware-systems,
    .software-systems {
        grid-template-columns: repeat(2, 1fr);
    }
    .hardware-card, 
    .software-card {
        padding: 10px;
    }
    .hardware-card-header h3,
    .software-card-header h3 {
        font-size: 1.2rem;
    }
    .hardware-card-body p,
    .software-card-body p {
        text-align: left;
    }
    .hardware-card-footer a,
    .software-card-footer a {
        font-size: 0.9rem;
    }
    .support-agency-grid {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .grid-item {
        padding-top: 160px; /* Reset mobile padding */
    }
    .about-text p {
        margin-top: 10px;
        margin-right: 0px;
    }
    .about-image img {
        height: 400px;
    }
    .partner-item {
        max-width: 120px;
        padding: 10px;
    }
    .partner-item img {
        max-width: 100%;
    }
    .support-agency-grid {
        justify-content: center;
    }
    .support-agency {
        max-width: 100%;
        
    }
    .support-agency img {
        max-width: 80%;
    }
}

/* --- Desktop Layout for Ecosystem Section --- */
@media (min-width: 769px) {
    .home-ecosystem-section .container .ecosystem-desktop-layout {
        display: flex; /* Enable flexbox for 70/30 split */
        gap: 2rem; /* Space between grid and details */
        align-items: flex-start; /* Align items to the top */
    }

    .ecosystem-grid-wrapper {
        flex: 7; /* Occupy 70% width */
        /* The actual grid will be inside this wrapper */
    }

    .ecosystem-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2x2 grid inside the 70% wrapper */
        grid-template-rows: repeat(2, 1fr);
        gap: 0;
        height: 600px; /* Or a suitable height */
        /* Removed border from .ecosystem-grid to avoid double borders with grid-item borders */
    }


    /* On desktop, apply background image to the item itself, not the pseudo-element */
    .grid-item {
        padding-top: 0; /* Reset mobile padding */
    }

    .grid-item {
        grid-column: span 2; /* Each item takes half the width */
        position: relative;
        overflow: hidden;
        border: 1px solid #ddd;
        display: flex;
        align-items: flex-end; /* Align content to the bottom */
        background-size: cover;
        background-position: center;
    }

    .grid-item::before {
        display: none; /* Hide the mobile-only image pseudo-element */
    }

    .grid-item-content {
        position: relative; /* Ensure content is above the background image */
    }

    .grid-item-content {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(8px);
        width: 100%;
        transition: transform 0.3s ease;
        transform: translateY(calc(100% - 4.5rem)); /* Hide most of the content */
        padding: 1rem 1.5rem;
    }

    .grid-item:hover .grid-item-content,
    .grid-item.is-active .grid-item-content {
        transform: translateY(0);
    }

    .grid-item:hover {
        cursor: pointer;
    }

    .grid-item:hover h3 {
        color: #234172;
    }

    .grid-item-content h3 {
        font-size: 1.2rem;
    }

    /* Position the grid items */
    .grid-item:nth-child(1) { grid-area: 1 / 1 / 2 / 2; background-image: url('../img/home/spinnaker2.jpg'); }
    .grid-item:nth-child(2) { grid-area: 1 / 2 / 2 / 3; background-image: url('../img/home/code.jpg'); }
    .grid-item:nth-child(3) { grid-area: 2 / 1 / 3 / 2; background-image: url('../img/home/Neuro Community.jpg'); }
    .grid-item:nth-child(4) { grid-area: 2 / 2 / 3 / 3; background-image: url('../img/home/tutorial-session.jpg'); }

    /* New styles for the details panel */
    .ecosystem-details {
        flex: 3; /* Occupy 30% width */
        background-color: #fff;
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        height: 600px; /* Match grid height for visual balance */
        overflow-y: auto; /* If content exceeds height */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .ecosystem-details::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .ecosystem-details h3 {
        margin-top: 0;
        color: #111;
        font-size: 1.5rem;
    }

    .ecosystem-details p {
        color: #555;
        line-height: 1.6;
    }

    .ecosystem-details .detail-list {
        list-style: none;
        padding: 0;
        margin-top: 1.5rem;
    }

    .ecosystem-details .detail-list li {
        background-color: #f9f9f9;
        border-left: 3px solid #ffa304;
        padding: 0.8rem 1rem;
        margin-bottom: 0.5rem;
        border-radius: 4px;
        font-size: 0.95rem;
        color: #333;
    }

    /* Adjust swiper nav for desktop */
    .swiper-button-prev { left: -25px; }
    .swiper-button-next { right: -25px; }
}

/* ------------------------------------------- */
/* Home Timeline Section */
.home-timeline-section {
    padding: 5rem 0;
    background-color: #f4f4f4;
}

/* .home-timeline-section h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #333;
} */

.timeline-wrapper {
    overflow-x: auto;
    padding: 15rem 0; /* Increased padding to accommodate content above/below */
    /* Hide scrollbar for a cleaner look */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.timeline-wrapper.active-drag {
    cursor: grabbing;
    cursor: -webkit-grabbing;
    transform: scale(1.01); /* Optional: slightly lift the timeline on drag */
    /* Prevent text selection while dragging */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}


.timeline-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.timeline {
    position: relative;
    display: flex;
    /* Set a min-width to control the overall timeline length and spacing */
    min-width: 1200px; 
    padding: 0 50px; /* Add padding to the ends */
    align-items: flex-start; /* Align items to the top of the container */
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #ddd;
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1; /* Distribute items evenly */
    z-index: 2;
}

.timeline-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #fff;
    border: 4px solid;
    z-index: 3;
}

.timeline-dot.dot-milestone { border-color: #ffa304; }
.timeline-dot.dot-community { border-color: #234172; }

.timeline-content {
    position: absolute;
    width: 200px;
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: left;
}

.timeline-content::before { /* The connector line */
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    background-color: #ddd;
    transform: translateX(-50%);
}

.timeline-content.content-above {
    bottom: 40px; /* Space between dot and box */
}

.timeline-content.content-above::before {
    top: 100%;
    height: 22px; /* Length of the connector */
}

.timeline-content.content-below {
    top: 40px; /* Space between dot and box */
}

.timeline-content.content-below::before {
    bottom: 100%;
    height: 22px; /* Length of the connector */
}

.timeline-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.timeline-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.timeline-date {
    font-style: italic;
    color: #888;
    margin-bottom: 0.5rem !important; /* Add some space below the date */
}


@media (max-width: 480px) {
    .timeline-content {
        width: 150px;
    }
    .timeline {
        min-width: 600px; /* reduces the spacing between events */
    }
    
}

/* Team Members Section */
.members-pi {
    padding: 5rem 0;
    background-color: #121212;
    color: #fff;
}

.members-pi h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.members-pi .section-description {
    text-align: center;
    font-size: 1.1rem;
    color: #ccc;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
    padding: 2rem 0;
}

.member-card {
    background-color: transparent; /* Important for flip effect */
    height: 400px; /* Fixed height for consistent card size */
    perspective: 1000px; /* For 3D flip effect */
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden; /* Ensures content stays within rounded corners */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.member-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 8px;    
    box-sizing: border-box; /* Include padding in width/height */
    transform: translateZ(0); /* Promotes to a compositing layer to fix Safari/FF flip issue */
}

.card-front {
    display: flex;
    align-items: flex-end; /* Align overlay to the bottom */
    background-color: #1f1f1f;
    color: #fff;
}

.member-card.is-flipped .card-front {
    /* When flipped, disable pointer events on the front to allow scrolling on the back */
    pointer-events: none;
}

.card-back {
    background-color: #ffce7b; /* Accent color for the back */
    color: #1a1a1a;
    transform: rotateY(180deg);
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex; /* Override default flex-direction from .card-front */
    flex-direction: column;
    justify-content: center; /* Vertically center the content */
    align-items: flex-start; /* Horizontally align text to the left */
    padding: 1.5rem;
    overflow-y: auto; /* Use auto to only enable scroll when needed */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.card-back p {
    margin: 0;
    overflow-y: auto; /* Use auto to only enable scroll when needed */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.card-back::-webkit-scrollbar {
    display: none;
}

.member-photo-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px; /* Match parent card's radius */
    z-index: 1;
}

.card-front-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0,0, 0.7) 50%, transparent 100%);
    box-sizing: border-box;
    text-align: left;
    border-radius: 0 0 8px 8px;
}

.member-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.member-card .member-title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: #ccc;
}

.member-card .member-affiliation {
    font-size: 0.9rem;
    color: #9e9e9e;
}

/* Styling for Lead PI and Lead Engineer (from the same institute) */
.member-card.is-lead-pi .card-front,
.member-card.is-lead-engineer .card-front {
    /* background-color is now covered by the image */
    border: 2px solid #ffa304; /* Stronger border */
}

.member-card.is-lead-pi .card-front-overlay,
.member-card.is-lead-engineer .card-front-overlay {
    background: linear-gradient(to top, rgba(35, 65, 114, 0.95) 0%, rgba(35, 65, 114, 0.8) 50%, transparent 100%);
}

.member-card.is-lead-pi h3,
.member-card.is-lead-engineer h3 {
    color: #fff;
}

.member-card.is-lead-pi .member-title,
.member-card.is-lead-engineer .member-title {
    color: #e0e0e0;
}

.member-card.is-lead-pi .member-affiliation,
.member-card.is-lead-engineer .member-affiliation {
    color: #c0c0c0;
}

/* Responsive adjustments for team grid */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    .member-card {
        height: 380px;
    }
    .members-pi h1 {
        font-size: 2rem;
    }
    .members-pi .section-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr); /* Double column on very small screens */
        padding: 1rem 0;
        gap: 1rem; /* Slightly reduce gap for smaller screens */
    }
    .member-card {
        height: 350px;
    }
    .member-card h3 {
        font-size: 1.2rem;
    }
    .card-back {
        font-size: 0.9rem;
    }
    .card-back {
        justify-content: baseline;
    }
}

/* ------------------------------------------- */
/* Contact Page Section */
.contact-map-section {
    padding: 5rem 0;
    padding-top: 150px; /* More space for header */
    background-color: #121212;
    color: #fff;
}

.contact-map-section h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.contact-map-section .section-description {
    text-align: center;
    font-size: 1.1rem;
    color: #ccc;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.map-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    width: 80%;
    margin: 0 auto;
}

.map-image {
    width: 100%;
    display: block;
    height: 500px; /* Set a fixed height for the image container */
    transition: opacity 1s ease-in-out; /* Smooth fade transition */
    object-fit: cover; /* Ensures the image covers the area, may crop edges */
    background-color: #000; /* Optional: background for letterboxing if using object-fit: contain */
}

.address-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    color: #fff;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    box-sizing: border-box;
}

.address-overlay p {
    margin: 0;
    font-size: 1.1rem;
}

.address-overlay p:first-child {
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.contact-apply-section {
    padding: 5rem 0;
}

.contact-apply-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.apply-text {
    flex: 1;
}

.apply-text h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.apply-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

.apply-qr {
    flex: 0 0 300px;
    text-align: center;
}

.apply-qr img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .contact-apply-content {
        flex-direction: column;
        text-align: center;
    }
    .map-container {
        width: 100%;
    }
    .map-image {
        height: 300px; /* Adjust height for smaller screens */
    }
}

/* ------------------------------------------- */
/* Recent Events Section */

.events-recent {
    padding: 5rem 0;
    background-color: #f4f4f4;
}

.events-recent h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #333;
}

.recent-event-entry {
    display: flex;
    gap: 2rem;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    margin-bottom: 2rem;
    align-items: center;
}

.recent-event-images {
    flex: 0 0 40%; /* 40% width, don't grow or shrink */
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    height: 250px; /* Fixed height for the image container */
}

.recent-event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1s ease-in-out; /* Match JS transition duration */
}

.recent-event-details {
    flex: 1; /* Take up remaining space */
}

.recent-event-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111;
}

.recent-event-details p {
    text-align: justify;
}

.recent-event-details a {
    background-color: #cecece;
    font-size: 12px;
    border-radius: 10px;
    padding: 10px;
}

.recent-event-details a:hover {
    background-color: #5d5d5d;
    color: white;
}

.recent-event-details .event-meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .recent-event-entry {
        flex-direction: column;
        text-align: center;
    }
    .recent-event-images {
        max-width: 100%;
        width: 100%;
        margin-bottom: 1.5rem;
    }
}

/* ------------------------------------------- */
/* Contact People Section */
.contact-people-section {
    padding: 5rem 0;
    background-color: #121212;
    color: #fff;
}

.contact-people-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
}

.contact-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-entry {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: #1f1f1f;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
}

.contact-photo {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    object-fit: cover;
    border: 2px solid #444;
}

.contact-info {
    flex-grow: 1; /* Pushes the button to the right */
}

.contact-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.contact-info p {
    margin: 0;
    color: #ccc;
}

@media (max-width: 480px) {
    .contact-entry {
        flex-direction: column;
        text-align: center;
    }
    .contact-info {
        margin-bottom: 1rem;
    }
}

/* ------------------------------------------- */
/* Resources/Tutorials Page Section */
.resources-tutorials {
    padding: 5rem 0;
    padding-top: 150px;
    background-color: #121212;
    color: #fff;
}

.resources-tutorials h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.resources-tutorials .section-description {
    text-align: center;
    font-size: 1.1rem;
    color: #ccc;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.tutorial-card {
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.tutorial-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.tutorial-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ensures content fills space and footer is at bottom */
}

.tutorial-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 600;
}

.tutorial-meta {
    font-size: 0.9rem;
    color: #9e9e9e;
    display: block;
    margin-bottom: 1rem;
}

.tutorial-body {
    flex-grow: 1;
}

.tutorial-body p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tutorial-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-type {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    text-transform: uppercase;
}

.tutorial-type.software { background-color: #234172; color: #fff; }
.tutorial-type.benchmarking { background-color: #004726; color: #fff; }
.tutorial-type.hardware { background-color: #ffa304; color: #333; }
.tutorial-type.hw-sw { background-color: #5d5d5d; color: #fff; }

.tutorial-footer .btn {
    padding: 0.6rem 1.2rem;
}

/* ------------------------------------------- */
/* Events Timeline Section */

/* Events Banner Section */
.events-banner {
    padding: 7rem 0;
    background-color: #121212;
    color: #fff;
    padding-bottom: 20px;
}

.events-banner h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.events-banner .section-description {
    text-align: center;
    font-size: 1.1rem;
    color: #ccc;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

/* Events Timeline Section */
.events-timeline {
    padding: 2rem 0;
    background-color: #121212;
    padding-bottom: 150px;
}

.events-timeline .container {
    /* Override default container padding to allow slider to go edge-to-edge */
    max-width: none;
    padding: 0;
    /* height: 100vh; */
}

.events-timeline .swiper {
    height: 100%;
    padding: 0 20px; /* Add padding here to keep content from touching screen edges */
}

.events-timeline .swiper-slide {
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center; /* Vertically center the card in the slide */
    justify-content: center;
}

.event-card {
    display: flex;
    flex-direction: column;
    height: 550px; /* Set a fixed, uniform height for all cards */
    width: 100%;
    max-width: 300px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.event-card img {
    width: 100%;
    height: 250px; /* A fixed height for the image area maintains card uniformity */
    object-fit: cover; /* Scales the image to cover the container, cropping if necessary */
}

.event-details {
    padding: 20px;
    color: #333;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows this container to fill the remaining space */
}

.event-details h3 {
    margin-top: 0;
    height: 80px;
}

.event-details p {
    margin: 0.5rem 0;
    color: #555;
}

.event-details .btn {
    padding: 0.6rem 1.5rem; /* Reduced padding for a smaller button */
    margin-top: auto; /* Pushes the button to the bottom */
    align-self: flex-start; /* Ensures button doesn't stretch full width */
}

@media (max-width: 480px) {
    .event-details .btn{
        font-size: 12px;
        padding: 0.3rem 1rem; 
    }
    .events-banner h1 {
        font-size: 2rem;
    }
}