/* --- AIMS Lab Final Stylesheet --- */

/* 1. FONT IMPORTS */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Open+Sans:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oswald&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato&display=swap');

/* 2. GLOBAL STYLES & RESETS */
* { margin: 0; padding: 0; -webkit-box-sizing: border-box; box-sizing: border-box; }
html { font-size: 10px; }
body {
    font-family: 'Open Sans', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    font-size: 1.6rem;
    line-height: 1.7;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; color: #212529; }
h2 { font-size: 2.8rem; margin-bottom: 20px; }
p { line-height: 1.7; color: #555; margin-bottom: 10px; }
a { text-decoration: none; color: #007BFF; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 15px; }
.row { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -15px; }
.text-center { text-align: center; }

/* GRID SYSTEM */
.col-xs-12, .col-sm-6, .col-md-4, .col-md-8 { position: relative; width: 100%; padding-right: 15px; padding-left: 15px; }
@media (min-width: 768px) { .col-sm-6 { -webkit-box-flex: 0; -ms-flex: 0 0 50%; flex: 0 0 50%; max-width: 50%; } }
@media (min-width: 992px) {
    .col-md-4 { -webkit-box-flex: 0; -ms-flex: 0 0 33.333333%; flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-8 { -webkit-box-flex: 0; -ms-flex: 0 0 66.666667%; flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-offset-2 { margin-left: 16.666667%; }
}

/* 3. FULLSCREEN MENU STYLES */
.wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100%;
    width: 100%;
    /* --- UPDATED BACKGROUND IMAGE --- */
    background-image: url('./assets/images/NdFeB test sample_moded.jpg');
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a; /* Dark fallback color */
    transition: all 0.6s ease-in-out;
    z-index: 999;
}
/* Optional overlay for better text readability */
.wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 50% transparent black */
}
#active:checked ~ .wrapper { right: 0; }
.menu-btn { position: fixed; z-index: 1000; right: 25px; top: 25px; height: 50px; width: 50px; text-align: center; line-height: 50px; border-radius: 50%; cursor: pointer; background: #fff; -webkit-box-shadow: 0 2px 5px rgba(0,0,0,0.2); box-shadow: 0 2px 5px rgba(0,0,0,0.2); -webkit-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; }
.menu-btn span, .menu-btn:before, .menu-btn:after { content: ""; position: absolute; top: calc(50% - 1px); left: 30%; width: 40%; border-bottom: 2px solid #000; -webkit-transition: -webkit-transform .6s cubic-bezier(0.215, 0.61, 0.355, 1); -o-transition: transform .6s cubic-bezier(0.215, 0.61, 0.355, 1); transition: transform .6s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform .6s cubic-bezier(0.215, 0.61, 0.355, 1); }
.menu-btn:before { -webkit-transform: translateY(-8px); -ms-transform: translateY(-8px); transform: translateY(-8px); }
.menu-btn:after { -webkit-transform: translateY(8px); -ms-transform: translateY(8px); transform: translateY(8px); }
.close { position: fixed; width: 100%; height: 100%; pointer-events: none; -webkit-transition: background .6s; -o-transition: background .6s; transition: background .6s; z-index: 998; }
#active:checked + .menu-btn span { -webkit-transform: scaleX(0); -ms-transform: scaleX(0); transform: scaleX(0); }
#active:checked + .menu-btn:before { -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); border-color: #fff; }
#active:checked + .menu-btn:after { -webkit-transform: rotate(-45deg); -ms-transform: rotate(-45deg); transform: rotate(-45deg); border-color: #fff; }
.wrapper ul {
    position: relative; /* Changed for overlay */
    z-index: 1; /* Changed for overlay */
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
    list-style: none; text-align: center; width: 90%;
}
.wrapper ul li { margin: 15px 0; }
.wrapper ul li a { text-decoration: none; font-size: 3rem; font-weight: 500; padding: 5px 30px; color: #fff; border-radius: 50px; position: relative; line-height: 50px; opacity: 0; -webkit-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease; font-family: 'Roboto Mono', monospace; }
.wrapper ul li a:after { position: absolute; content: ""; background: #fff; width: 100%; height: 100%; left: 0; top: 0; border-radius: 50px; -webkit-transform: scaleY(0); -ms-transform: scaleY(0); transform: scaleY(0); z-index: -1; -webkit-transition: -webkit-transform 0.3s ease; -o-transition: transform 0.3s ease; transition: transform 0.3s ease, -webkit-transform 0.3s ease; }
.wrapper ul li a:hover:after { -webkit-transform: scaleY(1); -ms-transform: scaleY(1); transform: scaleY(1); }
.wrapper ul li a:hover { color: #000; }
input[type="checkbox"] { display: none; }
#active:checked ~ .wrapper ul li a { opacity: 1; -webkit-transform: none; -ms-transform: none; transform: none; -webkit-transition: opacity 0.4s ease, -webkit-transform 0.4s ease; -o-transition: opacity 0.4s ease, transform 0.4s ease; transition: opacity 0.4s ease, transform 0.4s ease, -webkit-transform 0.4s ease; -webkit-transition-delay: .6s; -o-transition-delay: .6s; transition-delay: .6s; }
.top-left-logo {
    position: absolute;
    top: 20px;
    left: 50%; /* Moves the logo's left edge to the screen's center */
    transform: translateX(-50%); /* Shifts the logo left by half its own width */
    z-index: 1001;
    display: block;
    transition: opacity 0.4s ease;
}
.top-left-logo img { height: 80px; width: auto; -webkit-transition: -webkit-transform 0.3s ease; -o-transition: transform 0.3s ease; transition: transform 0.3s ease, -webkit-transform 0.3s ease; }
.top-left-logo:hover img { -webkit-transform: scale(1.05); -ms-transform: scale(1.05); transform: scale(1.05); }
#active:checked ~ .top-left-logo { opacity: 0; pointer-events: none; }
.top-left-logo.has-background { background-color: white; padding: 5px; border-radius: 8px; -webkit-box-shadow: 0 2px 5px rgba(0,0,0,0.1); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }


/* 4. HOMEPAGE & SHARED COMPONENT STYLES */
/* ... (Homepage and other component styles remain the same) ... */
.section-container { padding: 60px 0; }
.hero-full-container {
    position: relative; /* Added for the overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 15px;
    color: white;
    /* --- UPDATED BACKGROUND --- */
    background-image: url('./assets/images/NdFeB_moded.jpg');
    background-size: cover;
    background-position: center;
    background-color: #333; /* Dark fallback color */
}

/* Adds a semi-transparent dark layer for text readability */
.hero-full-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 40% transparent black */
}

/* Ensures the text and animation appear on top of the overlay */
.hero-content {
    position: relative; /* Changed from 'static' */
    z-index: 1; /* Added */
    text-align: center;
}
.h1-hero-full { font-size: 5rem; font-weight: 900; margin-bottom: 20px; color: white; }
.lead-hero-full { font-size: 1.5rem; color: white; font-family: 'Roboto Mono', monospace; }
.newton-cradle-container { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; gap: 30px; margin: 40px 0; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.newton-cradle { position: relative; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: end; -ms-flex-align: end; align-items: flex-end; width: 220px; height: 150px; background-color: #f8c6cf; padding-bottom: 10px; border-radius: 8px; border-top: 15px solid #eee7d5; }
.ball { position: relative; width: 30px; height: 30px; border-radius: 50%; background-color: #455681; margin: 0; color: white; font-weight: bold; font-size: 14px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-transform-origin: 50% -95px; -ms-transform-origin: 50% -95px; transform-origin: 50% -95px; }
.ball::before { content: ''; position: absolute; width: 2px; height: 95px; background-color: white; left: 14px; top: -95px; }
.ball.first { -webkit-animation: first-ball-swing 0.9s alternate ease-in infinite; animation: first-ball-swing 0.9s alternate ease-in infinite; }
.ball.last { -webkit-animation: last-ball-swing 0.9s alternate ease-out infinite; animation: last-ball-swing 0.9s alternate ease-out infinite; }
@-webkit-keyframes first-ball-swing { 0% { -webkit-transform: rotate(40deg); transform: rotate(40deg); } 50%, 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } }
@keyframes first-ball-swing { 0% { -webkit-transform: rotate(40deg); transform: rotate(40deg); } 50%, 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } }
@-webkit-keyframes last-ball-swing { 0%, 50% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(-40deg); transform: rotate(-40deg); } }
@keyframes last-ball-swing { 0%, 50% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(-40deg); transform: rotate(-40deg); } }
.mission-box { background-color: #fff; border: 1px solid #e9ecef; border-radius: 8px; padding: 40px; -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); margin-top: 0; position: relative; z-index: 10; }
.cta-button { display: inline-block; padding: 12px 28px; background-color: #007BFF; color: white; border-radius: 5px; font-weight: bold; margin-top: 20px; -webkit-transition: background-color 0.3s ease, -webkit-transform 0.3s ease; -o-transition: background-color 0.3s ease, transform 0.3s ease; transition: background-color 0.3s ease, transform 0.3s ease, -webkit-transform 0.3s ease; }
.cta-button:hover { background-color: #0056b3; color: white; -webkit-transform: translateY(-2px); -ms-transform: translateY(-2px); transform: translateY(-2px); }
.footer-container { background-color: #e9ecef; padding: 40px 0; color: #6c757d; text-align: center; }

/* 5. CARD STYLES (FOR ALL PAGES) */
/* ... (Card styles are unchanged and correct) ... */
.page-header-spacer { padding-top: 60px; }
.page-title { font-size: 3.2rem; margin-bottom: 40px; color: #333 !important; }
.team-section, .research-section, .capabilities-section, .news-section { margin-bottom: 60px; }
.section-heading { font-size: 2.4rem; margin-bottom: 30px; text-align: center; border-bottom: 2px solid #eee; padding-bottom: 15px; }
.team-grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); }
.research-grid, .capabilities-grid, .news-grid {
    display: grid;
    gap: 30px; /* This creates the space BETWEEN each card. Adjust as needed. */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
.pi-grid { max-width: 600px; margin: 0 auto; }
.work-item, .team-card, .research-card, .capabilities-card, .news-card, .content-card {
    background-color: #fff; border: 1px solid #e9ecef; border-radius: 8px; height: 100%;
    -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    -webkit-transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease; -o-transition: transform 0.3s ease, box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease, -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
}
.work-item:hover, .team-card:hover, .research-card:hover, .capabilities-card:hover, .news-card:hover, .content-card:hover {
    -webkit-transform: translateY(-5px); -ms-transform: translateY(-5px); transform: translateY(-5px);
    -webkit-box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.work-item { overflow: hidden; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; margin-bottom: 30px; }
.work-item-image { width: 100%; height: 220px; }
.work-item-image img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.image-caption { font-size: 1.8rem; color: #555; text-align: center; padding: 20px; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; }
.team-card { padding: 25px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; gap: 25px; text-align: left; }
.research-card, .capabilities-card, .content-card, .news-card { overflow: hidden; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; }
.research-card { max-width: 500px; width: 100%; margin: 0 auto; }
.team-card .team-image { width: 150px; height: 150px; -o-object-fit: cover; object-fit: cover; border-radius: 50%; -ms-flex-negative: 0; flex-shrink: 0; }
.card-image-container {
    width: 100%;
    height: 250px;
    margin-bottom: 15px; /* This creates space INSIDE the card, below the image */
}
.card-image, .news-card-image { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.news-card-image { border-top-left-radius: 8px; border-top-right-radius: 8px; height: 220px; }
.team-card .card-content { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; }
.card-content, .news-card-content { padding: 25px; text-align: center; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; }
.card-title, .news-card-title { font-size: 2rem; color: #333; margin-bottom: 10px; }
.card-description, .news-card-summary, .card-authors { font-size: 1.5rem; color: #666; }
.news-card-summary { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; }
.team-card h3 { margin-top: 0; margin-bottom: 5px; font-size: 2.2rem; }
.team-card .team-member-title { font-style: italic; color: #6c757d; margin-bottom: 15px; }
.social-link, .card-link, .news-card-link { display: inline-block; margin-top: 10px; font-weight: bold; }
.card-link { margin-top: 20px; text-align: right; }
.card-meta, .news-card-date { font-size: 1.4rem; color: #888; margin-bottom: 15px; }
.team-group-image { border-radius: 8px; -webkit-box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); margin-top: 40px; }
.image-container { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; width: 100%; }

/* LIGHTBOX GALLERY STYLES */
/* ... (Lightbox styles are unchanged and correct) ... */
.thumbnail-gallery { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; gap: 10px; padding: 0 20px 20px 20px; }
.thumbnail-gallery img { width: 100px; height: 75px; -o-object-fit: cover; object-fit: cover; cursor: pointer; border: 2px solid #eee; border-radius: 4px; -webkit-transition: -webkit-transform 0.2s ease, border-color 0.2s ease; -o-transition: transform 0.2s ease, border-color 0.2s ease; transition: transform 0.2s ease, border-color 0.2s ease, -webkit-transform 0.2s ease; }
.thumbnail-gallery img:hover { -webkit-transform: scale(1.05); -ms-transform: scale(1.05); transform: scale(1.05); border-color: #007BFF; }
.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; z-index: 1100; opacity: 0; pointer-events: none; -webkit-transition: opacity 0.3s ease; -o-transition: opacity 0.3s ease; transition: opacity 0.3s ease; }
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; }
.lightbox-content img { max-width: 100%; max-height: 80vh; -o-object-fit: contain; object-fit: contain; border-radius: 4px; }
.lightbox-caption { color: white; margin-top: 15px; text-align: center; font-size: 1.6rem; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; background-color: rgba(0, 0, 0, 0.3); color: white; border: none; padding: 0; width: 40px; height: 40px; line-height: 40px; text-align: center; cursor: pointer; font-size: 24px; border-radius: 50%; -webkit-transition: background-color 0.2s ease; -o-transition: background-color 0.2s ease; transition: background-color 0.2s ease; }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background-color: rgba(0, 0, 0, 0.6); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); }

/* 6. RESPONSIVE MEDIA QUERIES */
@media (max-width: 767px) {
    .team-grid, .research-grid, .capabilities-grid, .news-grid { grid-template-columns: 1fr; }
    .team-card { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: center; -ms-flex-align: center; align-items: center; text-align: center; }
    .wrapper ul li a { font-size: 2.4rem; }
}