:root {
    --bg-color: #121212;              /* Deep black/charcoal background */
    --lighter-bg-color: #1a1a1a;      /* Slightly lighter bg for cards */
    --text-color: #F5F5F5;            /* Soft white primary text */
    --border-color: #2E2E2E;          /* Subtle border/divider color */
    --figcaption-color: #aaaaaa;      /* Lighter grey for figcaptions */

    /* Default Theme: Green */
    /* --accent-color: #00C853;
    --hover-color: #1DE9B6; */
    --accent-color: #E53935;
    --hover-color: #B71C1C;
    --profile-image-width: 400px;  /* Can easily adjust this value */
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.navbar {
    background-color: var(--bg-color);
    padding: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo-link:hover {
    color: var(--hover-color);
}

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

.nav-links li a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    font-weight: bold;
}

.nav-links li a:hover {
    color: var(--hover-color);
    border-radius: 16px;
}

.nav-links li a.active {
    color: var(--hover-color);
    border-radius: 16px;
    padding: 0.5rem 1rem;
}

main {
    margin-top: 80px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
}

section {
    min-height: 120vh;    /* Increased from 100vh to 120vh */
    padding: 4rem 0;
    position: relative;  /* For positioning the hr */
}

section:not(:last-child)::after {
    content: '';
    display: block;
    height: 1px;
    background: var(--border-color);
    width: 100%;
    margin: 4rem 0 0 0;
}

h1, h2 {
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-size: 2.2em;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--lighter-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    padding-bottom: 5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}


.project-card h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.5em;
}

.project-description {
    margin-bottom: 1.5rem;
}

.project-description p {
    margin: 0;
    line-height: 1.6;
    text-align: justify;  /* This will make all lines have equal length */
}

.project-description a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.project-description a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.project-features {
    margin: 1.5rem 0;
}

.project-features h4 {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-size: 1.1em;
}

.project-features ul {
    list-style: none;
    padding-left: 1rem;
}

.project-features li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.project-features li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.project-links {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
}

.project-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-links a:hover {
    color: var(--hover-color);
    border-color: var(--hover-color);
    transform: translateY(-2px);
}

.icon {
    font-size: 1.2em;
}

#home { 
    padding-top: 100px;
    margin-top: 50px;
}

#about {
    padding-top: 100px;
    margin-top: 50px;
} 

#software-projects {
    padding-top: 100px;
    margin-top: 50px;
}

#contact {
    padding-top: 100px;
    margin-top: 50px;
}

.home-content {
    display: flex;
    align-items: center;
    gap: min(40px, 5%);    /* Keep original gap */
    max-width: 800px;      /* Add max-width to limit overall width */
    margin: 0 auto;        /* Center the container */
}

.home-text {
    flex: 1;            /* Takes up available space */
}

.home-image-container {
    flex-shrink: 0;     /* Prevents image from shrinking */
}

.home-image {
    max-width: var(--profile-image-width);
    height: auto;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .home-content {
        flex-direction: column;
    }

    .nav-container {
        padding: 0 1rem;  /* Reduce padding on mobile */
    }

    main {
        padding: 1rem;  /* Reduce padding on mobile */
    }

    .research-content {
        flex-direction: column;
    }

    .research-image-container {
        max-width: 100%;
    }

    .publications-list {
        columns: 1;
    }

    .nav-links {
        display: none;  /* Hide nav links on mobile - will need a hamburger menu */
    }

    .project-card {
        margin: 1rem 0;
    }
}

