/* -------------------------------- */
/* Reset Styles */
/* -------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif; /* Retain the original font for the reset */
}

/* -------------------------------- */
/* CSS Variables for Theming */
/* -------------------------------- */
:root {
    /* Light Theme Variables */
    --background-color: #e6dee1; /* Light Lavender Blush */
    --text-color: #555831; /* Base text color */
    --header-background: #a39696;
    --header-text-color: #883462; /* Original header text color */
    --nav-link-color: #333;
    --nav-link-hover-bg: #f0f0f0;
    --nav-link-active-bg: #FF4500; /* Orange background for active link */
    --nav-link-active-color: #fff;
    --section-background: #f9f9f9;
    --section-text-color: #2C3E50;
    --footer-background: #333;
    --footer-text-color: #fff;
    --accent-color: #3498DB; /* Example accent color */
    --link-color: green;
    --link-hover-color: #E74C3C;
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --background-color: #2c2c2c; /* Dark background */
    --text-color: #e0e0e0; /* Light text */
    --header-background: #1f1f1f;
    --header-text-color: #E0E0E0; /* Light text color for headers in dark mode */
    --nav-link-color: #e0e0e0;
    --nav-link-hover-bg: #444;
    --nav-link-active-bg: #FF8C00; /* Darker orange for active link */
    --nav-link-active-color: #fff;
    --section-background: #3a3a3a;
    --section-text-color: #f0f0f0;
    --footer-background: #1f1f1f;
    --footer-text-color: #e0e0e0;
    --accent-color: #66B2FF; /* Adjusted accent color for dark mode */
    --link-color: #1E90FF; /* Blue links for dark mode */
    --link-hover-color: #FF6347; /* Tomato color on hover */
}

/* -------------------------------- */
/* Base Styles for Body */
/* -------------------------------- */
body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.4;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main-header {
    position: sticky;
    top: 0;
    background-color: var(--header-background);
    z-index: 1000;
    padding: 10px 0; /* Removed horizontal padding */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Re-apply horizontal padding here */
    width: 100%;
}

.header-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    overflow: hidden;
}

.nav-visible {
    display: flex;
    align-items: center;
}

.header-nav a {
    text-decoration: none;
    color: var(--nav-link-color); /* Navigation link color from variables */
    font-weight: bold;
    padding: 5px 8px; /* Reduced padding */
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header-nav a:hover {
    background-color: var(--nav-link-hover-bg); /* Hover background from variables */
}

.header-nav a.active,
.header-nav a.active:hover,
.header-nav a.active:focus,
.header-nav a.active:active {
    background-color: var(--nav-link-active-bg); /* Active link background from variables */
    color: var(--nav-link-active-color); /* Active link text color from variables */
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--header-text-color);
    margin-left: 10px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    background-color: var(--section-background);
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    flex-direction: column;
}

.dropdown-menu a {
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.dropdown-menu a:hover {
    background-color: var(--nav-link-hover-bg);
}

/* -------------------------------- */
/* Theme Toggle Button Styles */
/* -------------------------------- */
#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem; /* Slightly reduced font size */
    color: var(--nav-link-color); /* Toggle button color from variables */
    transition: color 0.3s;
}

#theme-toggle:hover {
    color: var(--accent-color); /* Accent color on hover */
}

#theme-toggle:focus {
    outline: none;
}

/* -------------------------------- */
/* Main Layout Styles               */
/* -------------------------------- */
#main-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1 0 auto;
    gap: 20px; /* Add some space between sidebar and content */
    min-height: 100vh; /* Ensures wrapper spans the full page height */
}

#profile-sidebar {
    width: 300px;
    flex-shrink: 0;
    background-color: var(--section-background);
    padding: 20px;
    overflow-y: auto; /* Allow scrolling if content overflows */
    border-right: 1px solid #ddd;
    height: calc(100vh - 50px); /* Example height, assuming some padding on body/wrapper */
    position: sticky;
    top: 50px;
    align-self: flex-start; /* Ensures it sticks to the top of the content area */
    margin-top: 0; /* Ensures no margin pushes it down */
}

