/* CSS Variables for Dark Theme (Default) */
:root {
    --bg-color: #000000;
    --text-color: #e0e0e0;
    --link-color: #58a6ff;
    --link-hover-color: #79c0ff;
    --border-color: #30363d;
    --heading-color: #f0f6fc;
    --subheading-color: #c9d1d9;
    --muted-color: #8b949e;
    --header-bg: #000000;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #24292f;
    --link-color: #0969da;
    --link-hover-color: #0550ae;
    --border-color: #d1d9e0;
    --heading-color: #1f2328;
    --subheading-color: #656d76;
    --muted-color: #656d76;
    --header-bg: #ffffff;
}

/* Basic Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}

/* Header - HugoBox Style */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Brand/Name on left */
.brand {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--heading-color);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand:hover {
    color: var(--link-color);
    text-decoration: none;
}

/* Navigation in center */
.nav-menu {
    display: flex;
    gap: 25px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-menu a {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-menu a:hover {
    background-color: var(--border-color);
    color: var(--heading-color);
    text-decoration: none;
}

/* Mobile Menu Toggle (hidden on desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--border-color);
}

.mobile-menu-toggle.open i::before {
    content: "\f00d"; /* Font Awesome X icon */
}

/* Mobile Navigation (hidden by default) */
.mobile-nav {
    display: none;
    flex-direction: column;
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 15px 30px;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    padding: 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s ease;
    text-align: center;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

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

/* Theme Toggle on right */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
}

.theme-toggle i {
    font-size: 1em;
}

/* Hero Section with Background */
.hero-section {
    position: relative;
    background-color: var(--bg-color);
    background-image: url('../../stacked-peaks.svg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    padding: 40px 0 60px;
    margin-bottom: 40px;
    filter: brightness(1);
}

/* Always use dark mode text colors in hero section */
.hero-section {
    color: #e0e0e0;
}

.hero-section h1,
.hero-section h2,
.hero-section h3 {
    color: #f0f6fc;
}

.hero-section .subtitle,
.hero-section .institution {
    color: #c9d1d9;
}

.hero-section a {
    color: #ffffff;
}

.hero-section a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* Interests/Education section text colors in hero */
.hero-section .two-column-section ul li::before {
    color: #58a6ff;
}

.hero-section strong {
    color: #f0f6fc;
}

/* Profile title in hero uses white colors */
.hero-section .portrait-title h3 {
    color: #ffffff;
    border-bottom: none;
}

.hero-section .portrait-title .institution a {
    color: #ffffff;
}

.hero-section .portrait-title .institution a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

.hero-section .profile-pic {
    border-color: #30363d;
}

/* Social icons in hero use HugoBox style - pure icons, no background */
.hero-section .social-icons {
    gap: 18px;
}

.hero-section .social-icon {
    background-color: transparent !important;
    background: none !important;
    color: #ffffff;
    border: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    font-size: 26px;
    padding: 0 !important;
    box-shadow: none !important;
}

.hero-section .social-icon:hover {
    color: #ffffff !important;
    transform: scale(1.15) !important;
    box-shadow: none !important;
    background-color: transparent !important;
    background: none !important;
    text-decoration: none;
}

.hero-section .social-icon i {
    display: block;
}

/* Borders in hero section use LIGHT mode colors */
.hero-section h2,
.hero-section h3 {
    border-color: #d1d9e0;
}

/* Button in hero section always uses light mode style */
.hero-section .btn-download {
    color: #24292f;
    background-color: #ffffff;
    border: 2px solid #d1d9e0;
}

.hero-section .btn-download:hover {
    background-color: #f6f8fa;
    border-color: #d1d9e0;
}

/* Main Content */
main {
    padding-top: 30px;
}

.hero-section main {
    padding-top: 0;
}

h1, h2, h3 {
    color: var(--heading-color);
    transition: color 0.3s ease, border-color 0.3s ease;
}
h1 { 
    font-size: 2em;
    margin: 10px 0;
}
h2 { 
    font-size: 1.6em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}
h3 { 
    font-size: 1.3em;
    color: var(--subheading-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Hero Layout: Narrow left (profile), Wide right (content) */
.intro-header {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 0;
}

/* Left side: Profile info only (wider for 4 icons in one line) */
.intro-photo {
    flex: 0 0 300px;
    text-align: center;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    border: 3px solid var(--border-color);
}

.portrait-title {
    margin-bottom: 15px;
}

.portrait-title h1 {
    font-size: 1.8em;
    margin: 10px 0 5px;
    border-bottom: none;
}

.portrait-title h3 {
    font-size: 1.1em;
    font-weight: 500;
    margin: 5px 0;
    border-bottom: none;
    color: var(--subheading-color);
}

.portrait-title .institution {
    font-size: 0.95em;
    color: var(--muted-color);
    margin-top: 5px;
}

.portrait-title .institution a {
    color: var(--link-color);
}

/* Social Icons - Default style (for other pages) */
.social-icons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--muted-color);
    color: var(--bg-color);
    font-size: 18px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

[data-theme="light"] .social-icon:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social-icon.email:hover { background-color: #ea4335; }
.social-icon.scholar:hover { background-color: #4285f4; }
.social-icon.github:hover { background-color: #333; }
.social-icon.linkedin:hover { background-color: #0077b5; }
.social-icon.cv:hover { background-color: #dc3545; }

/* Right side: Content (wide) */
.intro-text {
    flex: 1;
    min-width: 0;
}

.intro-text h2 {
    margin-top: 0;
}

.intro-text p {
    text-align: justify;
    margin-bottom: 20px;
}

/* Download CV Button */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-color);
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 30px;
}

.btn-download:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-download i {
    font-size: 1em;
}

/* Two Column Section INSIDE right column */
.two-column-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 15px;
}

.two-column-section h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.two-column-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.two-column-section ul li {
    padding: 4px 0;
    margin-bottom: 8px;
}

.two-column-section ul li::before {
    content: "•";
    color: var(--link-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: 0.0em;
}

/* Education List */
.education-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.education-list li {
    margin-bottom: 15px;
}

.education-list li::before {
    content: none;
}

.education-list .course {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--heading-color);
}

.education-list .institution-name {
    font-size: 0.95em;
    color: var(--muted-color);
}

/* Publication Entry Styles */
.publication-entry {
    display: flex;
    gap: 25px;
    margin-bottom: 40px;
}
.publication-image {
    flex: 1;
    max-width: 220px;
}
.publication-image img {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: border-color 0.3s ease;
}
.publication-details {
    flex: 3;
}
.publication-details h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.4em;
    border-bottom: none;
}
.publication-details .authors {
    font-style: italic;
    color: var(--muted-color);
    margin-bottom: 10px;
    transition: color 0.3s ease;
}
.publication-details .venue {
    font-weight: bold;
    margin-bottom: 15px;
}
.publication-details .links a {
    margin-right: 15px;
}

/* Timeline Styles - LinkedIn/HugoBox format */
.timeline {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 30px 0;
    margin-left: 60px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background-color: var(--border-color);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    margin-left: 0px;
}

.timeline-icon {
    position: absolute;
    left: -60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    color: #ffffff;
    font-size: 16px;
    z-index: 2;
}

.timeline-icon picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.timeline-icon img {
    width: 90%;
    height: 90%;
    border-radius: 50%;
    object-fit: cover;
}


[data-theme="dark"] .timeline-icon {
    background-color: var(--bg-color);
    border-color: var(--border-color);
}

[data-theme="light"] .timeline-icon {
    background-color: #ffffff;
    border-color: var(--border-color);
}

.timeline-content {
    background-color: transparent;
}

.timeline-content h3 {
    margin: 0 0 4px 0;
    font-size: 1.3em;
    border-bottom: none;
    color: var(--heading-color);
    padding-top: 4px;
}

.timeline-meta {
    display: block;
    margin-bottom: 2px;
}

.timeline-meta .company {
    font-weight: 600;
    color: var(--text-color);
    margin-right: 10px;
}

.timeline-meta .location {
    color: var(--muted-color);
    font-size: 0.95em;
}

.advisor {
    color: var(--subheading-color);
    font-size: 0.95em;
    font-style: italic;
    margin-bottom: 8px;
}

.timeline-date {
    display: block;
    color: var(--muted-color);
    font-size: 0.9em;
    margin-bottom: 12px;
}

.timeline-description {
    color: var(--text-color);
}

.timeline-description ul {
    margin-top: 8px;
    padding-left: 20px;
}

.timeline-description li {
    margin-bottom: 8px;
}

.timeline-description h4 {
    margin: 16px 0 8px 0;
    font-size: 1.1em;
    color: var(--heading-color);
    border-bottom: none;
}

.timeline-description h4:first-child {
    margin-top: 0;
}

.timeline-description p {
    margin: 4px 0 8px 0;
}

.timeline-description a {
    color: var(--link-color);
    text-decoration: none;
}

.timeline-description a:hover {
    text-decoration: underline;
}

/* Project Entry Styles - Publications format */
.project-entry {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.project-entry:last-child {
    border-bottom: none;
}

.project-image {
    flex-shrink: 0;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img:hover {
    transform: scale(1.05);
}

.project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-content h3 {
    margin: 0 0 4px 0;
    font-size: 1.2em;
    border-bottom: none;
    color: var(--heading-color);
}

.project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.project-date {
    color: var(--muted-color);
    font-size: 0.9em;
}

.project-category {
    color: var(--subheading-color);
    font-size: 0.9em;
    font-style: italic;
}

.project-links {
    margin-bottom: 8px;
}

.project-links a {
    color: var(--link-color);
    text-decoration: none;
    margin-right: 8px;
}

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

.project-links a:not(:last-child)::after {
    content: "";
}

.project-links a:not(:last-child) {
    margin-right: 0;
}

.project-links a:not(:last-child) + a::before {
    content: "";
}

.project-links .separator {
    color: var(--muted-color);
    margin: 0 8px;
    text-decoration: none;
    pointer-events: none;
}

.project-highlights ul {
    margin: 0;
    padding-left: 20px;
}

.project-highlights li {
    margin-bottom: 6px;
    color: var(--text-color);
}

.project-reference {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.project-reference small {
    color: var(--muted-color);
    font-size: 0.8em;
}

.project-reference a {
    color: var(--link-color);
    text-decoration: none;
}

.project-reference a:hover {
    text-decoration: underline;
}

/* Image Loading Optimizations */
.project-img,
.project-image picture,
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-color);
    cursor: pointer;
    transition: transform 0.2s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.image-modal.open {
    display: flex;
}

.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    cursor: default;
}

.image-modal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
}

.image-modal-close:hover {
    opacity: 0.7;
}

/* Experience Entry Styles (fallback) */
.experience-entry {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}
.experience-entry:last-child {
    border-bottom: none;
}
.experience-entry h3 {
    margin-bottom: 10px;
}
.experience-entry p {
    margin-bottom: 15px;
    color: var(--subheading-color);
    transition: color 0.3s ease;
}

/* Lists */
ul {
    padding-left: 20px;
}
li {
    margin-bottom: 10px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        padding: 15px 20px;
        gap: 15px;
    }
    
    /* Hide desktop menu on mobile */
    .nav-menu {
        display: none;
    }
    
    /* Show mobile menu toggle on mobile */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
    }
    
    .brand {
        order: 1;
        flex: 1;
    }
    
    .theme-toggle {
        order: 2;
    }
    
    .mobile-menu-toggle {
        order: 3;
    }
    
    .intro-header {
        flex-direction: column;
        align-items: center;
    }
    
    .intro-photo {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .intro-text {
        width: 100%;
    }
    
    .two-column-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .publication-entry {
        flex-direction: column;
    }
    
    .publication-image {
        max-width: 100%;
    }
}