/* Base Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --section-title-color: #487ab8;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --text-light: #7f8c8d;
    --max-width: 1200px;
    --border-radius: 4px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

main {
    padding-top: 0;
    margin-top: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

/* Section Titles */
.section-title {
    color: var(--section-title-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--dark-color);
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: var(--transition);
}

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

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

.bg-light {
    background-color: var(--light-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 0;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../images/nav-bar-background.jpg") center/cover no-repeat;
    background-size: cover;
    background-attachment: scroll;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px; /* Reduced height for slimmer bar */
}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0.5rem 0;
    background: transparent;
}

.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0.5rem 0;
}

.logo {
    height: 100%;
    min-height: 60px;  /* Minimum height to ensure visibility */
    max-height: 80px;  /* Maximum height to prevent it from getting too large */
    width: auto;
    object-fit: contain;
    transition: var(--transition);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.logo.uni-logo {
    max-height: 50px;  /* Slightly smaller than the lab logo */
    height: 50px;     /* Fixed height for consistency */
    margin-right: 1rem;
    padding: 0.3rem 0;
    transform-origin: left center;
}

.lab-logo {
    max-height: 65px; /* Slightly taller than uni logo */
    height: 65px;     /* Fixed height for consistency */
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 1.5rem;
    margin-left: 1rem;
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Add hover effects for better interactivity */
.logo:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: #ffffff; /* White text for better contrast */
    font-weight: 500;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #ffffff; /* White underline on hover */
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #ffffff; /* White color for hamburger menu */
    margin: 2px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../images/header-background.jpg") center/cover no-repeat;
    color: white;
    padding: 120px 20px 80px; /* Reduced top padding */
    margin-top: 65px; /* Matches navbar height */
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero .subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    opacity: 0.9;
}

/* Buttons */
.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
}