#main-content {
    flex-grow: 1;
    padding: 20px;
}
/* -------------------------------- */
/* Section Container Style for Uniform Look */
/* -------------------------------- */
.section-container {
    background-color: var(--section-background); /* Section background from variables */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px auto; /* Reduced margin for less white space */
    padding: 5px 5px; /* Reduced padding */
    max-width: 900px; /* Ensures all sections have the same width */
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, background-color 0.3s;
}

.section-container:hover {
    /* Removed transform to eliminate "shake" effect */
    box-shadow: 0 8px 8px rgba(44, 62, 80, 0.15);
}

/* -------------------------------- */
/* Profile Container */
/* -------------------------------- */
.profile-container {
    display: block; /* Changed from flex to block */
    font-size: 0.8em; /* Slightly reduced font size */
    margin-bottom: 20px; /* Reduced margin */
    line-height: 1.2; /* Adjusted line spacing */
}

.profile-photo {
    width: 180px; /* Reduced width */
    height: 180px; /* Reduced height */
    border-radius: 50%;
    object-fit: cover;
    margin-right: 30px; /* Reduced margin */
    margin-bottom: 15px; /* Reduced margin */
}

.profile-info {
    flex: 1;
    min-width: 250px; /* Reduced min-width */
}

.profile-info h1 {
    font-size: 2em; /* Reduced font size */
    margin-bottom: 8px; /* Reduced margin */
    font-weight: bold;
    color: var(--header-text-color); /* Updated to use CSS variable */
}

.profile-info p {
    margin-bottom: 4px; /* Reduced margin */
    color: var(--section-text-color); /* Section text color from variables */
    font-size: 0.8em; /* Reduced font size */
}

/* -------------------------------- */
/* Social Links Styling */
/* -------------------------------- */
.social-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--link-color);
    font-size: 0.8em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    color: var(--link-hover-color);
    text-decoration: none;
}

.social-link-text {
    display: none;
}

.social-links a.fixed-color {
    color: #3498DB; /* Fixed color for specific links */
    font-weight: bold;
}

.social-links a.fixed-color:hover {
    color: #2980b9; /* Darker shade on hover */
    text-decoration: underline;
}

.social-links a.fixed-color i {
    color: inherit; /* Inherit color from parent */
}

.social-links a.fixed-color[data-theme="dark"] {
    color: #66B2FF; /* Adjusted color for dark mode */
}

.social-links a.fixed-color[data-theme="dark"]:hover {
    color: #3399FF; /* Darker shade on hover in dark mode */
    text-decoration: underline;
}

.social-links a i {
    font-size: 1.2em; /* Reduced icon size */
    margin-right: 8px; /* Reduced space between icons */
    transition: transform 0.3s ease, color 0.3s;
}

.social-links a:hover i {
    transform: scale(1.2);
    color: #E74C3C;
}

/* Define specific colors for each icon */
.social-links a i.fa-envelope {
    color: #D44638; /* Email red */
}

.social-links a i.fa-researchgate {
    color: #00B3A4; /* ResearchGate teal */
}

.social-links a i.fa-linkedin {
    color: #0077B5; /* LinkedIn blue */
}

.social-links a i.fa-github {
    color: #333; /* GitHub black */
}

.social-links a i.fa-youtube {
    color: #FF0000; /* YouTube red */
}

.social-links a i.fa-graduation-cap {
    color: #4285F4; /* Google Scholar blue */
}

.social-links a i.fa-orcid {
    color: #A6CE39; /* ORCID green */
}

/* -------------------------------- */
/* COMMON: Projects, Presentations, and Teaching Sections */
/* -------------------------------- */
.project-container,
.presentation-container,
.teaching-container {
    display: flex;
    flex-direction: column; /* Stack items vertically to prevent overlap */
    gap: 15px; /* Reduced gap */
}

.project-container {

}

