/* Apply Inter font to the body */
body {
    font-family: 'Inter', sans-serif;
}

.gradient-text {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title {
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    border-radius: 3px;
}

.publication-item {
    transition: all 0.3s ease;
}

.publication-item:hover {
    transform: translateX(5px);
}

.nav-link {
    position: relative;
    color: #d1d5db;
    /* Light gray for nav links in dark mode */
}

.nav-link:hover {
    color: #ffffff;
    /* White on hover in dark mode */
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover:after {
    width: 100%;
}

/* Active nav link style for JavaScript */
.nav-link.active-section {
    color: #3b82f6;
    /* Blue-600 */
}

.nav-link.active-section:after {
    width: 100%;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -30px;
    top: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3b82f6;
    z-index: 1;
    /* Ensure dot is above the line */
}

.timeline:before {
    content: '';
    position: absolute;
    left: -23px;
    top: 0;
    height: 100%;
    width: 2px;
    background: #4b5563;
    /* Darker grey for timeline line in dark mode */
}

/* Back to top button */
#back-to-top {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Fixed position */
    bottom: 20px;
    /* Place at the bottom */
    right: 20px;
    /* Place at the right */
    z-index: 99;
    /* Ensure it's above other content */
    border: none;
    /* Remove borders */
    outline: none;
    /* Remove outline */
    background-color: #3b82f6;
    /* Blue background */
    color: white;
    /* White text */
    cursor: pointer;
    /* Add a mouse pointer on hover */
    padding: 15px;
    /* Some padding */
    border-radius: 50%;
    /* Rounded corners */
    font-size: 18px;
    /* Increase font size */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Add a subtle shadow */
    transition: background-color 0.3s ease, transform 0.3s ease;
    /* Smooth transition */
}

#back-to-top:hover {
    background-color: #1e3a8a;
    /* Darker blue on hover */
    transform: translateY(-2px);
    /* Slight lift on hover */
}

/* Photo carousel specific styles */
.carousel-container {
    position: relative;
    width: 100%;
    margin: auto;
    overflow: hidden;
    border-radius: 0.5rem;
    /* rounded-lg */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* shadow-md */
    aspect-ratio: 16 / 9;
    /* Maintain aspect ratio for photos */
    height: 300px;
    /* Fixed height for carousel */
}

.carousel-image {
    width: 100%;
    height: 100%;
    /* Fill the container height */
    object-fit: cover;
    /* Cover the area without distortion */
    display: block;
    transition: opacity 0.5s ease-in-out;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 0.375rem;
    /* rounded-md */
    transition: background-color 0.3s ease;
}

.carousel-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: white;
}

.photo-title {
    position: absolute;
    bottom: 20px;
    /* Above the dots */
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 15px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.carousel-container:hover .photo-title {
    opacity: 1;
}

/* News section fixed height and scrollable */
.news-scroll-container {
    height: 300px;
    /* Match carousel height */
    overflow-y: auto;
    padding-right: 10px;
    /* Space for scrollbar */
}

/* Hide scrollbar for aesthetic, but keep functionality */
.news-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.news-scroll-container::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    /* gray-600 */
    border-radius: 4px;
}

.news-scroll-container::-webkit-scrollbar-track {
    background-color: #1f2937;
    /* gray-800 */
}

.news-item-line {
    display: block;
    /* Ensure it takes full width */
}

/* Publications scrollable container */
.publications-scroll-container {
    max-height: 600px;
    /* Example height, adjust as needed */
    overflow-y: auto;
    padding-right: 10px;
    /* Space for scrollbar */
}

.publications-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.publications-scroll-container::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    /* gray-600 */
    border-radius: 4px;
}

.publications-scroll-container::-webkit-scrollbar-track {
    background-color: #1f2937;
    /* gray-800 */
}

/* Light Mode Styles - Applied when html has class="light-mode" */
html.light-mode body {
    background-color: #f9fafb;
    /* gray-50 */
    color: #1f2937;
    /* gray-800 */
}

html.light-mode header {
    background-color: #ffffff;
    /* white */
}