/* Research Section */
.section-intro {
    font-size: 1.1em;
    color: #555;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.7;
    text-align: center;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.research-card {
    background: white;
    border-radius: 10px;
    padding: 35px 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(30, 136, 229, 0.2);
}

.research-icon {
    width: 70px;
    height: 70px;
    background: rgba(30, 136, 229, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.research-card i {
    font-size: 30px;
    color: #1e88e5;
}

.research-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
    line-height: 1.4;
}

.research-card p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 25px;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: #1e88e5;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.read-more i {
    margin-left: 8px;
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

.read-more:hover {
    color: #0d47a1;
}

.read-more:hover i {
    transform: translateX(4px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .research-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .research-card {
        padding: 25px 20px;
    }
    
    .research-card h3 {
        font-size: 1.3em;
    }
}

/* Team Section */
.team-section {
    margin-bottom: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.team-section:first-child {
    padding-top: 0;
    border-top: none;
}

.team-section:last-child {
    margin-bottom: 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.team-member {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.member-image {
    width: 100%;
    height: 0;
    padding-bottom: 125%; /* Creates a square aspect ratio (can be adjusted) */
    position: relative;
    overflow: hidden;
}

.member-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures entire image is visible */
    object-position: center;
    transition: transform 0.5s ease;
    background: #f5f5f5; /* Fallback background color */
}

/* Adjust for larger screens */
@media (min-width: 769px) {
    .member-image {
        padding-bottom: 100%; /* Square aspect ratio for desktop */
    }
}

/* Adjust for very small screens */
@media (max-width: 480px) {
    .member-image {
        padding-bottom: 133%; /* Slightly taller aspect ratio for mobile */
    }
}

.team-member:hover .member-image img {
    transform: scale(1.05);
}

.member-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.member-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.member-info .position {
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.member-info .department {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
}

.member-info .role {
    margin-top: auto;
    padding-top: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    border-top: 1px solid #eee;
}

/* Education Section */
.education-section {
    margin: 2rem 0;
}

.education-section h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.timeline {
    position: relative;
    padding-left: 2rem;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--secondary-color);
}

.timeline li {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.timeline h4 {
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.timeline .institution {
    font-weight: 600;
    color: var(--primary-color);
    margin: 0.25rem 0;
}

.timeline .date {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin: 0.25rem 0;
}

.timeline .focus {
    font-size: 0.95rem;
    color: var(--text-color);
    margin: 0.25rem 0 0 0;
    padding-left: 1rem;
    border-left: 2px solid #eee;
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .member-image {
        height: 260px;
    }
}

@media (max-width: 480px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

.research-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* Team Section */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-section p, .footer-section a {
    color: #bdc3c7;
    margin-bottom: 0.5rem;
    display: block;
}

.footer-section a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

/* Footer links container */
.footer-links-container {
    display: flex;
    gap: 2rem;
}

/* Footer links columns */
.footer-links-column {
    margin: 0;
    padding: 0 0 0 1.5rem;
    list-style: disc;
}

.footer-links-column li {
    margin-bottom: 0.5rem;
}

.footer-links-column a {
    color: #bdc3c7;
    transition: var(--transition);
    text-decoration: none;
}

.footer-links-column a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.email-link {
    color: #3498db !important;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    margin-top: 0.5rem;
}

.email-link:hover {
    color: #2980b9 !important;
    transform: translateX(5px);
}

.social-icon {
    color: #bdc3c7;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin-top: 0.8rem;
    transition: all 0.3s ease;
}

.social-icon i {
    margin-right: 8px;
    font-size: 1.2em;
}

.social-icon:hover {
    color: #0e76a8;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        height: 65px;
        padding: 0.5rem 1rem;
        position: relative;
        z-index: 1002;
    }
    
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
        padding: 0.25rem 0; /* Reduced padding for mobile */
    }
    
    .logo {
        height: auto;
        min-height: 50px;
        max-height: 60px;
        width: auto;
    }
    
    .uni-logo {
        max-height: 45px;
        margin-right: 0.75rem;
    }
    
    .lab-logo {
        max-height: 45px;
        padding-left: 0.75rem;
        margin-left: 0.5rem;
        border-left: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 65px !important; /* Match navbar height */
        left: -100%;
        width: 100%;
        height: calc(100vh - 65px) !important;
        background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.70)), url("../images/nav-bar-background-menu.png") no-repeat center;
        background-attachment: scroll;
        background-size: 100% 100%;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        transition: all 0.4s ease-in-out;
        padding: 2rem 0;
        z-index: 1000 !important;
        overflow-y: auto;
        margin: 0 !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 1rem 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        color: #ffffff;
        font-size: 1.2rem;
        padding: 0.75rem 1.5rem;
        display: block;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    }
    
    .nav-links a:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.2rem;
    }

    .research-grid, .team-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Publications Page Styles */
.publications-page {
    margin-bottom: 20px;
}

/* Research Page Hero Section */
.research-hero {
    position: relative;
    background: url("../images/research-header-background.jpg") center/cover no-repeat;
    color: white;
    padding: 100px 20px;
    text-align: center;
    overflow: hidden;
    margin-top: 65px; /* Matches navbar height */
}

.research-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.research-hero .container {
    position: relative;
    z-index: 2;
}

.research-hero h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

.research-hero .subtitle {
    font-size: 1.4em;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .research-hero {
        padding: 80px 20px;
    }
    
    .research-hero h1 {
        font-size: 2.5em;
    }
    
    .research-hero .subtitle {
        font-size: 1.1em;
    }
}

.projects-section {
    padding: 50px 10%;
}

.projects-section h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px;
    display: inline-block;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.collaboration-badge {
    background-color: #3498db;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    display: inline-block;
    margin: 0.5rem 0 1.5rem 0;
    white-space: nowrap;
}

.collaboration-info {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary-color);
}

.collaboration-info a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.collaboration-info a i {
    font-size: 0.8em;
    opacity: 0.8;
}

.collaboration-info a:hover i {
    opacity: 1;
}

.collaboration-info a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.project-entry {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-entry h3 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #0056b3;
}

.project-content {
    display: block; /* stack vertically: text then images */
}

.project-text {
    margin-bottom: 25px;
}

.project-images {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.project-images figure {
    margin: 0;
    text-align: center;
}

.project-images img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.project-images figcaption {
    margin-top: 8px;
    font-style: italic;
    font-size: 0.9em;
    color: #666;
}

@media (max-width: 576px) {
    .project-images {
        grid-template-columns: 1fr;
    }
}

/* Thesis Page Styles */
.thesis-page .hero {
    text-align: center;
}

/* Home page Research section heading */
#research h2 {
    text-align: center;
}