.project,
.presentation,
.teaching-section {
    background-color: var(--section-background); /* Section background from variables */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(44, 62, 80, 0.1);
    margin: 20px auto; /* Reduced margin for less white space */
    padding: 0px 5px; /* Reduced padding */
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, background-color 0.3s;

}

.project:hover,
.presentation:hover,
.teaching-section:hover {
    /* Removed transform to eliminate "shake" effect */
    box-shadow: 0 8px 12px rgba(44, 62, 80, 0.15);
}

.project-thumbnail {
    width: 90px; /* Reduced image size */
    height: 90px; /* Reduced image size */
    float: left;
    margin-right: 15px; /* Reduced margin */
    object-fit: cover;
}

/* -------------------------------- */
/* Typography Styles */
/* -------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0; /* Removes default space */
}

h1 {
    margin: 0; /* Removes default space */
    font-weight: bold;
    font-size: 2em; /* Reduced font size */
    color: #0977e6;
}

h2 {
    color: var(--header-text-color); /* Dynamic color based on theme */
    font-weight: 700;
    font-size: 1.7em; /* Reduced font size */
}

h3 {
    font-weight: bold;
    font-size: 1.4em; /* Reduced font size */
    color: #af1488;
}

p {
    margin-top: 0.8em; /* Reduced spacing between paragraphs */
    margin-bottom: 0.8em; /* Reduced spacing between paragraphs */
    font-size: 0.9em; /* Reduced font size */
    color: var(--section-text-color); /* Section text color from variables */
}

/* Simple Global List Override */
ul,
ol {
  color: #000000;
  font-size: 0.9em;
}

/* Bullets stay indented */
li {
  margin-left: 30px;
}

/* Optional: ordered list tweaks */
ol {
  padding-left: 1.0em;
}
ol li::marker {
  color: var(--accent-color);
}

/* -------------------------------- */
/* Global Link Styles */
/* -------------------------------- */
/* Style all hyperlinks to be bold and green */
a {
    color: var(--link-color); /* Green color from variables */
    font-weight: bold;
    text-decoration: none; /* Removes the underline */
    transition: color 0.3s;
}

/* Add underline on hover */
a:hover {
    text-decoration: underline; /* Underline appears on hover */
    color: var(--link-hover-color); /* Hover color from variables */
}

