/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #f0ee73;
    --primary-dark: #e8e654;
    --primary-light: #f5f299;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --hero-gradient-start: #fffef5;
    --hero-gradient-end: #fefce0;
    --navbar-bg: #ffffff;
    --footer-bg: #ffffff;
    --link-color: #0066cc;
    --link-hover: #0052a3;
}

[data-theme="dark"] {
    --primary: #f0ee73;
    --primary-dark: #f5f299;
    --primary-light: #f8f5b3;
    --text-dark: #f1f5f9;
    --text-medium: #cbd5e1;
    --text-light: #94a3b8;
    --bg-light: #1e293b;
    --bg-white: #0f172a;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --hero-gradient-start: #1e293b;
    --hero-gradient-end: #334155;
    --navbar-bg: #1e293b;
    --footer-bg: #1e293b;
    --link-color: #5b9dd9;
    --link-hover: #7bb4e8;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    border-bottom: 3px solid var(--primary);
    z-index: 1000;
    padding: 0.75rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: auto;
    height: auto;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-left: 1rem;
    position: relative;
    z-index: 30;
}

[data-theme="dark"] .nav-brand {
    color: var(--primary);
}

/* Logo Container */
.nav-logo-top {
    position: absolute;
    left: 20px;
    top: -5px;
    z-index: 35;
    pointer-events: auto;
}

.nav-home-link {
    display: block;
    text-decoration: none;
}

.logo-img {
    width: 130px;
    height: 130px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.nav-home-link:hover .logo-img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 30;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

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

.nav-links a.active {
    color: var(--text-dark);
    font-weight: 700;
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
    color: var(--primary);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

[data-theme="dark"] .hamburger span {
    background-color: var(--primary);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-light);
    border-color: var(--primary);
}

.theme-toggle .sun {
    display: inline;
}

.theme-toggle .moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon {
    display: inline;
}

/* Main Content Section */
.main-content {
    padding: 3rem 0 2rem;
}

.about-box {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.about-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.about-box p {
    color: var(--text-medium);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* Improve bullet indentation and spacing inside the about box */
.about-box ul {
    margin: 0.5rem 0 1rem 1.25rem; /* top, right, bottom, left */
    padding-left: 1rem; /* ensure bullets are indented from container */
}

.about-box ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.about-box ul li ul {
    margin-top: 0.25rem;
    margin-left: 1rem; /* further indent nested lists */
}

.about-box a {
    color: var(--link-color);
    text-decoration: underline;
}

.about-box a:hover {
    color: var(--link-hover);
}

.education {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9375rem;
}

/* Bottom Row */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.publications-box,
.contact-box {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.publications-box h3,
.contact-box h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.contact-box p {
    font-size: 0.9375rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.pub-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pub-links a {
    padding: 0.5rem 1rem;
    background-color: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.pub-links a:hover {
    background-color: var(--primary);
    color: #1e293b;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(240, 238, 115, 0.4);
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: var(--text-dark);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 3px solid var(--primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .footer {
    color: var(--text-medium);
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

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

.footer-follow {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.follow-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.footer-follow a {
    color: var(--link-color);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-follow a:hover {
    text-decoration: underline;
}

.footer-name {
    font-size: 0.875rem;
    color: var(--text-medium);
    margin-top: 1rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 968px) {
    .bottom-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1105px) {

    /* Adjust logo size for smaller screens */
    .nav-logo-top {
        left: 15px;
    }

    .logo-img {
        width: 110px;
        height: 110px;
    }

    /* Show hamburger menu */
    .hamburger {
        display: flex;
        position: relative;
        z-index: 30;
        margin-left: auto;
    }

    /* Hide and transform nav-links for mobile menu */
    .nav-links {
        position: fixed;
        top: 55px;
        right: 0;
        width: 100%;
        max-width: 300px;
        background-color: var(--navbar-bg);
        border-left: 3px solid var(--primary);
        border-bottom: 3px solid var(--primary);
        box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: none;
    }

    /* Only apply transition after page load */
    .nav-links.nav-ready {
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        transform: translateX(0);
        padding-top: 2.5rem;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.0625rem;
    }

    .theme-toggle {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {

    /* Further reduce logo size on mobile */
    .nav-logo-top {
        left: 10px;
    }

    .logo-img {
        width: 90px;
        height: 90px;
    }

    .nav-brand {
        font-size: 1rem;
        margin-left: 0.75rem;
    }

    .main-content {
        padding: 2rem 0 1.5rem;
    }

    .about-box,
    .publications-box,
    .contact-box {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .pub-links a {
        font-size: 0.8125rem;
        padding: 0.4rem 0.75rem;
    }

    .nav-links {
        max-width: 100%;
        border-left: none;
    }
}