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

/* CSS Variables for easy theme management */
:root {
    --primary-color: #3498db;      /* Accent blue */
    --secondary-color: #2c3e50;    /* Dark blue/grey */
    --accent-color: #ecf0f1;       /* Light text */
    --body-bg: #f0f2f5;           /* Off-white background */
    --text-color: #333;
    --font-family: 'Montserrat', sans-serif;
    --transition-speed: 0.3s;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--secondary-color), #34495e);
    color: var(--accent-color);
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
header .name {
    font-size: 3rem;  /* Increased from 2rem */
    text-transform: uppercase;
}
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}
nav ul li a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

/* Underline effect on hover */
nav ul li a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    left: 0;
    bottom: 0;
    transition: width var(--transition-speed) ease;
}
nav ul li a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}
nav ul li a:hover::after {
    width: 100%;
}

/* Main Content */
main {
    padding: 40px 0;
    animation: fadeIn 0.8s ease-out;
}

/* Fade-In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styles */
.section {
    padding: 40px 0;
    border-bottom: 1px solid #ddd;
    scroll-margin-top: 120px;  /* Added offset so headings aren’t hidden by the sticky header */
}
.section:last-of-type {
    border-bottom: none;
}
.section h2 {
    font-size: 2rem;  /* Increased from 1.8rem */
    color: var(--secondary-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}
.section h2::after {
    content: "";
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 3px;
}

/* Bio Section */
.bio-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    animation: fadeIn 1s ease-out;
}
.bio-text {
    flex: 1 1 300px;
}
.bio-image {
    flex: 0 1 200px;  /* Increased container size for the image */
}
.bio-image img {
    max-width: 300px; /* Shows the image in its entirety */
    width: 100%;
    height: auto;     /* Maintains the original aspect ratio */
    border: 2px solid var(--primary-color); /* Subtle border */
    transition: transform var(--transition-speed) ease;
    /* Removed border-radius to avoid cropping into a circle */
}
.bio-image img:hover {
    transform: scale(1.05);
}

/* Research Section */
.research ul {
    list-style: disc;
    padding-left: 20px;
}

/* Publications Section */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.pub-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed) ease;
    position: relative;
}

.pub-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 12px 0 0 12px;
}

.pub-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.pub-content {
    display: flex;
    display: -webkit-flex;
    gap: 20px;
    align-items: flex-start;
    -webkit-align-items: flex-start;
}

.pub-image {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
    background: white;
    padding: 4px;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.pub-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-object-fit: cover;
    border-radius: 4px;
    transition: transform var(--transition-speed) ease;
    -webkit-transition: transform var(--transition-speed) ease;
}

.pub-image:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    transform: translateY(-2px);
}

.pub-image:hover img {
    transform: scale(1.02);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 12px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.pub-image:hover .image-caption {
    opacity: 1;
}

.pub-text {
    flex: 1;
}

.pub-item h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-size: 1.4rem;
}

.pub-item h3 a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.pub-item h3 a:hover {
    color: var(--primary-color);
}

.pub-item p {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.pub-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.pub-item a:hover {
    text-decoration: underline;
}

/* Updates Section */
.updates ul {
    list-style: none;
}
.updates ul li {
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 3px solid var(--primary-color);
}

/* Education Section */
.education {
    background: white;
    padding: 40px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.education-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.education-item h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.education-item p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.education-item strong {
    color: var(--secondary-color);
}

/* Skills Section */
.skills {
    background: white;
    padding: 40px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.skill-category {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-top: 3px solid var(--primary-color);
    transition: transform var(--transition-speed) ease;
}

.skill-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.skill-category h3 {
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.skill-category p {
    color: #666;
    line-height: 1.6;
}

/* Personal Projects Section */
.personal-projects {
    background: white;
    padding: 40px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Contact Section */
.contact a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
.contact a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--secondary-color), #34495e);
    color: var(--accent-color);
    padding: 15px 0;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
    }
    .bio-container {
        flex-direction: column;
        align-items: center;
    }
    .bio-image {
        order: -1;
    }
    .pub-content {
        flex-direction: column;
        gap: 15px;
    }
    .pub-image {
        width: 100%;
        height: 200px;
        align-self: center;
    }
    .skills-grid {
        grid-template-columns: 1fr;
    }
}
