/* Base styles */
body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    background-color: #f9fafb; /* bg-gray-50 */
    color: #1f2937; /* text-gray-800 */
}

/* Custom scrollbar for a cleaner look */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #7EBAA1; /* Main theme color */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6a9e88; /* Slightly darker shade on hover */
}

/* Smooth scroll to sections when clicking nav links */
html {
    scroll-behavior: smooth;
}

/* Header/Navigation Bar */
header {
    background-color: #ffffff; /* bg-white */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    padding-top: 1rem; /* py-4 */
    padding-bottom: 1rem; /* py-4 */
    position: sticky;
    top: 0;
    z-index: 50;
}
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: 56rem; /* equivalent to max-w-4xl for content */
    padding-left: 1rem; /* px-4 */
    padding-right: 1rem; /* px-4 */
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-brand {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    color: #7EBAA1; /* text-[#7EBAA1] */
    text-decoration: none;
}

/* Mobile Menu Button Wrapper */
.mobile-menu-toggle-wrapper {
    display: flex; /* Show on small screens by default */
    align-items: center;
}
.mobile-menu-toggle {
    display: flex; /* Show on small screens */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem; /* p-2 */
    border-radius: 0.375rem; /* rounded-md */
    outline: none; /* focus:outline-none */
    background: none; /* remove default button background */
    border: none; /* remove default button border */
    cursor: pointer;
}
.mobile-menu-toggle:focus {
    box-shadow: 0 0 0 2px rgba(126, 186, 161, 0.5); /* focus:ring-2 focus:ring-[#7EBAA1] */
}
.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: #4b5563; /* bg-gray-700 */
}
.hamburger-active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Desktop Navigation */
.desktop-nav {
    display: none; /* Hidden on small screens by default */
    gap: 2rem; /* space-x-8 */
}
.desktop-nav a {
    color: #4b5563; /* text-gray-700 */
    font-weight: 500; /* font-medium */
    transition: color 300ms ease-in-out; /* transition duration-300 */
    text-decoration: none;
}
.desktop-nav a:hover,
.desktop-nav a.active {
    color: #7EBAA1; /* hover:text-[#7EBAA1] */
}

/* Mobile Navigation (the dropdown menu itself) */
.mobile-nav {
    display: none; /* Hidden by default, toggled by JS */
    background-color: #ffffff; /* bg-white */
    margin-top: 0.5rem; /* mt-2 */
    padding-left: 1rem; /* px-4 */
    padding-right: 1rem; /* px-4 */
    padding-bottom: 0.5rem; /* pb-2 */
    border-top: 1px solid #e5e7eb; /* border-t border-gray-200 */
    width: 100%; /* Ensure it takes full width */
    position: absolute; /* Position relative to header */
    left: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Add shadow for dropdown effect */
}
.mobile-nav.show-mobile-menu { /* Class added by JS when active */
    display: block;
}
.mobile-nav a {
    display: block;
    padding-top: 0.5rem; /* py-2 */
    padding-bottom: 0.5rem; /* py-2 */
    color: #4b5563; /* text-gray-700 */
    font-weight: 500; /* font-medium */
    transition: color 300ms ease-in-out; /* transition duration-300 */
    border-bottom: 1px solid #f3f4f6; /* border-b border-gray-100 */
    text-decoration: none;
}
.mobile-nav a:hover,
.mobile-nav a.active {
    color: #7EBAA1; /* hover:text-[#7EBAA1] */
}
.mobile-nav a:last-child {
    border-bottom: none;
}

/* Main content sections */
main {
    max-width: 56rem; /* max-w-4xl */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem; /* px-4 */
    padding-right: 1rem; /* px-4 */
    padding-top: 2rem; /* py-8 */
    padding-bottom: 2rem; /* py-8 */
}

section {
    padding-top: 3rem; /* py-12 */
    padding-bottom: 3rem; /* py-12 */
    border-bottom: 1px solid #e5e7eb; /* border-b border-gray-200 */
}
section:last-of-type {
    border-bottom: none; /* No border for the last section */
}

/* Specific styling for section headings */
.section-heading {
    font-size: 1.875rem; /* text-3xl */
    border-bottom: 2px solid #7EBAA1;
    padding-bottom: 0.5rem;
    display: inline-block;
    margin-bottom: 2rem;
    color: #2c5f4d; /* Darker shade of theme color */
    font-weight: 700;
}

