/* ===================================
   Academic Website - CSS Styles
   Modern, Responsive, Professional Design
   =================================== */

/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== ACCESSIBILITY STYLES ===== */
/* Enhanced focus indicators for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    border-radius: 3px;
    position: relative;
    z-index: 10;
}

/* Ensure interactive elements are large enough for touch */
a, button, input, textarea, select {
    min-height: 44px;
}

/* Exception for inline links */
p a, li a, .hero-description a {
    min-height: auto;
}

/* Better focus for navigation links */
.nav-link:focus {
    background-color: rgba(37, 99, 235, 0.1);
    outline: 2px solid #2563eb;
    outline-offset: 4px;
}

/* Improved button focus */
.btn:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5);
    outline: none;
}

/* Social links focus */
.social-links a:focus {
    transform: scale(1.1);
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

/* Improved color contrast for better accessibility */
/* Replace very light gray with darker gray for better contrast */
.interests-label,
.section-description,
.image-caption p,
.publication-venue,
.seminar-description {
    color: #4b5563 !important; /* Darker gray for better contrast */
}

/* Ensure links have sufficient contrast */
a {
    color: #1e40af; /* Darker blue for better contrast */
}

a:hover {
    color: #1d4ed8;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --bg-color: #ffffff;
        --link-color: #0000ee;
    }
    
    body {
        color: var(--text-color);
        background-color: var(--bg-color);
    }
    
    a {
        color: var(--link-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .skip-link {
        transition: none;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-size: 16px;
}

/* Account for fixed navbar when jumping to anchors */
section[id],
h2[id],
h3[id],
.cv-section,
.publication-item {
    scroll-margin-top: 110px; /* prevent content being hidden under fixed navbar */
}

/* ===== UTILITY CLASSES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.2;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

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

.btn-secondary {
    background-color: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-secondary:hover {
    background-color: #2563eb;
    color: white;
    transform: translateY(-2px);
}

/* ===== NAVIGATION ===== */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

.nav-brand a {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: #1f2937;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #2563eb;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #1f2937;
    margin: 3px 0;
    transition: 0.3s;
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 900;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden;
}

/* ===== HERO SECTION ===== */
.hero {
    padding: clamp(80px, 12vh, 140px) 0 90px;
    background: radial-gradient(circle at top right, #e0edff, transparent 45%), linear-gradient(135deg, #f7faff 0%, #eef2ff 45%, #f9fafb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 48px;
    align-items: stretch;
}

.hero-text {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    padding: 48px;
    box-shadow: 0 35px 80px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.hero-text::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.02));
    pointer-events: none;
}

.hero-text > * {
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1f2937;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #2563eb;
    margin-bottom: 5px;
    font-weight: 600;
    text-align: left;
}

.hero-affiliation {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 20px;
    text-align: left;
}

.hero-description {
    font-size: 1.05rem;
    color: #4b5563;
    margin-bottom: 32px;
    line-height: 1.8;
    text-align: justify;
    hyphens: auto;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    justify-content: center;
}

.hero-btn {
    min-width: 180px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.hero-buttons .btn-secondary {
    background-color: #1e3a8a;
    color: white;
    border: none;
}

.hero-buttons .btn-secondary:hover {
    background-color: #0f2a6f;
    color: white;
}

.research-interests {
    margin-bottom: 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border-left: 4px solid #2563eb;
    width: 250px;
    align-self: start;
}

.research-interests h3 {
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.research-interests ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.research-interests li {
    color: #4b5563;
    font-size: 0.95rem;
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.research-interests li::before {
    content: '•';
    color: #2563eb;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: #6b7280;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 44px;
    min-height: 44px;
}

.social-links a:hover {
    background-color: #2563eb;
    color: white;
    transform: translateY(-2px);
}

.hero-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}


.hero-image picture {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image::before {
    content: '';
    position: absolute;
    width: min(360px, 78vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25), transparent 60%);
    filter: blur(0.5px);
}

.arxiv-link {
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: serif !important;
    text-decoration: none !important;
}

.profile-img {
    width: 100%;
    max-width: 340px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    object-fit: cover;
    object-position: center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    position: relative;
    z-index: 1;
}

.scroll-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: none;
    background-color: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 18px 35px rgba(37, 99, 235, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1100;
}

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

.scroll-to-top:hover {
    transform: translateY(-3px);
    background-color: #1d4ed8;
}

/* Hover effect removed for profile image */

/* ===== SECTIONS ===== */
section {
    padding: 80px 0;
}

.page-header {
    background-color: #f8fafc;
    padding: 120px 0 60px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    color: #1f2937;
    margin-bottom: 20px;
}

.page-header p {
    font-size: 1.2rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    text-align: justify;
}

h2 {
    font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
    color: #1f2937;
    margin-bottom: 20px;
    margin-top: 14px; /* increase space above section titles */
    text-align: center;
}

h3 {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem);
    color: #1f2937;
    margin-bottom: 15px;
}

/* ===== ABOUT SECTION ===== */
.about {
    background-color: white;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4b5563;
    text-align: justify;
}

.about-highlights h3 {
    color: #2563eb;
    margin-bottom: 15px;
    margin-top: 30px;
}

.about-highlights h3:first-child {
    margin-top: 0;
}

.about-highlights ul {
    list-style: none;
    margin-bottom: 30px;
}

.about-highlights li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #4b5563;
}

.about-highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
}

.news-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.news-date {
    font-weight: 600;
    color: #2563eb;
    font-size: 0.9rem;
}

.news-text {
    color: #4b5563;
    margin-top: 5px;
}

/* ===== RECENT WORK SECTION ===== */
.recent-work {
    background-color: #f8fafc;
}

.publications-preview {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.publication-item {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

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

.publication-item h3 {
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.4;
}

.authors {
    color: #6b7280;
    margin-bottom: 5px;
}

.authors strong {
    color: #2563eb;
}

.venue {
    color: #4b5563;
    font-style: italic;
    margin-bottom: 15px;
}

.publication-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.pub-link {
    padding: 8px 16px;
    background-color: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pub-link:hover {
    background-color: #2563eb;
    color: white;
}

/* ===== RESEARCH PAGE STYLES ===== */
.research-overview {
    background-color: white;
}

/* Add top padding to research page header for better spacing */
.page-header + .research-overview {
    padding-top: 20px;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.research-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.research-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
}

.research-card:hover::before {
    opacity: 1;
}

.research-card-content {
    flex: 1;
    padding: 36px 28px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.research-card-content h3 {
    margin: 0 0 30px 0;
    color: #1f2937;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    letter-spacing: -0.02em;
}

.research-card-content p {
    text-align: center;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 auto 0;
    font-size: 0.95rem;
    flex-grow: 1;
}

/* Expand button in cards */
.expand-btn {
    margin-top: auto;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.expand-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.expand-btn:hover::before {
    left: 100%;
}

.expand-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.expand-btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
    font-size: 1rem;
}

.research-card.expanded .btn-icon {
    transform: rotate(180deg);
}

/* Expanded content sections */
.expanded-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease, margin 0.3s ease;
    background-color: #f8fafc;
    border-radius: 12px;
    margin-top: 0;
}

.expanded-content.active {
    max-height: none;
    overflow: visible;
    opacity: 1;
    margin-top: 40px;
    margin-bottom: 40px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.expanded-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e5e7eb;
    background-color: white;
    border-radius: 12px 12px 0 0;
}

.expanded-header h3 {
    color: #1f2937;
    font-size: 1.5rem;
    margin: 0;
    text-align: left;
}

.close-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.close-btn:hover {
    background-color: #dc2626;
    transform: rotate(90deg);
}

.expanded-body {
    padding: 30px;
}

.expanded-description {
    margin-bottom: 30px;
}

.expanded-description p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4b5563;
    text-align: justify;
}

.expanded-explanation {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
    margin-bottom: 30px;
}

.expanded-explanation h4 {
    color: #2563eb;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: left;
}

.expanded-explanation p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #4b5563;
    text-align: justify;
    margin: 0;
}

.expanded-gif-fullwidth {
    width: 100%;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.expanded-figure-fullwidth {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile-specific expanded content sizing */
@media (max-width: 768px) {
    .expanded-gif-fullwidth {
        border-radius: 6px;
    }
    
    .expanded-figure-fullwidth {
        max-height: 400px;
        object-fit: contain;
    }
    
    .expanded-explanation p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .expanded-figure-fullwidth {
        max-height: 300px;
    }
    
    .expanded-explanation {
        padding: 18px;
    }
    
    .expanded-explanation h4 {
        font-size: 1rem;
    }
    
    .expanded-explanation p {
        font-size: 0.85rem;
    }
}

/* ===== RESEARCH IMAGES SECTION ===== */
.research-images {
    background-color: #f8fafc;
    padding: 80px 0;
}

.research-images .section-description {
    text-align: center;
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.image-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    border-bottom: 3px solid #2563eb;
}

.image-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #2563eb;
}

.image-placeholder p {
    font-size: 1rem;
    font-weight: 500;
    color: #475569;
    margin: 0;
}

.image-caption {
    padding: 20px;
}

.image-caption h4 {
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.image-caption p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.project-card p {
    text-align: justify;
    line-height: 1.6;
    color: #4b5563;
}

.publications {
    background-color: #f8fafc;
}

.publication-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background-color: white;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

.publications-list {
    display: grid;
    gap: 30px;
}

.publication-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.publication-year {
    font-weight: 700;
    color: #2563eb;
    font-size: 1.1rem;
}

.abstract {
    color: #6b7280;
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: justify;
}

.publication-metrics {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.metric {
    font-size: 0.9rem;
    color: #6b7280;
}

.publication-awards {
    margin-top: 10px;
}

.award {
    background-color: #fef3c7;
    color: #92400e;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.publication-status {
    margin-top: 10px;
}

.status {
    background-color: #e0f2fe;
    color: #0277bd;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.ongoing-projects {
    background-color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border-top: 4px solid #2563eb;
}

.project-funding {
    color: #059669;
    font-weight: 600;
    margin-bottom: 15px;
}

.project-collaborators {
    margin-top: 15px;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ===== TEACHING PAGE STYLES ===== */
.teaching-philosophy {
    background-color: white;
}

.philosophy-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: justify;
}

.current-courses {
    background-color: #f8fafc;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.course-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.course-header {
    background-color: #2563eb;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.course-header h3 {
    color: white;
    margin: 0;
}

.course-term {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.course-details {
    padding: 25px;
}

.course-level {
    color: #059669;
    font-weight: 600;
    margin-bottom: 15px;
}

.course-type {
    color: #1f2937;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 15px;
    display: block;
}

.course-description {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: justify;
    font-size: 0.95rem;
}

.course-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 0.9rem;
}

.course-info .instructors {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-info .instructors div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-info .instructors div i {
    min-width: 16px;
    margin-right: 4px;
}

.course-info .instructors div a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.course-info .instructors div a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.course-links {
    display: flex;
    gap: 10px;
}

.course-link {
    padding: 8px 16px;
    background-color: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.course-link:hover {
    background-color: #2563eb;
    color: white;
}

.past-courses {
    background-color: white;
}

.past-courses-list {
    max-width: 800px;
    margin: 0 auto;
}

.past-course-year {
    margin-bottom: 30px;
}

.past-course-year h3 {
    color: #2563eb;
    margin-bottom: 15px;
    text-align: left;
}

.past-course-item {
    display: grid;
    grid-template-columns: 2fr 1.3fr 1fr;
    gap: 20px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.course-title {
    color: #1f2937;
    font-weight: 500;
}

.course-semester {
    color: #6b7280;
}

.course-rating {
    color: #059669;
    font-weight: 600;
    text-align: right;
}

.lecturer {
    color: #6b7280;
    font-weight: 400;
    font-size: 0.85em;
    text-align: right;
    opacity: 0.8;
}

.mentoring {
    background-color: #f8fafc;
}

.mentoring-content {
    max-width: 1000px;
    margin: 0 auto;
}

.mentoring-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    text-align: center;
}

.stat-item {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2563eb;
}

.stat-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 5px;
}

.current-students,
.alumni-highlights {
    margin-bottom: 40px;
}

.current-students h3,
.alumni-highlights h3 {
    text-align: left;
    margin-bottom: 25px;
}

.students-list,
.alumni-list {
    display: grid;
    gap: 20px;
}

.student-item {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.student-item h4 {
    color: #1f2937;
    margin-bottom: 5px;
}

.student-level {
    color: #059669;
    font-weight: 600;
    margin-bottom: 8px;
}

.student-project {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Match 'Finished' line styling with thesis line in student cards */
.student-finished {
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 6px;
}

.alumni-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
}

.alumni-name {
    font-weight: 500;
    color: #1f2937;
}

.alumni-position {
    color: #6b7280;
    font-size: 0.9rem;
}

.teaching-awards {
    background-color: white;
}

.awards-list {
    max-width: 800px;
    margin: 0 auto;
}

.award-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background-color: #f8fafc;
    border-radius: 12px;
}

.award-year {
    font-weight: 700;
    color: #2563eb;
    font-size: 1.1rem;
}

.award-content h3 {
    margin-bottom: 5px;
    text-align: left;
}

.award-organization {
    color: #059669;
    font-weight: 600;
    margin-bottom: 10px;
}

.award-description {
    color: #6b7280;
    line-height: 1.6;
}

.teaching-resources {
    background-color: #f8fafc;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.resource-card {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.resource-card h3 {
    margin-bottom: 15px;
}

.resource-card p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* ===== CV PAGE STYLES ===== */
.cv-content {
    background-color: white;
}

.cv-content .container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    max-width: 1400px;
}

.cv-sidebar {
    background-color: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cv-nav h3 {
    margin-bottom: 20px;
    color: #1f2937;
    text-align: left;
}

.cv-nav ul {
    list-style: none;
}

.cv-nav li {
    margin-bottom: 10px;
}

.cv-nav a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cv-nav a:hover {
    color: #2563eb;
}

.cv-download {
    margin-top: 20px;
}

.cv-section {
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e5e7eb;
}

.cv-section:last-child {
    border-bottom: none;
}

.cv-section h2 {
    text-align: left;
    margin-bottom: 30px;
    color: #1f2937;
}

.cv-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.cv-date {
    color: #2563eb;
    font-weight: 600;
    font-size: 0.95rem;
}

.cv-content h3 {
    color: #1f2937;
    margin-bottom: 8px;
    text-align: left;
}

.cv-institution {
    color: #059669;
    font-weight: 600;
    margin-bottom: 10px;
}

.cv-details {
    color: #6b7280;
    line-height: 1.6;
    text-align: justify;
}

.cv-details ul {
    margin-top: 10px;
}

.cv-details li {
    margin-bottom: 5px;
}

.cv-subsection {
    margin-bottom: 30px;
}

.cv-subsection h3 {
    color: #2563eb;
    margin-bottom: 15px;
}

.cv-publications {
    color: #4b5563;
    line-height: 1.7;
}

.cv-publications li {
    margin-bottom: 10px;
}

.cv-note {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 20px;
}

.cv-service {
    color: #4b5563;
    line-height: 1.6;
}

.cv-service li {
    margin-bottom: 8px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-category {
    background-color: #f8fafc;
    padding: 25px;
    border-radius: 12px;
}

.skill-category h3 {
    color: #2563eb;
    margin-bottom: 15px;
    text-align: left;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 8px 0;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}

.skill-category li:last-child {
    border-bottom: none;
}

/* ===== ACADEMIC MATERIALS SECTION ===== */
.academic-materials {
    background-color: white;
    padding: 60px 0;
}

.materials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.material-section {
    overflow: visible;
    position: relative;
}

.material-section h3 {
    color: #2563eb;
    margin-bottom: 25px;
    text-align: left;
    font-size: 1.3rem;
}

.material-item {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 3px solid #e5e7eb;
}

.material-item h4 {
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 1.1rem;
    text-align: left;
}

.material-date {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.material-description {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.material-link {
    background-color: #dc2626;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.material-link:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.seminar-notes-list {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
    overflow: visible;
}

.seminar-note {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    gap: 15px;
}

.seminar-note:last-child {
    border-bottom: none;
}

.seminar-note strong {
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 500;
    flex: 1;
}

.seminar-note-hover {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    background-color: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.seminar-note-hover:last-child {
    margin-bottom: 0;
}

.seminar-note-hover:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.seminar-note-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.seminar-note-hover strong {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

.seminar-note-hover .seminar-date {
    color: #6b7280;
    font-size: 0.8rem;
    white-space: nowrap;
    font-weight: 500;
}

.seminar-pdf-btn {
    background-color: #dc2626;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.seminar-pdf-btn:hover {
    background-color: #b91c1c;
}

.seminar-details-btn {
    background-color: transparent;
    color: #2563eb;
    padding: 0;
    border: 1px solid #2563eb;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 400;
    transition: color 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
    cursor: pointer;
    display: none; /* Hidden on desktop by default */
}

.seminar-details-btn::before {
    content: '▼';
    font-size: 0.6rem;
}

.seminar-details-btn:hover {
    color: #1d4ed8;
}

.seminar-note-hover .tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4b5563;
    text-align: justify;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-width: min(600px, calc(100vw - 32px));
    pointer-events: none;
    margin-top: 5px;
}

.seminar-note-hover:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ensure MathJax renders properly in tooltips */
.seminar-note-hover .tooltip .MathJax {
    font-size: inherit !important;
}

.seminar-date {
    color: #6b7280;
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 500;
}

.material-note {
    margin-top: 15px;
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .material-section h3 {
        display: none;
    }
    
    .seminar-note {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .seminar-note-hover {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        cursor: pointer;
    }

    .seminar-note-hover::after {
        content: '';
        display: none;
    }

    .seminar-note-hover.open::after {
        content: '';
        display: none;
    }

    /* Position PDF and Details buttons side by side on mobile */
    .seminar-note-hover > a.seminar-pdf-btn,
    .seminar-note-hover > button.seminar-details-btn {
        flex: 1;
        text-align: center;
    }

    /* Create a flex wrapper for the buttons */
    .seminar-note-hover {
        display: flex;
        flex-direction: column;
        gap: 10px;
        cursor: pointer;
    }

    .seminar-note-hover::after {
        content: '';
        display: none;
    }

    .seminar-note-hover.open::after {
        content: '';
        display: none;
    }

    /* Create button container wrapper for flex layout */
    .seminar-note-content {
        gap: 3px;
    }

    /* Button container - flex row to place side by side */
    .seminar-buttons-container {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
        align-items: center;
        width: 100%;
    }

    .seminar-pdf-btn {
        flex: 0 0 33%;
        min-width: auto;
        font-size: 0.8rem;
        padding: 3px 6px;
        text-align: center;
    }

    .seminar-details-btn {
        display: inline-flex !important;
        flex: 0 0 67%;
        min-width: auto;
        font-size: 0.8rem;
        padding: 4px 8px;
        justify-content: center;
    }

    .seminar-note-hover .seminar-date {
        white-space: normal;
    }

    .seminar-note-hover .tooltip {
        position: static;
        max-width: 100%;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
        padding: 0;
        margin-top: 0;
    }

    .seminar-note-hover.open .tooltip {
        opacity: 1;
        visibility: visible;
        max-height: 1500px;
        padding: 10px;
        margin-top: 8px;
        pointer-events: auto;
    }
}

/* ===== CONTACT PAGE STYLES ===== */
.contact-content {
    background-color: white;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.contact-info-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.map-column {
    display: flex;
    flex-direction: column;
}

.contact-item {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.contact-item.map-section {
    height: 100%;
    min-height: 400px;
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.contact-header i {
    color: #2563eb;
    font-size: 1.3rem;
    min-width: 20px;
}

.contact-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.contact-item p {
    margin-bottom: 5px;
    color: #4b5563;
    line-height: 1.6;
}

.contact-item a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.map-container {
    margin-top: 15px;
    height: 100%;
    min-height: 300px;
}

.map-placeholder {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #64748b;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.map-placeholder i {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 15px;
    display: block;
}

.map-placeholder p {
    margin: 8px 0;
    font-weight: 500;
}

.map-note {
    font-size: 0.9rem;
    color: #94a3b8;
    font-style: italic;
}

.contact-methods {
    margin: 30px 0;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-method i {
    color: #2563eb;
    font-size: 1.5rem;
    margin-top: 5px;
    min-width: 30px;
}

.contact-method h3 {
    margin-bottom: 8px;
    text-align: left;
}

.contact-method p {
    margin-bottom: 5px;
    color: #4b5563;
    text-align: justify;
}

.contact-note {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
    text-align: justify;
}

.social-connect {
    margin-top: 40px;
}

.social-links-detailed {
    display: grid;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: #2563eb;
    color: white;
}

.social-link i {
    width: 20px;
    text-align: center;
}

.contact-form {
    background-color: #f8fafc;
    padding: 40px;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    line-height: 1.5;
}

.form-note {
    background-color: #fef3c7;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #f59e0b;
}

.form-note p {
    color: #92400e;
    margin-bottom: 10px;
}

.form-note ul {
    color: #92400e;
    margin-left: 20px;
}

.location-map {
    background-color: #f8fafc;
}

.map-container {
    margin-bottom: 30px;
}

.map-placeholder {
    background-color: #e5e7eb;
    height: 300px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.map-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.map-note {
    font-size: 0.9rem;
    font-style: italic;
}

.location-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.location-info h3 {
    color: #2563eb;
    margin-bottom: 15px;
    text-align: left;
}

.location-info ul {
    list-style: none;
    color: #4b5563;
}

.location-info li {
    padding: 5px 0;
}

.collaboration {
    background-color: white;
}

.collaboration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.collaboration-item {
    background-color: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.collaboration-item h3 {
    color: #2563eb;
    margin-bottom: 15px;
}

.collaboration-item p {
    color: #6b7280;
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #1f2937;
    color: #9ca3af;
    text-align: center;
    padding: 40px 0;
}

.footer p {
    margin-bottom: 5px;
}

/* ===== TEXT JUSTIFICATION RULES ===== */
/* General paragraph justification where appropriate */
.section p:not(.material-note):not(.contact-note):not(.authors):not(.venue):not(.project-funding):not(.material-date) {
    text-align: justify;
}

/* Specifically ensure seminar descriptions in tooltips are justified */
    .material-description {
        text-align: justify;
        line-height: 1.6;
        font-size: 0.9rem;
    }

    /* ===== RESPONSIVE DESIGN ===== */
    @media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Global spacing & typography tweaks */
    .container {
        padding: 0 16px;
    }

    section {
        padding: 40px 0;
    }

    .page-header {
        padding: 100px 0 20px;
    }

    /* Tighten space below header */
    .page-header + section {
        padding-top: 16px;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 14px;
        margin-top: 14px;
    }

    h3 {
        font-size: 1.1rem;
    }

    .page-header p {
        font-size: 0.95rem;
        text-align: justify;
        line-height: 1.6;
        margin-top: 0;
    }

    .navbar {
        padding: 10px 0;
    }

    .navbar.scrolled {
        padding: 8px 0;
    }

    .nav-brand a {
        font-size: 18px;
    }

    .nav-menu {
        position: fixed;
        inset: 0;
        top: 0;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.96);
        backdrop-filter: blur(12px);
        width: 100%;
        height: 100vh;
        text-align: left;
        transition: transform 0.35s ease;
        padding: 110px 32px 48px;
        z-index: 1000;
        gap: 10px;
        transform: translateY(-100%);
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu a {
        padding: 12px 0;
        display: block;
        min-height: auto;
        line-height: 1.4;
        font-size: 1.05rem;
        color: #e2e8f0;
        border-bottom: 1px solid rgba(248, 250, 252, 0.15);
        width: 100%;
    }

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

    .nav-menu .nav-link.active {
        color: #93c5fd;
    }

    .nav-toggle {
        display: flex;
        padding: 6px;
        border-radius: 4px;
        transition: background-color 0.3s ease;
        position: relative;
        z-index: 1201;
    }

    .nav-toggle:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }

    .bar {
        width: 22px;
        height: 2px;
        transition: all 0.3s ease;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .hero {
        padding: 90px 0 56px;
        min-height: auto;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        gap: 24px;
        text-align: left;
        align-items: center;
    }

    .hero-image {
        order: -1;
        width: auto;
        max-width: min(360px, 80vw);
        margin: 0 auto 12px;
        align-self: center;
    }

    .hero-text {
        padding: 28px 24px;
    }

    .hero-text h1 {
        font-size: 1.9rem;
        margin-bottom: 10px;
    }

    .hero-text .hero-description {
        text-align: justify;
        line-height: 1.6;
        font-size: 0.95rem;
    }

    .hero-image {
        margin: 24px auto 24px;
        justify-content: center;
        align-self: center;
    }

    .hero-buttons {
        justify-content: center;
        gap: 12px;
    }

    .social-links {
        gap: 10px;
        margin-top: 12px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .social-links a {
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }

    .scroll-to-top {
        display: none !important;
    }

    .research-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .research-card-content {
        padding: 20px 16px 16px;
        min-height: auto;
    }

    .research-card-content h3 {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }

    .expand-btn {
        padding: 10px 16px;
        font-size: 0.875rem;
        margin-top: 12px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .cv-content .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cv-sidebar {
        position: static;
        order: 2;
    }

    .cv-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-left: 15px;
        border-left: 3px solid #2563eb;
        position: relative;
    }

    .cv-date {
        margin-top: 0;
        font-size: 0.85rem;
        display: inline-block;
        background-color: #e0f2fe;
        color: #0369a1;
        padding: 4px 12px;
        border-radius: 12px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .cv-content h3 {
        margin-bottom: 6px;
        margin-top: 4px;
    }

    .publication-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }

    .publication-item h3 {
        font-size: 1.1rem;
    }

    .authors {
        font-size: 0.9rem;
    }

    .venue {
        font-size: 0.85rem;
    }

    .abstract, .publication-abstract {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .publication-item .abstract {
        text-align: justify;
    }

    .publication-links {
        gap: 10px;
        flex-wrap: wrap;
    }

    .pub-link {
        font-size: 0.85rem;
        padding: 10px 14px;
        flex: 1 1 auto;
        min-width: 100px;
    }

    .past-course-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .course-rating {
        text-align: left;
    }

    .lecturer {
        text-align: left;
    }

    .location-details {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .mentoring-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-item {
        padding: 25px;
    }

    .contact-item.map-section {
        min-height: 300px;
    }

    /* Responsive styles for expanded content */
    .expanded-header {
        padding: 16px;
    }

    .close-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .expanded-content.active {
        margin-top: 16px;
        margin-bottom: 16px;
    }

    .expanded-header h3 {
        font-size: 1.15rem;
        margin-bottom: 8px;
    }

    .expanded-body {
        padding: 16px;
    }

    .expanded-explanation {
        padding: 16px;
        margin-bottom: 16px;
    }

    .expanded-explanation h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .expanded-explanation p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .skill-category {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 12px;
    }

    section {
        padding: 30px 0;
    }

    .hero {
        padding: 76px 0 40px;
    }

    .page-header {
        padding: 100px 0 16px;
    }

    /* Reduce gap between header and following section on small phones */
    .page-header + section {
        padding-top: 12px;
    }

    .hero-text {
        padding: 22px 18px;
    }

    .hero-text h1 {
        font-size: 1.45rem;
        line-height: 1.25;
        margin-bottom: 8px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .hero-affiliation {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .hero-text .hero-description {
        font-size: 0.88rem;
        line-height: 1.55;
        margin-bottom: 16px;
        text-align: justify;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 16px;
    }

    h3 {
        font-size: 1.05rem;
    }

    p, li, .publication-abstract, .research-card-content p {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .page-header p {
        font-size: 0.875rem;
        text-align: justify;
        line-height: 1.5;
        margin-top: 0;
    }

    .profile-img {
        max-width: 200px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .hero-buttons {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        margin-top: 8px;
    }

    .hero-buttons .btn {
        flex: 1 1 45%;
        min-width: 0;
    }

    .social-links {
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }

    .social-links a {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .research-card-content {
        padding: 14px 12px 12px;
    }

    .research-card-content h3 {
        font-size: 1rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .expand-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.8rem;
        min-height: 40px;
    }

    /* Expanded content - compact on small phones */
    .expanded-content.active {
        margin-top: 12px;
        margin-bottom: 12px;
    }

    .expanded-header {
        padding: 12px;
    }

    .expanded-header h3 {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .expanded-body {
        padding: 12px;
    }

    .expanded-description {
        margin-bottom: 12px;
    }

    .expanded-description p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .expanded-explanation {
        padding: 12px;
        margin-bottom: 12px;
    }

    .expanded-explanation h4 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .expanded-explanation p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .publication-filters {
        gap: 8px;
        margin-bottom: 16px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .courses-grid,
    .projects-grid,
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .course-type {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .course-description {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .contact-form {
        padding: 18px;
    }

    /* Make lists more compact on small screens */
    .cv-details li,
    .cv-service li,
    .past-courses li {
        margin-bottom: 3px;
        font-size: 0.875rem;
    }

    .publication-item {
        padding: 14px;
        margin-bottom: 12px;
    }

    .publication-header h3 {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .pub-meta {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .authors {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .venue {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .abstract, .publication-abstract {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .pub-link {
        font-size: 0.75rem;
        padding: 7px 12px;
    }

    .publication-links {
        gap: 8px;
        flex-wrap: wrap;
    }
}

    /* ===== ULTRA-SMALL SCREENS (360px and below) ===== */
    @media (max-width: 360px) {
        body {
            font-size: 13px;
        }

        .container {
            padding: 0 10px;
        }

        section {
            padding: 25px 0;
        }

        .page-header {
            padding: 100px 0 14px;
        }

        /* Tighten gap for ultra-small screens */
        .page-header + section {
            padding-top: 10px;
        }

    .hero {
        padding: 70px 0 32px;
    }

    .hero-text h1 {
        font-size: 1.28rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }

        .page-header h1 {
            font-size: 1.3rem;
        }

        h2 {
            font-size: 1.2rem;
            margin-bottom: 12px;
        }

        h3 {
            font-size: 1rem;
        }

        p, li {
            font-size: 0.85rem;
        }

        .page-header p {
            font-size: 0.85rem;
            text-align: justify;
            margin-top: 0;
        }

        .profile-img {
            max-width: 170px;
        }

        .btn {
            padding: 7px 12px;
            font-size: 0.8rem;
        }

        .research-grid {
            gap: 10px;
        }

        .research-card-content {
            padding: 14px 10px 10px;
        }

        .research-card-content h3 {
            font-size: 0.95rem;
            margin-bottom: 6px;
            line-height: 1.25;
        }

        .expand-btn {
            padding: 8px 12px;
            font-size: 0.75rem;
            min-height: 36px;
        }

        .expanded-header {
            padding: 10px;
        }

        .expanded-header h3 {
            font-size: 0.95rem;
            margin-bottom: 4px;
        }

        .expanded-body {
            padding: 10px;
        }

        .expanded-description {
            margin-bottom: 10px;
        }

        .expanded-description p {
            font-size: 0.8rem;
            line-height: 1.5;
        }

        .expanded-explanation {
            padding: 10px;
            margin-bottom: 10px;
        }

        .expanded-explanation h4 {
            font-size: 0.85rem;
            margin-bottom: 4px;
        }

        .expanded-explanation p {
            font-size: 0.8rem;
            line-height: 1.5;
        }

        .publication-item {
            padding: 12px;
        }

        .pub-link {
            font-size: 0.75rem;
            padding: 7px 10px;
        }

        .expanded-header {
            padding: 16px;
        }

        .expanded-body {
            padding: 16px;
        }

        .close-btn {
            width: 40px;
            height: 40px;
            font-size: 1rem;
        }

        .social-links a {
            width: 40px;
            height: 40px;
            font-size: 0.9rem;
        }

        .hero-buttons {
            gap: 10px;
        }

        .contact-item {
            padding: 20px;
        }

        .skill-category {
            padding: 16px;
        }
    }

/* ===== FULLSCREEN VIDEO MODAL ===== */
.video-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.8);
}

.video-modal-video {
    width: 100%;
    height: auto;
    display: block;
}

.video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
}

.video-modal-close:hover {
    background-color: #fff;
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Make expanded videos clickable for fullscreen */
.expanded-figure-fullwidth {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.expanded-figure-fullwidth:hover {
    opacity: 0.8;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.publication-item,
.course-card,
.research-card,
.project-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-buttons,
    .social-links,
    .cv-download,
    .contact-form,
    .footer {
        display: none;
    }

    .hero {
        padding: 20px 0;
        min-height: auto;
    }

    .cv-content .container {
        grid-template-columns: 1fr;
    }

    .cv-sidebar {
        display: none;
    }

    section {
        padding: 20px 0;
    }

    .page-header {
        padding: 40px 0 20px;
    }
}