html.light-mode header .gradient-text {
    /* Fix header logo color in light mode */
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html.light-mode .nav-link {
    color: #4b5563;
    /* gray-600 */
}

html.light-mode .nav-link:hover {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode #mobile-menu {
    background-color: #ffffff;
    /* white */
}

html.light-mode #mobile-menu a {
    color: #1f2937;
    /* gray-800 */
    border-color: #e5e7eb;
    /* gray-200 */
}

html.light-mode #mobile-menu-button {
    color: #4b5563;
    /* gray-600 */
}

html.light-mode #theme-toggle-button {
    /* Change sun/moon icon color in light mode */
    color: #4b5563;
    /* gray-600 */
}

html.light-mode #theme-toggle-button:hover {
    color: #1f2937;
    /* gray-800 */
}

html.light-mode #about {
    background: linear-gradient(to right, #e0f2fe, #eef2ff);
    /* blue-50 to indigo-50 */
}

/* Updated: Ensure h1, h2, h3, and p tags within #about have dark text in light mode */
html.light-mode #about h1,
html.light-mode #about h2,
html.light-mode #about h3,
/* Added h3 here */
html.light-mode #about p {
    color: #1f2937;
    /* gray-800 */
}

html.light-mode #about h1 .gradient-text {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html.light-mode #about .section-title:after {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

/* CSS update for Download CV button light mode */
html.light-mode #about .btn-outline {
    color: #2563eb;
    /* blue-600 text */
    border-color: #2563eb;
    /* blue-600 border */
}

html.light-mode #about .btn-outline:hover {
    background-color: #eff6ff;
    /* blue-50 bg */
}

/* CSS update for Contact Me button light mode */
html.light-mode #about .btn-primary {
    background-color: #2563eb;
    /* blue-600 */
    color: #ffffff;
    /* white */
}

html.light-mode #about .btn-primary:hover {
    background-color: #1d4ed8;
    /* blue-700 */
}

/* Ensure the other pub button maintains its style */
html.light-mode #about a[href="#publications"] {
    color: #2563eb;
    /* blue-600 text */
    border-color: #2563eb;
    /* blue-600 border */
}

html.light-mode #about a[href="#publications"]:hover {
    background-color: #eff6ff;
    /* blue-50 bg */
}

html.light-mode #about .bg-gray-800 {
    /* Research interest cards */
    background-color: #eff6ff;
    /* blue-50 */
    border-color: #3b82f6;
    /* blue-500 */
}

/* Updated: Ensure h4 tags within research interest cards have dark text in light mode */
html.light-mode #about .bg-gray-800 h4 {
    color: #1f2937;
    /* gray-800 */
}

html.light-mode #about .bg-gray-800 p {
    color: #4b5563;
    /* gray-600 */
}

/* Add this inside the existing light mode styles section */
html.light-mode #education {
    background-color: #f9fafb;
    /* gray-50 */
}

html.light-mode #education h2.section-title {
    color: #1f2937;
    /* Dark text for headers */
}

html.light-mode #education .section-title:after {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

html.light-mode #education .bg-gray-700 {
    background-color: #ffffff;
    /* white */
}

html.light-mode #education .bg-gray-700 h3 {
    color: #1f2937;
    /* gray-800 */
}

html.light-mode #education .bg-gray-700 p {
    color: #4b5563;
    /* gray-600 */
}

html.light-mode #news-photos {
    background-color: #ffffff;
    /* white */
}

/* Fix for headers in News and Photos sections */
html.light-mode #news-photos h2.section-title {
    color: #1f2937;
    /* Dark text for headers */
}

html.light-mode #news-photos .section-title:after {
    /* Ensure underline also updates */
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

html.light-mode #news-photos .bg-gray-800 {
    /* News items */
    background-color: #f9fafb;
    /* gray-50 */
}

html.light-mode #news-photos .news-item-line {
    color: #4b5563;
    /* gray-600 */
}

html.light-mode #news-photos .news-item-line .text-blue-400 {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode #news-photos .news-item-line .text-red-400 {
    color: #ef4444;
    /* red-500 */
}

/* Specific light mode for links inside news items */
html.light-mode #news-photos .news-item-line a {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode #news-photos .news-item-line a:hover {
    color: #1d4ed8;
    /* blue-700 */
    text-decoration: underline;
}