.research-topic {
    margin: 0 auto 60px;
    padding: 30px;
    background-color: var(--lighter-bg-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.research-topic h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.research-content {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 1rem;  /* Add some space after the title */
}

.research-text {
    flex: 1;
}

.research-image-container {
    flex: 0 0 auto;
    max-width: 50%;
}

.research-image {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

/* Remove the individual topic separators */
.research-topic::after {
    display: none;
}

/* Make section separators more prominent */
section:not(:last-child)::after {
    content: '';
    display: block;
    height: 1px;
    background: var(--border-color);
    width: 100%;
    margin: 4rem 0 0 0;
}

.research-topic p {
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: justify;    /* Makes all lines have equal length by adjusting word spacing */
}

.research-list {
    list-style: none;
    padding: 0;
}

.research-list li {
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 2px solid var(--accent-color);
}

.research-list strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 1.1em;
}

.research-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.research-list a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

/* If you want to try different shades of red, here are some options:
    #ff4444 (brighter red)
    #ff3333 (vibrant red)
    #cc0000 (darker red)
    #ff8080 (softer red)
*/
/* Commenting out old color suggestions */

/* Update the media query to handle minimum width */
@media (max-width: 840px) {
    main, .nav-container {
        min-width: 100%;
        margin-left: 20px;
        margin-right: 20px;
    }
}

.research-item {
    margin: 2rem 0;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f8f8;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

figure {
    margin: 0;
}

figcaption {
    text-align: justify;  /* This will make all lines have equal length */
    font-style: italic;
    color: var(--figcaption-color);
    margin-top: 10px;
    font-size: 0.9em;
}

figcaption a {
    color: var(--text-color);          /* Same white color as other links */
    text-decoration: underline;
    transition: color 0.3s ease;
}

figcaption a:hover {
    color: var(--hover-color);         /* Same hover color as other links */
    text-decoration: underline;
}

.research-text h4 {
    color: var(--accent-color);
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.publications-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.publications-section h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.2em;
}

.publications-list {
    list-style: none;
    padding: 0;
    columns: 2;  /* Creates two columns */
    column-gap: 40px;
}

.publications-list li {
    margin-bottom: 15px;
    break-inside: avoid; /* Prevents items from breaking across columns */
    padding-left: 20px;
    border-left: 2px solid var(--accent-color);
}

.publications-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.publications-list a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .publications-list {
        columns: 1; /* Switch to single column on mobile */
    }
}

.intro-text {
    margin-bottom: 40px;
    text-align: justify;    /* Makes all lines have equal length */
    line-height: 1.6;       /* Consistent with other paragraph styling */
}

.project-logo {
    text-align: center;
    margin: 1.5rem 0;
    width: 100%;      /* Take full width of container */
    height: 150px;    /* Fixed height for consistency */
    display: flex;    /* Use flexbox for centering */
    align-items: center;
    justify-content: center;
}

.project-logo img {
    max-width: 100%;  /* Maximum width of container */
    max-height: 100%; /* Maximum height of container */
    object-fit: contain; /* Maintain aspect ratio while fitting in box */
    border-radius: 8px;
}

.project-content {
    flex: 1;  /* Takes up available space */
}

/* Update the media query to handle minimum width */
@media (max-width: 840px) {
    main, .nav-container {
        min-width: 100%;
        margin-left: 20px;
        margin-right: 20px;
    }
}

/* Responsive design for smaller screens */
@media (max-width: 1240px) {  /* Slightly larger than content width to account for padding */
    body {
        overflow-x: hidden;  /* Prevent horizontal scrolling */
    }
    
    .navbar, main, .nav-container {
        min-width: unset;    /* Remove minimum width constraint */
        width: 100%;         /* Take full width of viewport */
        padding: 1rem;       /* Reduce padding on smaller screens */
    }
    
    .projects-container {
        grid-template-columns: 1fr;  /* Stack projects vertically */
    }
    
    .research-content {
        flex-direction: column;  /* Stack research content vertically */
    }
    
    .research-image-container {
        max-width: 100%;     /* Allow images to take full width */
    }
    
    .publications-list {
        columns: 1;           /* Switch to single column on mobile */
    }
}

/* Add styles for very small screens */
@media (max-width: 480px) {
    .home-image {
        max-width: 100%;  /* Make profile image responsive */
    }

    h1 {
        font-size: 1.8em;  /* Reduce heading size on mobile */
    }

    h2 {
        font-size: 1.6em;
    }

    h3 {
        font-size: 1.4em;
    }

    .research-topic {
        padding: 15px;  /* Reduce padding on mobile */
    }
}

/* Add hamburger menu styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--text-color);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Mobile navigation styles */
@media (max-width: 1024px) {  /* Changed from 768px to 1024px */
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: var(--bg-color);
        padding: 80px 0;
        transition: right 0.3s ease-in-out;
        align-items: center;
    }

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

    .nav-links li {
        margin: 15px 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg);
    }
}

/* Add this new rule for consistent link styling */
.research-text a, .project-description a {
    color: var(--text-color);          /* Same white color as other links */
    text-decoration: underline;
    transition: color 0.3s ease;
}

.research-text a:hover, .project-description a:hover {
    color: var(--hover-color);         /* Same hover color as other links */
    text-decoration: underline;
}