/* Body styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #e6f7ff;
    color: #333;
}

/* Header and Top Navigation Bar */
header {
    background-color: #005f99;
    color: #fff;
    padding: 20px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between; /* Ensure equal spacing on the navigation */
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}

.container {
    width: 100%; /* Full width for better flexibility */
    max-width: 1200px;
    margin: 0 auto;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-start;
    flex-grow: 1;
    flex-wrap: wrap; /* Ensure the menu can wrap */
}

nav ul li {
    margin-left: 30px; /* Adjust space between items */
}

nav ul li:first-child {
    font-size: 24px;
    color: #fff;
    font-weight: bold;
    margin-left: 0; /* No negative margins */
}

nav ul li a {
    color: white !important;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    white-space: nowrap; /* Prevent text wrapping */
}

nav ul li a:hover {
    text-decoration: underline;
}

/* Sidebar Styling */
.sidebar {
    width: 25%;
    background-color: #cce6ff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: fixed;
    top: 81px; /* Adjust this value based on header height */
    bottom: 0;
    overflow-y: auto;
    z-index: 500; /* Ensure sidebar stays behind the header */
}

.sidebar img.profile-img {
    width: 100%;
    border-radius: 50%;
    max-width: 150px;
    display: block;
    margin: 0 auto;
}

.sidebar h2 {
    text-align: center;
    font-size: 1.5em;
}

.sidebar .position,
.sidebar .company {
    text-align: center;
    color: #555;
}

.sidebar .company a {
    color: #005f99;
    text-decoration: none;
}

.sidebar h3 {
    border-bottom: 1px solid #bbb;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin: 10px 0;
}

/* Main content styling */
main {
    margin-left: 25%; /* Ensures the main content is aligned correctly with the sidebar */
    padding: 70px 20px 20px 20px; /* Adjusted padding to avoid overlap and align with the sections */
    box-sizing: border-box;
    background-color: #f0f4fc;
}

.bio-section {
    padding: 20px;
    margin-bottom: 20px;
}

.bio-container {
    background: linear-gradient(135deg, #cce6ff 0%, #cce6ff 100%);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bio-section .description {
    margin: 10px 0;
    line-height: 1.5;
}

/* Contact Icons */
.contact {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 20px;
}

.contact a {
    margin-right: 10px;
    font-size: 24px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.contact a:hover {
    color: #005f99;
}


/* Projects and Research Section */
.projects-grid, .research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 0 20px; /* Aligns the grid items within the section */
}

/* Other relevant styles already in place */

.project-card, .research-card {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto; /* Change from fixed height to auto */
    min-height: 350px; /* Ensure a minimum height */
    overflow-y: auto; /* Add scrolling if content overflows */
}

.project-card:hover, .research-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.project-img {
    width: 100%;
    height: auto;
    max-height: 200px; /* Set a maximum height */
    object-fit: cover; /* Ensure the image scales and crops to fit within the box */
    border-radius: 8px;
    margin-bottom: 10px;
}


.project-content h3, .research-card h3 {
    color: #005f99;
    margin-bottom: 10px;
    font-size: 18px;
}

.project-content p, .research-card p {
    color: #555;
    font-size: 14px;
    margin-bottom: 15px;
}

.project-link, .research-card a {
    color: #ff9900;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.project-link:hover, .research-card a:hover {
    text-decoration: underline;
}

.projects-section h2, .research-section h2 {
    margin-left: 20px; /* Aligns the headings with the grid items */
}

.research-section {
    padding: 20px;
}

.projects-section, .research-section {
    padding: 0 20px; /* Ensures consistent padding on both sections */
    margin-bottom: 40px; /* Adds some space between the sections */
}

.research {
    margin-bottom: 20px;
}

.research h3 {
    margin: 0;
    font-size: 24px;
    color: #005f99;
}

.research p {
    margin: 10px 0;
    font-size: 16px;
    color: #555;
}

/* Footer */
footer {
    background-color: #005f99;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    clear: both;
    margin-top: 20px;
}

/* Links */
a {
    color: #005F99 !important;
}

/* Responsive Sidebar and Header */
@media (max-width: 768px) {
    header {
        padding: 10px 20px;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
    }

    nav ul li {
        margin: 10px 0; /* Make spacing consistent in mobile */
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }

    main {
        margin-left: 0;
        padding: 20px;
    }

    .project-card,
    .research-card {
        min-height: auto; /* Remove the min-height on mobile */
    }
}