html.light-mode .news-scroll-container::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    /* gray-400 */
}

html.light-mode .news-scroll-container::-webkit-scrollbar-track {
    background-color: #e5e7eb;
    /* gray-200 */
}

html.light-mode #experience {
    background-color: #f9fafb;
    /* gray-50 */
}

/* Fix for headers in Experience section */
html.light-mode #experience h2.section-title {
    color: #1f2937;
    /* Dark text for headers */
}

html.light-mode #experience .section-title:after {
    /* Ensure underline also updates */
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

html.light-mode #experience .timeline:before {
    background-color: #e5e7eb;
    /* gray-200 */
}

html.light-mode #experience .bg-gray-700 {
    /* Experience items */
    background-color: #ffffff;
    /* white */
}

/* Updated: Ensure h3 tags within experience items have dark text in light mode */
html.light-mode #experience .bg-gray-700 h3 {
    color: #1f2937;
    /* gray-800 */
}

html.light-mode #experience .bg-gray-700 span,
html.light-mode #experience .bg-gray-700 a,
html.light-mode #experience .bg-gray-700 p {
    color: #4b5563;
    /* gray-600 */
}

html.light-mode #experience .bg-gray-700 a:hover {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode #experience .bg-gray-700 .text-blue-400 {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode #publications {
    background-color: #ffffff;
    /* white */
}

/* Fix for headers in Publications section */
html.light-mode #publications h2.section-title {
    color: #1f2937;
    /* Dark text for headers */
}

html.light-mode #publications .section-title:after {
    /* Ensure underline also updates */
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

html.light-mode #publications .bg-gray-800 {
    /* Publication items */
    background-color: #f9fafb;
    /* gray-50 */
}

/* Updated: Ensure h3 tags within publication items have dark text in light mode */
html.light-mode #publications .bg-gray-800 h3 {
    color: #1f2937;
    /* gray-800 */
}

html.light-mode #publications .bg-gray-800 span,
html.light-mode #publications .bg-gray-800 p,
html.light-mode #publications .bg-gray-800 a {
    color: #4b5563;
    /* gray-600 */
}

html.light-mode #publications .bg-gray-800 a:hover {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode #publications .bg-gray-800 .text-blue-400 {
    color: #3b82f6;
    /* blue-600 */
}

html.light-mode .publications-scroll-container::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    /* gray-400 */
}

html.light-mode .publications-scroll-container::-webkit-scrollbar-track {
    background-color: #e5e7eb;
    /* gray-200 */
}

html.light-mode #contact {
    background-color: #1f2937;
    /* gray-800 - keep dark for contrast */
    color: #d1d5db;
    /* gray-300 */
}

/* Updated: Ensure h2 and h3 tags within contact section have dark text in light mode */
html.light-mode #contact h2,
html.light-mode #contact h3 {
    color: #ffffff;
    /* white */
}

html.light-mode #contact .text-blue-400 {
    color: #60a5fa;
    /* blue-400 */
}

html.light-mode #contact a {
    color: #93c5fd;
    /* blue-300 */
}

html.light-mode #contact a:hover {
    color: #bfdbfe;
    /* blue-200 */
}

html.light-mode #contact .bg-gray-800 {
    background-color: #374151;
    /* gray-700 */
}

html.light-mode #contact .bg-gray-800:hover {
    background-color: #4b5563;
    /* gray-600 */
}


html.light-mode footer {
    background-color: #374151;
    /* gray-700 */
    color: #d1d5db;
    /* gray-300 */
}

html.light-mode footer .border-gray-700 {
    border-color: #4b5563;
    /* gray-600 */
}

/* Updated: Ensure h3 tags within footer have dark text in light mode */
html.light-mode footer h3 {
    color: #ffffff;
    /* white */
}

html.light-mode footer .bg-zinc-800 {
    background-color: #4b5563;
    /* gray-600 */
}

html.light-mode footer .bg-zinc-800 p {
    color: #e5e7eb;
    /* gray-200 */
}

html.light-mode footer .bg-zinc-800 .text-blue-300 {
    color: #93c5fd;
    /* blue-300 */
}