/* Basic Reset and Global Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

/* Header and Navigation */
header {
    background: transparent;
    padding: 2rem 0 1rem 0;
    text-align: center;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

header nav ul li {
    margin: 0 25px;
}

header nav ul li a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1em;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

header nav ul li a:hover {
    border-bottom: 2px solid #0056b3;
}

header nav ul li a.active {
    border-bottom: 2px solid #0056b3;
}

/* Main Content Area */
main {
    max-width: 1000px;
    margin: 20px auto;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px 2rem;  /* 20px top/bottom, 2rem left/right */
}

/* Code Blocks */
pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #495057;
}

/* Home Page Layout */
.home-container {
    max-width: 950px;
    margin: 0 auto;
    padding: 20px;
}

.top-section {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
    gap: 60px;
    position: relative;
}

.profile-section {
    flex-shrink: 0;
    margin-left: 35px; /* Aligns 280px photo with center of 350px contact box (including padding) */
}

.profile-photo-home {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 4px solid #f7b731;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.name-affiliation {
    flex: 1;
    padding-top: 10px;
    margin-left: 30px; /* Aligns with the left edge of biography section below */
}

.name-affiliation h1 {
    font-size: 2.5em;
    color: #0056b3;
    margin-bottom: 20px;
    font-weight: bold;
}

.affiliations {
    line-height: 1.6;
}

.affiliation {
    font-size: 1.3em;
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
}

.institution {
    font-size: 1.1em;
    color: #6c757d;
    margin-top: 0;
    margin-bottom: 2px;
}

.bottom-section {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.contact-section {
    flex: 0 0 300px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #f7b731;
}

.contact-section h3 {
    color: #0056b3;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.contact-item {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-weight: bold;
    font-size: 0.95em;
    color: #495057;
    margin-bottom: 2px;
}

.contact-value {
    font-size: 0.95em;
    line-height: 1.4;
    color: #6c757d;
    margin-left: 15px;
}

.contact-value.secondary {
    margin-top: 2px;
}

/* ======================================================= */
/* PARENT CONTAINER */
/* ======================================================= */
.contact-social {
    margin-left: 15px;
    display: flex;
    gap: 8px; /* Handles spacing between links */
    margin-top: 2px;
}

/* ======================================================= */
/* GENERIC LINK STYLING (Applies to all social links) */
/* ======================================================= */
.contact-social a {
    font-size: 0.9em;
    text-decoration: none;
    
    /* COMBINED TRANSITION for all effects (scale and color) */
    transition: transform 0.2s ease, background-color 0.2s ease;
    
    /* Use flexbox properties for perfect centering */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-weight: bold;
    color: white; /* Default text/icon color for all social links */
}

.contact-social a:hover {
    transform: scale(1.1); /* Hover transform for all links */
}


/* ======================================================= */
/* GITHUB ICON STYLING */
/* ======================================================= */
.contact-social .github-icon {
    /* Only define unique styles (background color) here. 
       Generic sizing/display/transition is handled by .contact-social a */
    background-color: #333; /* Dark background color */
}

.github-icon i {
    /* Use font-size to control the size of the icon */
    font-size: 16px; 
    /* No need for line-height due to display: inline-flex on parent */
}

.contact-social .github-icon:hover {
    background-color: #6e5494; /* GitHub's brand purple on hover */
}

/* ======================================================= */
/* INDIVIDUAL BRAND STYLING */
/* ======================================================= */
.contact-social a.linkedin {
    background-color: #0077b5;
}

.contact-social a.linkedin:hover {
    background-color: #005885;
}

.contact-social a.twitter {
    background-color: #000000;
    font-family: 'Times New Roman', serif;
}

.contact-social a.twitter:hover {
    background-color: #333333;
}

.contact-social a.researchgate {
    background-color: #00ccbb;
    font-size: 0.8em; /* Overriding the generic font-size */
}

.contact-social a.researchgate:hover {
    background-color: #009688;
}

.bio-research {
    flex: 1;
}

.bio-research h3 {
    color: #0056b3;
    font-size: 1.3em;
    margin-bottom: 15px;
    margin-top: 25px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 5px;
}

.bio-research h3:first-child {
    margin-top: 0;
}

.biography {
    line-height: 1.7;
    text-align: justify;
    color: #495057;
    margin-bottom: 25px;
}

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

.research-interests li {
    background: #e3f2fd;
    color: #0d47a1;
    padding: 8px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #0056b3;
    font-size: 0.95em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }
    
    .profile-photo-home {
        width: 220px;
        height: 220px;
        border-radius: 8px;
    }
    
    .name-affiliation h1 {
        font-size: 2em;
    }
    
    .bottom-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .contact-section {
        flex: none;
    }
}

