/* Base styles */
:root {
    --primary-color: #141414;
    --secondary-color: #f8f9fa;
    --text-color: #242628;
    --light-gray: #eee;
    --white: #fff;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Rubik';
    --container-width: 66.67%; /* Reduced by a third */
}

html {
    position: relative;
    min-height: 100vh;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6;
    scroll-behavior: smooth;
    padding-top: 100px; /* Reduced for horizontal navbar */
    background: linear-gradient(to right, 
        #96AEC9 0%,     /* Left edge - muted blue-grey */
        #9EB5D4 20%,    /* Left-center - soft blue */
        #ADC6E4 40%,    /* Center-left - light blue */
        #ACC0D9 60%,    /* Center-right - pale blue */
        #C6DFF5 80%,    /* Right-center - very light blue */
        #C8E1F7 100%    /* Right edge - almost white-blue */
    );
    min-height: 100vh;
    position: relative;
}

/* Top background - scrolls with content */
.background-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150vh;
    background-image: url('../img/background-top.jpg');
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: -2;
}

.background-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150vh;
    background-image: url('../img/background-bottom.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    color: #141414;
    font-family: var(--font-secondary);
    margin-bottom: 1rem;
}

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

a:hover {
    color: #242628;
    text-decoration: underline;
}

section {
    padding: 5rem 0;
    position: relative;
}

/* Add semi-transparent background to sections for better readability */
section .container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Portrait */
.portrait-container {
    position: relative;
    width: 80px;
    height: 80px;
    overflow: hidden;
    /* Circle removed as requested */
    flex-shrink: 0;
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links-container {
    display: flex;
    justify-content: flex-end;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    margin: 0 1.5rem;
    transition: color 0.3s;
    font-size: 0.85rem; /* Four sizes smaller */
    display: block;
    padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
    color: #242628 !important;
    text-decoration: none;
}

/* Sections */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

#about .section-title {
    color: #141414;
}

#research .section-title,
#publications .section-title,
#teaching .section-title,
#cv .section-title {
    color: #141414;
}

/* Section title styling without underlines */

/* About Section */
#about {
    padding-top: 3rem; /* Added more top padding */
}

.about-content {
    margin-top: 1.5rem;
}

#about .section-title {
    margin-top: 1.5rem;
}

.about-portrait {
    width: 180px;
    height: auto;
    border-radius: 5px;
    /* Shadow removed as requested */
}

/* Research Section */
#research {
    color: #242628;
}

.research-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.research-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.research-list h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    color: #141414;
}

.research-list ul {
    margin-bottom: 2rem;
}

/* Publications Section */
#publications {
    color: #242628;
}

.publications-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.publications-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Button styling for colored sections */
#research .btn-light, 
#publications .btn-light, 
#teaching .btn-light,
#cv .btn-light,
#research .btn-outline-light, 
#publications .btn-outline-light, 
#teaching .btn-outline-light,
#cv .btn-outline-light {
    color: #242628;
    border-color: #242628;
    background-color: transparent;
}

#research .btn-light:hover, 
#publications .btn-light:hover, 
#teaching .btn-light:hover,
#cv .btn-light:hover,
#research .btn-outline-light:hover, 
#publications .btn-outline-light:hover, 
#teaching .btn-outline-light:hover,
#cv .btn-outline-light:hover {
    color: #242628;
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #242628;
}

.publication-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
}

.publication-item:last-child {
    border-bottom: none;
}

.publication-item h4 {
    color: #141414;
}

.publication-year {
    font-weight: bold;
    color: #242628;
}

/* Teaching Section */
#teaching {
    color: #242628;
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

/* CV Section */
#cv {
    color: #242628;
}

.cv-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cv-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Button styling for CV download */
.btn-cv {
    color: #242628;
    background-color: rgba(255, 255, 255, 0.5);
    border-color: #242628;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.btn-cv:hover {
    background-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.teaching-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teaching-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-list h5 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.course-code {
    font-weight: bold;
    color: #242628;
    padding-bottom: 0.5rem;
}

.course-list h4 {
    color: #141414;
}

.course-list .mb-4 {
    margin-bottom: 2rem !important;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    color: #242628;
    padding: 2rem 0;
    text-align: center;
    border-top: none !important; /* Removed border */
    border-radius: 15px 15px 0 0;
    margin-top: 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer-links a {
    color: #555;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #007bff;
}

/* Substack icon styling */
.substack-icon {
    background-color: #FF6719;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.substack-icon i {
    color: white;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 120px;
        background-attachment: scroll; /* Better performance on mobile */
    }
    
    /* Adjust section container padding on mobile */
    section .container {
        padding: 1.5rem;
        margin: 1rem auto;
        border-radius: 10px;
    }
    
    .portrait-container {
        width: 90px;
        height: 90px;
        margin: 0 auto 0.5rem auto;
        /* Circle removed as requested */
    }
    
    .about-portrait {
        width: 140px;
        float: none;
        display: block;
        margin: 0 auto 1.5rem auto;
    }
    
    section {
        padding: 3rem 0;
    }
    
    /* Add more gap above About Me section on mobile */
    #about {
        padding-top: 5rem;
    }
    
    /* Make text start below the picture on mobile */
    .about-content p {
        clear: both;
    }
    
    .research-icon-container,
    .publications-icon-container,
    .teaching-icon-container,
    .cv-icon-container {
        width: 50px;
        height: 50px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .nav-link {
        margin: 0 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Stack navbar content vertically on very small screens */
    .navbar .container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-links-container {
        margin-top: 0.5rem;
        justify-content: center;
    }
    

}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 200px; /* Increased offset to align with section color edge */
}

/* Container width adjustment */
.container {
    max-width: var(--container-width);
}

/* Highlighter underline style */
.highlight-underline {
    background: linear-gradient(180deg, transparent 60%, #FFC90E 40%);
    display: inline;
    padding: 0 2px;
}

/* Recent News section */
.news-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 10px;
}

.news-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
}

.news-list li:last-child {
    border-bottom: none;
}

.news-list li strong {
    display: block;
    margin-bottom: 4px;
    color: #141414;
}

/* Lighter link color for NSEE data link */
.lighter-link {
    color: #6c757d; /* A lighter gray color */
}

.lighter-link:hover {
    color: #5a6268; /* Slightly darker on hover */
}

/* Ensure no borders between sections and footer */
section:last-of-type {
    border-bottom: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}