/* About Me Section specific styles */
.about-me-content {
    display: flex;
    flex-direction: column; /* flex-col */
    align-items: center; /* items-center */
}
.about-me-image-container {
    width: 10rem; /* Increased from 8rem (w-32) to w-40 */
    height: 10rem; /* Increased from 8rem (h-32) to h-40 */
    border-radius: 9999px; /* rounded-full */
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    margin-bottom: 1.5rem; /* mb-6 */
}
.about-me-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.about-me-text p {
    font-size: 1.125rem; /* text-lg */
    line-height: 1.625; /* leading-relaxed */
    margin-bottom: 1rem; /* mb-4 */
}
.about-me-text p:last-child {
    margin-bottom: 0; /* Remove bottom margin for the last paragraph */
}
/* Specific style for links within about-me-text */
.about-me-text p a {
    color: #7EBAA1; /* Main theme color */
    text-decoration: underline; /* Always underlined */
}
.about-me-text p a:hover {
    color: #6a9e88; /* Slightly darker shade on hover, if desired */
}

.policy-link {
    font-size: 1rem; /* text-md */
    line-height: 1.5;
    margin-top: 1rem;
}
.policy-link a {
    color: #7EBAA1;
    text-decoration: underline;
}

/* Our Lab Section styles */
.lab-description {
    margin-bottom: 1rem; /* Add some space below the paragraph */
    line-height: 1.8; /* Increased line spacing */
}
.lab-description a {
    color: #7EBAA1;
    text-decoration: underline;
}
.lab-projects-list {
    list-style-type: disc;
    list-style-position: inside;
    margin-left: 1rem; /* ml-4 */
    margin-bottom: 1.5rem;
}
.lab-projects-list li {
    margin-bottom: 0.75rem; /* Increased spacing between list items */
    font-size: 1.125rem; /* text-lg */
    line-height: 1.75rem; /* text-lg line-height */
}
.lab-projects-list li span {
    font-weight: 600; /* font-semibold */
    color: #7EBAA1; /* Theme color for emphasis */
}

/* Honors Section styles */
.honors-list {
    list-style-type: disc;
    list-style-position: inside;
    margin-left: 1rem; /* ml-4 */
    padding: 0; /* Override default padding */
}
.honors-list li {
    margin-bottom: 0.5rem; /* space-y-2 */
    font-size: 1.125rem; /* text-lg */
    line-height: 1.75rem; /* text-lg line-height */
}
.honors-list .honor-year {
    font-weight: 600; /* semibold */
    color: #7EBAA1; /* Theme color for year */
}
.honors-list li a {
    color: #1f2937; /* Default text color for links within honors */
    text-decoration: none; /* No underline by default */
}
.honors-list li a:hover {
    text-decoration: underline;
    color: #7EBAA1; /* Underline and theme color on hover */
}

/* Publications section specific styles */
.publications-container h3 { /* Style for H3 subheadings within publications */
    font-size: 1.3rem; /* Slightly smaller than section heading, larger than body */
    font-weight: 600;
    color: #2c5f4d;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.publication-item {
    background-color: #ffffff; /* bg-white */
    padding: 0.75rem 1rem; /* Slightly reduced padding to make it more compact */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    border: 1px solid #f3f4f6; /* border border-gray-100 */
    margin-bottom: 0.75rem; /* Reduced space between publication blocks */
}
.publications-list { /* This div will wrap all publication items under a sub-heading */
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Reduced gap between items */
}

.publication-item p {
    margin-bottom: 0.125rem; /* Very small margin between lines in a publication block */
    line-height: 1.4; /* Compact line height */
}
.publication-item p:last-child {
    margin-bottom: 0; /* Remove bottom margin for the last paragraph in the item */
}


.publication-item .pub-main-line {
    font-size: 1.05rem; /* Slightly smaller for compactness */
    font-weight: 500; /* Medium weight for title */
    color: #2c5f4d; /* Darker shade for main title */
}
.publication-item .pub-main-line a {
    color: #2c5f4d; /* Default link color for title */
    text-decoration: none; /* No underline by default */
}
.publication-item .pub-main-line a:hover {
    text-decoration: underline;
    color: #7EBAA1; /* Underline and theme color on hover */
}