/* Item Styling (Publications & Projects) */
.publication-item, .project-item {
    border-bottom: 1px solid #ccc;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

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

.publication-item h2, .project-item h2 {
    color: #0056b3;
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* Enhanced Project Styling */
.project-description {
    margin-bottom: 30px;
    line-height: 1.7;
}

.project-description p {
    margin-bottom: 15px;
    text-align: justify;
    color: #495057;
}

.project-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 25px;
}

.contributors-section, .agencies-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0056b3;
}

.technologies-section {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.project-details h3 {
    color: #0056b3;
    font-size: 1.1em;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 5px;
}

.contributors-list, .agencies-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contributors-list li, .agencies-list li {
    padding: 5px 0;
    color: #495057;
    font-size: 0.95em;
}

.contributors-list li strong {
    color: #0056b3;
}

.project-role {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tech-tag {
    background: #e3f2fd;
    color: #0d47a1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    border: 1px solid #90caf9;
}

/* Tag buttons used across site */
.tag-button {
    background: transparent;
    border: none;
    color: #0056b3;
    cursor: pointer;
    padding: 3px 8px;
    font-size: 0.95em;
}

/* Modal styles for abstract popup */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}

.modal-content {
    position: relative;
    max-width: 700px;
    margin: 6% auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1010;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    color: #666;
    cursor: pointer;
}

.modal-body {
    margin-top: 10px;
    color: #333;
    line-height: 1.6;
}

/* Responsive Project Layout */
@media (max-width: 768px) {
    .project-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .technologies-section {
        grid-column: 1;
    }
    
    .tech-tags {
        justify-content: center;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 0.5rem 0;
    background: #f8f9fa;
    color: #6c757d;
    position: relative;
    bottom: 0;
    width: 100%;
    font-size: 0.9em;
    border-top: 1px solid #dee2e6;
}

/* Blog Styling */
.blog-post {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 25px;
    margin-bottom: 30px;
}

.blog-post:last-child {
    border-bottom: none;
}

.blog-post h2 {
    color: #0056b3;
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-date {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.project-status {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
    font-weight: 500;
}

.project-post {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 25px;
    margin-bottom: 30px;
}

.project-post:last-child {
    border-bottom: none;
}

.project-post h2 {
    color: #0056b3;
    font-size: 1.4em;
    margin-bottom: 10px;
    line-height: 1.3;
}

.project-excerpt {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #495057;
}

.post-tags {
    margin-bottom: 15px;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 8px;
    display: inline-block;
}

/* Make anchor tags with class .tag look like tag buttons (no underline) */
a.tag {
    text-decoration: none;
    cursor: pointer;
}

.post-excerpt {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #495057;
    text-align: justify;
}

.read-more-btn {
    background: #0056b3;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.read-more-btn:hover {
    background: #004494;
}

.read-more-btn.coming-soon {
    background: #6c757d;
    cursor: not-allowed;
}

.read-more-btn.coming-soon:hover {
    background: #6c757d;
}

/* Individual Blog Post Styling */
.blog-post-full {
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.7;
}

.post-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.post-header h1 {
    color: #0056b3;
    font-size: 2.2em;
    margin-bottom: 15px;
    line-height: 1.2;
}

.post-meta {
    color: #6c757d;
    text-align: center;
}

.post-author {
    font-style: italic;
    margin-bottom: 10px;
}

.post-content {
    margin-bottom: 40px;
}

.post-content .lead {
    font-size: 1.2em;
    color: #495057;
    font-weight: 300;
    text-align: justify;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #0056b3;
}

.post-content h2 {
    color: #0056b3;
    font-size: 1.6em;
    margin-top: 35px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 5px;
}

.post-content h3 {
    color: #495057;
    font-size: 1.3em;
    margin-top: 25px;
    margin-bottom: 12px;
}

.post-content ul, .post-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.post-content li {
    margin-bottom: 8px;
}

/* Mathematical Equations */
.math-equation {
    background: none;
    border: none;
    border-left: none;
    border-radius: 0;
    box-shadow: none;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.2em;
    font-family: 'Times New Roman', serif;
}

.math-equation em {
    font-style: italic;
}

.post-references {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-top: 30px;
}

.post-references h3 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
}

.post-references ul {
    margin-bottom: 0;
}

.post-references li {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.post-footer {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.back-to-blog {
    color: #0056b3;
    text-decoration: none;
    font-weight: bold;
}

.back-to-blog:hover {
    text-decoration: underline;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-buttons a {
    color: #6c757d;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 0.9em;
}

.share-buttons a:hover {
    background: #e9ecef;
}