/* Basic Reset and Body Styling */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color); /* Use CSS variable for text color */
    background-color: var(--background-color); /* Use CSS variable for background */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for theme change */
    padding-top: 60px; /* Add padding to the top of the body equal to the nav height */
    overflow-x: hidden; /* Prevent horizontal scroll when mobile menu is open */
}

/* CSS Variables for Theme */
:root {
    --background-color: #ffffff; /* Light mode background */
    --text-color: #333; /* Light mode text color */
    --primary-color: #007bff; /* Accent color (blue) */
    --secondary-background: #f4f4f4; /* Light mode card background */
    --border-color: #ddd; /* Light mode border color */
    --header-background-light: #e0f2ff; /* Light mode header background (light blue) */
    --header-text-light: #1a2b3c; /* Light mode header text (darker text for contrast) */
    --nav-background: #ffffff; /* Light mode nav background */
    --nav-text: #333; /* Light mode nav text */
    --nav-border: #ddd; /* Light mode nav border */
    --nav-mobile-background: #f8f9fa; /* Light mode mobile menu background */
}

body.dark-mode {
    --background-color: #1e1e1e; /* Dark mode background */
    --text-color: #f4f4f4; /* Dark mode text color */
    --secondary-background: #333; /* Dark mode card background */
    --border-color: #555; /* Dark mode border color */
    --header-background-dark: #003366; /* Dark mode header background (dark blue) */
    --header-text-dark: #a0cfff; /* Dark mode header text (brighter lighter blue) */
    --nav-background: #333; /* Dark mode nav background */
    --nav-text: #f4f4f4; /* Dark mode nav text */
    --nav-border: #555; /* Dark mode nav border */
    --nav-mobile-background: #444; /* Dark mode mobile menu background */
}


/* Container for centering content */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px; /* Add some padding on smaller screens */
}

/* Fixed Navigation Bar Styling */
.fixed-nav {
    position: fixed; /* Make the nav bar fixed */
    top: 0; /* Position at the top */
    left: 0;
    width: 100%; /* Full width */
    background-color: var(--nav-background);
    color: var(--nav-text);
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure it stays on top */
    border-bottom: 1px solid var(--nav-border);
    display: flex; /* Use flexbox for nav content */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    min-height: 40px; /* Ensure a minimum height */
}

.fixed-nav .container {
    display: flex; /* Use flexbox for items inside container */
    justify-content: space-between; /* Space out nav items */
    align-items: center; /* Vertically align items */
    width: 100%; /* Take full width of the container */
}

/* Desktop Navigation Links */
/* By default, nav-links is a flex container on desktop */
.fixed-nav .nav-links {
    display: flex;
    align-items: center;
    width: 100%; /* Take full width on desktop */
    justify-content: center; /* Center links on desktop */
    /* Ensure mobile styles are overridden on desktop */
    position: static;
    top: auto;
    left: auto;
    transform: translateX(0);
    visibility: visible;
    height: auto;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    overflow-y: visible;
    flex-direction: row; /* Ensure horizontal layout on desktop */
}


.fixed-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Use flexbox for horizontal layout */
    flex-wrap: wrap; /* Allow links to wrap on smaller screens */
    justify-content: center; /* Center the links */
    flex-grow: 1; /* Allow ul to take up available space */
}

.fixed-nav li {
    margin: 0 10px; /* Spacing between links */
    padding: 0; /* Remove padding from list items */
    border-bottom: none; /* Remove border from list items */
}

.fixed-nav a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.9em; /* Make nav links smaller */
    font-weight: 600;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent links from breaking */
}

.fixed-nav a:hover {
    color: var(--primary-color);
}

/* Theme Toggle Button in Nav */
.fixed-nav #theme-toggle {
    background: none;
    border: none;
    color: var(--nav-text); /* Use nav text color */
    cursor: pointer;
    font-size: 1.2em; /* Adjust size for nav bar */
    margin-left: 20px; /* Add space between links and toggle */
    transition: color 0.3s ease;
    flex-shrink: 0; /* Prevent the toggle button from shrinking */
}

.fixed-nav #theme-toggle:hover {
    color: var(--primary-color);
}

/* Mobile Menu Toggle Button (Hidden on Desktop) */
.menu-toggle {
    display: none; /* Hide by default on desktop */
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 1001; /* Ensure it's above the mobile menu */
}


/* Header Styling */
header {
    background-color: var(--header-background-light); /* Default light mode header background */
    color: var(--header-text-light); /* Default light mode header text */
    padding: 40px 0;
    text-align: center;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

body.dark-mode header {
    background-color: var(--header-background-dark); /* Dark mode header background */
    color: var(--header-text-dark); /* Dark mode header text */
}


header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-color); /* Apply blue accent to heading */
}

header .subtitle {
    margin-top: 5px;
    font-size: 1.2em;
    font-weight: 400;
}

/* Contact Info Styling */
.contact-info {
    margin-top: 20px;
    font-size: 1.5em; /* Increase icon size */
    display: flex; /* Use flexbox to align icons */
    justify-content: center; /* Center icons horizontally */
    gap: 20px; /* Add space between icons */
}