/* -------------------------------- */
/* Footer Styles */
/* -------------------------------- */
footer {
    background-color: var(--footer-background); /* Footer background from variables */
    color: var(--footer-text-color); /* Footer text color from variables */
    padding: 15px 0; /* Vertical padding */
    transition: background-color 0.3s, color 0.3s;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-content p {
    color: var(--footer-text-color); /* Ensure footer paragraphs use variable */
    margin: 0; /* Reset margin for p inside footer */
}

.footer-link {
    color: #3498DB; /* Blue color for the GitHub link */
    text-decoration: none;
    margin-right: 8px;
}

.footer-link:hover {
    color: #2980b9; /* Darker blue on hover */
}

.footer-link i {
    color: #3498DB; /* Blue color for the GitHub icon */
    transition: color 0.3s;
}

.footer-link:hover i {
    color: #2980b9; /* Darker blue on hover */
}

/* -------------------------------- */
/* GitHub Icon Fixed Color Styling */
/* -------------------------------- */
/* Ensure the GitHub icon is white in both themes */
.github-fixed-color i.fa-github {
    color: #a0a0c5 !important; /* White color with high specificity */
    transition: transform 0.3s ease; /* Smooth transition for any transform changes */
}

/* Maintain white color on hover, focus, and active states */
.github-fixed-color:hover i.fa-github,
.github-fixed-color:focus i.fa-github,
.github-fixed-color:active i.fa-github {
    color: #08ec2e !important; /* Retain white color */
}

/* Optional: Add a subtle hover effect for interactivity */
.github-fixed-color:hover i.fa-github {
    transform: scale(1.1); /* Slightly enlarge the icon on hover */
}

/* -------------------------------- */
/* Responsive Design Adjustments */
/* -------------------------------- */
@media (max-width: 1024px) {
    .profile-container {
        flex-direction: column; /* Stack profile elements vertically */
        align-items: center;
    }

    .profile-photo {
        margin-right: 0; /* Remove right margin for better alignment */
    }

    .profile-info {
        text-align: center; /* Center text on smaller screens */
    }

    .social-links {
        justify-content: center; /* Center social links */
    }
}

@media (min-width: 768px) {
    .social-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .social-links a {
        font-size: 0.9em;
        margin-bottom: 12px;
    }

    .social-link-text {
        display: inline;
        margin-left: 10px;
    }

    .social-links a:hover {
        text-decoration: underline;
    }
}

@media (max-width: 768px) {
    .header-nav .nav-visible {
        display: none;
    }

    .hamburger-menu {
        display: block;
    }

    #main-wrapper {
        flex-direction: column;
    }

    #profile-sidebar {
        width: 100%;
        position: static; /* Reset sticky position */
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    body {
        padding-top: 0;
    }

    nav {
        flex-direction: column; /* Stack navigation vertically */
    }

    .header-nav {
        margin-top: 0; /* Reduced margin */
        justify-content: center; /* Center navigation items */
    }

    .header-nav a {
        margin: 0 8px 8px; /* Adjust margins for better spacing */
    }

    .profile-photo {
        width: 130px; /* Reduced photo size */
        height: 130px; /* Reduced photo size */
    }

    .profile-info h1 {
        font-size: 1.7em; /* Adjust heading size */
    }

    h2 {
        font-size: 1.4em; /* Adjust subheading size */
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 0; /* Further reduced padding for very small screens */
    }

    .profile-photo {
        width: 100px; /* Further reduce photo size */
        height: 100px; /* Further reduce photo size */
    }

    .profile-info h1 {
        font-size: 1.3em; /* Further adjust heading size */
    }

    h2 {
        font-size: 1.1em; /* Further adjust subheading size */
    }

    .social-links a {
        font-size: 0.9em; /* Reduce font size for social links */
    }
}

.publication-link {
    display: inline-block;
    padding: 3px 8px;
    margin: 4px;
    background-color: transparent; /* Make background transparent */
    color: #586069; /* Dark gray for text/icon */
    border: 1px solid hwb(0 0% 100%); /* Add a gray border */
    border-radius: 5px;
    text-decoration: none;
    font-size: 10px;
    font-weight: bold;
    transition: color 0.3s, border-color 0.3s; /* Update transition */
}

.publication-link:hover {
    color: #1abc9c; /* Teal text/icon color on hover */
    border-color: #1abc9c; /* Teal border color on hover */
    background-color: transparent; /* Ensure background stays transparent */
}



.home-link {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--header-text-color);
}

.header-nav {
    flex-grow: 1;
    text-align: center;
}

.header-nav a {
    margin: 0 15px;
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: bold;
}

.header-nav a:hover {
    color: var(--link-hover-color);
}

.header-right {
    display: flex;
    align-items: center;
}

.header-right a {
    margin-left: 20px;
    font-size: 1.2em;
    color: var(--nav-link-color);
}

.header-right a:hover {
    color: var(--link-hover-color);
}


/* -------------------------------- */
/* Search Modal Styles              */
/* -------------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#search-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#search-results {
    max-height: 300px;
    overflow-y: auto;
}

#search-results .result-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

@media (max-width: 991.98px) {
    #main-wrapper {
        flex-direction: column;
    }

    #profile-sidebar {
        width: 100%;
        position: static;
    }

    #main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
}

/* ─────────────────────────────────────────────────────
   Section separators for all first-level <sections>s under #page-content
   ───────────────────────────────────────────────────── */
#page-content > section {
  border-bottom: 3px solid var(--text-color);
  padding-bottom: 10px;   /* space between content and line */
  margin-bottom: 10px;    /* space after the line */
}

/* Remove the line under the very last section */
#page-content > section:last-of-type {
  border-bottom: none;
}
