/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --border-color: #dee2e6;
}

/* Dark mode palette */
body.dark-mode {
    --primary-color: #0f172a;
    --secondary-color: #60a5fa;
    --accent-color: #f97373;
    --text-color: #e5e7eb;
    --light-bg: #020617;
    --white: #020617;
    --gray: #9ca3af;
    --border-color: #1f2937;
    background-color: var(--white);
    color: var(--text-color);
}

body {
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    scroll-behavior: smooth;
}

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    padding: 0.5rem 0;
}

.nav-menu a:hover,
.nav-menu a.cv-link:hover {
    color: var(--secondary-color);
}

.nav-menu .cv-link {
    background-color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu .cv-link:hover {
    background-color: #2980b9;
    color: var(--white);
}

/* Theme toggle button in nav */
.theme-toggle-btn {
    border: 1px solid rgba(255,255,255,0.5);
    background: transparent;
    color: var(--white);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.theme-toggle-btn i {
    font-size: 0.9rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 4px solid var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* --- START NEW HERO HEADER STYLES --- */
/* Style for the Role (h2) */
.hero .main-role {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem; /* Space between role and university */
    color: #ecf0f1;
}

/* Style for the University (p) */
.hero .main-university {
    font-size: 1.3rem; /* Slightly smaller than role */
    font-weight: 400;
    margin-bottom: 1rem; /* Space below university before tagline */
    color: #b9c1c9; 
    /* The p tag is a block element by default, which enforces the line break. */
}
/* --- END NEW HERO HEADER STYLES --- */

.tagline {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #d0d7de;
}

.hero-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0 2rem 0;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-size: 1.5rem;
}

.social-links a {
    color: var(--white);
    transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
    color: var(--secondary-color);
    transform: translateY(-3px);
}

/* Sections */
.section {
    padding: 4rem 0;
}

.bg-light {
    background-color: var(--light-bg);
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
}

.subsection-title {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin: 2.5rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* About Section */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-content p {
    margin-bottom: 1.3rem;
}

/* Education Section */
.education-container {
    max-width: 900px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.education-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.education-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    min-width: 60px;
    text-align: center;
}

.education-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.education-institution {
    color: var(--gray);
    font-style: italic;
    margin-bottom: 0.3rem;
}

.education-period {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Research Grid */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.research-card {
    background: var(--white);
    padding: 1.6rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.research-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
}

.research-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.research-card p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* Publications Section */
.publications-container {
    max-width: 900px;
    margin: 0 auto;
}

.pub-category {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 2rem 0 1.2rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.publication {
    margin-bottom: 1.8rem;
    padding: 1.4rem;
    background: var(--white);
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 4px;
    transition: box-shadow 0.3s;
}

.publication:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.publication h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.publication h4 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.publication h4 a:hover {
    color: var(--secondary-color);
}

.pub-authors {
    color: var(--gray);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.pub-journal {
    color: var(--text-color);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.pub-abstract {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.4rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.pub-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    font-size: 0.95rem;
}

.pub-link:hover {
    text-decoration: underline;
}

/* BibTeX details */
.publication details {
    margin-top: 0.4rem;
}

.publication details summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.publication pre {
    background: #f5f5f5;
    padding: 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Presentations Section */
.presentations-container {
    max-width: 900px;
    margin: 0 auto;
}

.presentation-year {
    margin-bottom: 2.5rem;
}

.presentation-year h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1.1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--secondary-color);
}

.presentation-item {
    margin-bottom: 1.6rem;
    padding: 1.3rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.presentation-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.presentation-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
    line-height: 1.4;
}

.presentation-venue {
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.presentation-location {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.presentation-location i {
    margin-right: 0.3rem;
}

/* Teaching Section */
.teaching-item {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.teaching-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
}

.teaching-institution {
    color: var(--gray);
    font-style: italic;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.teaching-period {
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.teaching-item ul {
    margin-left: 1.5rem;
}

.teaching-item li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

/* Teaching Interests */
.teaching-interests {
    max-width: 800px;
    margin: 0 auto;
}

.interest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.3rem;
    margin-top: 1.3rem;
}

.interest-item {
    background: var(--white);
    padding: 1.3rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.interest-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.interest-item i {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.4rem;
}

.interest-item p {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Blog Section */
.blog-intro {
    text-align: center;
    font-size: 1rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.8rem;
    max-width: 1000px;
    margin: 0 auto;
}

.blog-card {
    background: var(--white);
    padding: 1.6rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.blog-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.blog-date i {
    margin-right: 0.3rem;
}

.blog-card h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.blog-excerpt {
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 0.95rem;
}

.blog-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.3s;
    font-size: 0.95rem;
}

.blog-link:hover {
    gap: 0.6rem;
}

.blog-link-disabled {
    color: var(--gray);
    cursor: default;
    opacity: 0.7;
}

/* Contact Section */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    padding: 1.4rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.contact-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.contact-item i {
    font-size: 2rem;
    color: var(--secondary-color);
    min-width: 50px;
    text-align: center;
}

.contact-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.contact-item a {
    color: var(--secondary-color);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.3rem;
}
/* Single row for teaching interests */
.interest-grid-single-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.interest-item-compact {
    background: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.interest-item-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.interest-item-compact i {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.interest-item-compact span {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 968px) {
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-menu li {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 500px;
        margin-top: 0.8rem;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: left;
        padding: 0.3rem 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 0.4rem 0;
    }

    .theme-toggle-btn {
        margin-top: 0.5rem;
        align-self: flex-start;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    /* Responsive adjustment for new header structure */
    .hero .main-role {
        font-size: 1.2rem;
        margin-bottom: 0.3rem; /* Adjusted for mobile view */
    }
    
    .hero .main-university {
        font-size: 1.1rem;
        margin-bottom: 0.8rem; /* Adjusted for mobile view */
    }
    
    .section-title {
        font-size: 1.9rem;
    }
    
    .hero-links {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 260px;
        justify-content: center;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
    
    .education-item {
        flex-direction: column;
        text-align: center;
    }
    
    .education-icon {
        margin: 0 auto;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .interest-grid {
        grid-template-columns: 1fr;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 0;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .profile-photo {
        width: 150px;
        height: 150px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .social-links {
        gap: 1rem;
        font-size: 1.3rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .back-to-top,
    .mobile-menu-toggle,
    .hero-links,
    .social-links {
        display: none;
    }
    
    .section {
        page-break-inside: avoid;
    }
}