.contact-info a {
    color: var(--text-color); /* Use text color for icons */
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--primary-color); /* Change color on hover */
}


/* Profile Photo Styling */
.profile-photo {
    width: 150px; /* Fixed width */
    height: 150px; /* Fixed height */
    border-radius: 50%; /* Make it round */
    margin-bottom: 15px;
    border: 3px solid var(--primary-color); /* Add a border with accent color */
    object-fit: cover; /* Ensure the image covers the area without distortion */
}


/* Main Content Area */
main {
    padding: 20px 0;
}

/* Card Styling for Sections */
.card {
    background-color: var(--secondary-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card h3 {
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1.2em;
    font-weight: 600;
}

.card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.card li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.card p {
    margin: 5px 0;
}

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

.card a:hover {
    text-decoration: underline;
}

/* Publications Specific Styling */
.publication-title {
    font-size: 1.1em; /* Slightly larger font for title */
    font-weight: 600; /* Make title bold */
    text-decoration: underline; /* Underline the title */
    margin-bottom: 5px;
}

.publication-authors {
    margin-bottom: 5px;
}

.publication-venue {
    font-style: italic; /* Italicize the venue */
}


/* Skills Section Specific Styling (Removed) */
/* Courses Section Specific Styling (Removed) */


/* Footer Styling */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
}

footer p {
    margin: 0;
    font-size: 0.9em;
}


/* Responsive Design */
@media (max-width: 768px) {
     body {
        padding-top: 60px; /* Keep padding consistent with nav height */
    }

    .fixed-nav .container {
        flex-direction: row; /* Keep items in a row in the nav bar */
        justify-content: space-between; /* Space out menu toggle and content */
    }

    /* Mobile menu styling */
    .fixed-nav .nav-links {
        position: fixed;
        top: 60px; /* Position below the fixed nav header */
        left: 0; /* Position at the left edge */
        width: 250px; /* Width of the mobile menu */
        height: calc(100vh - 60px); /* Take full height below the nav */
        background-color: var(--nav-mobile-background);
        flex-direction: column; /* Stack links vertically */
        align-items: flex-start; /* Align links to the left */
        padding: 20px;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, visibility 0.3s ease; /* Smooth slide-in transition */
        overflow-y: auto; /* Add scroll if menu content is long */
        transform: translateX(-100%); /* Hide the menu by translating it left */
        visibility: hidden; /* Hide the menu from screen readers and interactions */
        justify-content: flex-start; /* Align content to the top */
    }

    /* When menu-open class is added to body */
    body.menu-open .fixed-nav .nav-links {
        transform: translateX(0); /* Slide the menu into view */
        visibility: visible; /* Make the menu visible */
    }

    .fixed-nav ul {
        flex-direction: column; /* Stack links vertically */
        align-items: flex-start; /* Align links to the left */
        width: 100%; /* Take full width of the mobile menu */
        margin-bottom: 20px; /* Add space below links before toggle */
        padding-top: 0; /* Ensure no extra padding at the top of the list */
        margin-top: 0; /* Ensure no extra margin at the top of the list */
    }

    .fixed-nav li {
        margin: 10px 0; /* Adjust margin for stacked links */
        width: 100%; /* Make list items take full width */
    }

    .fixed-nav a {
        font-size: 1.1em; /* Slightly larger font for mobile links */
    }

    /* Show the mobile menu toggle button */
    .menu-toggle {
        display: block;
        color: var(--nav-text); /* Match nav text color */
    }

    /* Adjust theme toggle position in mobile menu */
    .fixed-nav #theme-toggle {
        margin-left: 0;
        margin-top: 10px; /* Add space above toggle */
        align-self: flex-start; /* Align toggle to the left */
    }


    header {
        padding: 30px 0;
    }

    header h1 {
        font-size: 2em;
    }

    header .subtitle {
        font-size: 1em;
    }

    .contact-info {
        font-size: 1.2em; /* Slightly smaller icons on mobile */
        gap: 15px; /* Adjust gap on mobile */
    }


    .card {
        padding: 15px;
    }

    .card h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .card h3 {
        font-size: 1.1em;
    }

    .profile-photo {
        width: 100px; /* Adjust size for smaller screens */
        height: 100px; /* Adjust size for smaller screens */
    }
}

@media (max-width: 480px) {
    .fixed-nav li {
        margin: 8px 0; /* Adjust margin for stacked links on very small screens */
    }
    .profile-photo {
        width: 80px; /* Adjust size for very small screens */
        height: 80px; /* Adjust size for very small screens */
    }
     .fixed-nav .nav-links {
        width: 200px; /* Adjust mobile menu width for very small screens */
        transform: translateX(-100%); /* Hide the menu by translating it left */
    }
    .contact-info {
        font-size: 1em; /* Further decrease icon size on very small mobile */
        gap: 10px; /* Further decrease gap */
    }
}