.publication-item .pub-id {
    font-size: 0.95rem; /* Smaller for id */
    color: #6b7280; /* Muted color for ID */
    font-weight: normal;
    margin-right: 0.3em; /* space between ID and title */
}
.publication-item .pub-links-inline {
    font-size: 0.85rem; /* Even smaller for code/extended links */
    margin-left: 0.5em; /* Space after title for links */
}
.publication-item .pub-links-inline a {
    color: #7EBAA1; /* Theme color for code/extended links */
    text-decoration: underline;
}

.publication-item .pub-authors {
    font-size: 0.95rem; /* Smaller for authors */
    color: #4b5563; /* text-gray-700 */
}
.publication-item .pub-authors b, .publication-item .pub-authors strong { /* Ensure bolding for 'Hsu-Chun Hsiao' */
    font-weight: 600;
}

.publication-item .pub-venue-date {
    font-size: 0.95rem; /* Smaller for venue/date */
    color: #6b7280; /* text-gray-600 */
    font-style: italic; /* Venue/date can be italic */
}

/* Teaching Section styles */
.teaching-list {
    list-style-type: disc;
    list-style-position: inside;
    margin-left: 1rem;
    padding: 0;
}
.teaching-list li {
    margin-bottom: 0.5rem; /* Consistent spacing for list items */
    font-size: 1.125rem;
    line-height: 1.75rem;
}
.teaching-list .course-code {
    font-weight: 600;
    color: #1f2937; /* Default text color for course code */
}
.teaching-list a {
    color: #7EBAA1;
    text-decoration: underline;
}

/* Services Section styles */
.services-list {
    list-style-type: disc;
    list-style-position: inside;
    margin-left: 1rem;
    padding: 0;
}
.services-list li {
    margin-bottom: 0.5rem; /* Consistent spacing for list items */
    font-size: 1.125rem;
    line-height: 1.75rem;
}

/* Contact section specific styles */
.contact-card {
    background-color: #ffffff; /* bg-white */
    padding: 1.5rem; /* Reduced padding from 2rem to 1.5rem */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    border: 1px solid #f3f4f6; /* border border-gray-100 */
}
.contact-intro {
    font-size: 1.125rem; /* text-lg */
    line-height: 1.625; /* leading-relaxed */
    margin-bottom: 1rem; /* Adjusted for better spacing */
}
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reduced spacing between contact lines from 1rem to 0.5rem */
}
.contact-details p {
    margin-bottom: 0; /* Ensure no extra margin between paragraphs within contact-details */
    font-size: 1rem; /* Slightly reduced font size for compactness */
    line-height: 1.5; /* Standard line height */
}
.contact-details .contact-label {
    font-weight: 600; /* font-semibold */
    color: #2c5f4d; /* text-[#2c5f4d] */
}
.contact-details a {
    color: #7EBAA1; /* text-[#7EBAA1] */
    text-decoration: underline;
}
.contact-details a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #2c5f4d; /* bg-[#2c5f4d] */
    color: #ffffff; /* text-white */
    padding-top: 2rem; /* py-8 */
    padding-bottom: 2rem; /* py-8 */
    margin-top: 3rem; /* mt-12 */
    text-align: center;
}
.footer-content {
    text-align: center;
}
.footer-content p {
    font-size: 1rem; /* default text size */
}
.footer-content .footer-tagline {
    font-size: 0.875rem; /* text-sm */
    margin-top: 0.5rem; /* mt-2 */
}

/* Media Queries for Responsiveness */
@media (min-width: 768px) { /* Corresponds to Tailwind's md breakpoint */
    .mobile-menu-toggle-wrapper { /* Hide wrapper on desktop */
        display: none;
    }
    .mobile-menu-toggle { /* Hide button on desktop */
        display: none;
    }
    .desktop-nav {
        display: flex; /* Show on desktop */
    }
    .mobile-nav {
        display: none; /* Always hidden on desktop */
    }
    .about-me-content {
        flex-direction: row; /* md:flex-row */
        gap: 2rem; /* md:space-x-8 - using gap for modern flexbox */
    }
    .about-me-image-container {
        width: 20rem; /* Increased width for a wider rectangle */
        height: 10rem; /* Adjusted height to be half of the width */
        border-radius: 1.5rem; /* Rounded corners for the rectangle effect */
        margin-bottom: 0; /* md:mb-0 */
    }
    /* Removed the teaching-services-grid for two columns as they are now separate sections */
}
