:root {
  /* Light theme colors */
  --bg-color: #ffffff;
  --text-color: #24292e;
  --text-secondary: #586069;
  --text-muted: #666;
  --border-color: #e1e4e8;
  --border-light: #eaecef;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --card-bg: #f6f8fa;
  --card-hover: #eaecef;
  --link-color: #00749c;
  --link-hover: #0366d6;
  --accent-color: #d4691b;
  --shadow: rgba(0, 0, 0, 0.12);
  --shadow-hover: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  /* Dark theme colors */
  --bg-color: #0d1117;
  --text-color: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #7d8590;
  --border-color: #30363d;
  --border-light: #21262d;
  --nav-bg: rgba(13, 17, 23, 0.8);
  --card-bg: #161b22;
  --card-hover: #21262d;
  --link-color: #58a6ff;
  --link-hover: #79c0ff;
  --accent-color: #f85149;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.4);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
  display: flex;
  gap: 25px;
  margin-bottom: 50px;
}

.profile-img {
  width: 120px;
  height: auto;
  border-radius: 20%;
  border: 4px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  transform: scale(1.15); /* Zoom in by 20% */
}

.header-content h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

h1 .first-name {
  font-weight: 400;
}

h1 .last-name {
  font-weight: 600;
}

h1 .pronunciation {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: normal;
  margin-left: 8px;
}

.header-content p,
.content p {
  margin: 0;
  color: var(--text-color);
  /* color: #586069; */
  font-size: 16px;
}

.header-content p a,
.content p a {
  color: var(--link-color);
  /* color: #444; */
  font-weight: 500;
  transition: color 0.2s;
  border-bottom: 1px dotted var(--text-muted);
}

.header-content p a:hover,
.content p a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

.role {
  margin-top: 2px !important;
}

.previous {
  color: var(--text-muted) !important;
}

.writing-info {
  margin-top: 12px !important;
}

a {
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
}

a:hover {
  color: #0366d6;
  border-bottom-color: #0366d6;
}

.social-links {
  margin-top: 12px;
}

.social-links a {
  color: var(--text-secondary);
  margin-right: 2px;
  font-size: 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-links a:hover {
  color: var(--text-color);
  text-decoration: none;
}

.social-icon {
  width: 12px;
  height: 12px;
}

h1,
.header-content h1 {
  font-size: 24px;
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--text-color);
}

h2 {
  font-size: 20px;
  margin: 40px 0 20px;
  font-weight: 600;
  color: var(--text-color);
}

h3 {
  font-size: 18px;
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text-color);
}

.view-all {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: normal;
}

.project {
  margin-bottom: 25px;
}

.project p {
  margin: 0;
  color: #586069;
  font-size: 14px;
  line-height: 1.5;
}

.stats {
  color: #586069;
  font-size: 14px;
}

.stats strong {
  color: #24292e;
  font-weight: 600;
}

/* Link-style buttons with arrows */
.link-button::after,
.view-all::after,
.show-arrow::after {
  content: " →";
}

/* Link-style buttons */
.link-button,
.view-all {
  background: none;
  border-radius: 0;
  padding: 0;
  margin-right: 0;
  color: #586069;
  font-size: 14px;
  font-weight: normal;
  text-decoration: none;
  border-bottom: 1px dotted #666;
  cursor: pointer;
}

.link-button:hover,
.view-all:hover {
  color: #0366d6;
  border-bottom-color: #0366d6;
  background: none;
}

img {
  max-width: 150px;
}

p {
  margin: 0.5em 0;
}

.navigation a {
  color: black;
  margin-right: 10px;
}

em {
  font-style: italic;
}

/* News list styles */
.news-list {
  margin: 20px 0;
}

.news-item {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.news-date {
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 100px;
}

.news-content {
  color: var(--text-color);
  font-size: 15px;
  line-height: 1.5;
}

.news-list .news-content a {
  color: var(--link-color) !important;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dotted var(--link-color);
}

.hidden {
  display: none;
}

/* Publication styles */
.publication {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.pub-thumbnail {
  width: 140px;
  display: flex;
  align-items: center;
}

.pub-thumbnail img {
  width: auto;
  max-width: 140px;
  height: auto;
  max-height: 105px;
  border-radius: 4px;
}

.publication h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.publication-title-link {
  color: var(--text-color);
  text-decoration-color: var(--link-hover);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.publication-title-link:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
  text-decoration-thickness: 2px;
}

.publication .authors,
.publication .venue,
.teaching-meta,
.news-content {
  font-size: 14px;
  color: var(--text-secondary);
}

.pub-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  margin-right: 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
}

/* Common button styling matching navbar */
.pub-links a,
.bibtex-btn,
.tab-button {
  display: inline-block;
  padding: 6px 12px;
  margin-right: 8px;
  background: var(--card-bg);
  border-radius: 6px;
  border: none;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.pub-links a:hover,
.bibtex-btn:hover,
.tab-button:hover {
  color: var(--text-color);
  background: var(--card-hover);
  text-decoration: none;
}

.tab-button.active {
  color: #24292e;
  font-weight: 600;
  background: #f6f8fa;
  position: relative;
  z-index: 1;
}

/* Copy icon */
.copy-icon {
  width: 14px;
  height: 14px;
}

.pub-content {
  position: relative; /* For absolute positioning of bibtex-content */
  flex: 1;
}

/* Award styling */
.award {
  margin: 6px 0 0 0 !important;
  font-size: 13px !important;
  color: var(--accent-color) !important;
  font-style: normal !important;
  font-weight: bold !important;
}

/* Theme toggle button */
.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  margin-left: 15px;
  z-index: 1001;
  position: relative;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--card-hover);
  color: var(--text-color);
}

.theme-toggle i {
  font-size: 14px;
}

/* Navbar styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(5px);
  z-index: 1000;
}

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

.nav-links {
  display: flex;
  gap: 25px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 15px;
  padding: 4px 8px;
  background: var(--card-bg);
  border-radius: 6px;
  transition: background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--card-hover);
  text-decoration: none;
}

/* Adjust main content to account for fixed navbar */
.content {
  margin-top: 80px;
}

/* Adjust header margin */
.header {
  margin-bottom: 40px;
}

.footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer .social-links {
  margin-top: 0;
  margin-left: auto;
}

.footer a {
  color: #666;
}

.footer a:hover {
  color: #0366d6;
}

/* Publications page styles */
.publications-header {
  margin-bottom: 40px;
}

.year-divider {
  font-size: 20px;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eaecef;
}

.publications-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Home page publication title */
.publication h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

/* Research Overview styles */
.research-topics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 40px;
}

.topic-card {
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  border: 1px solid #eaecef;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.topic-card.active {
  border-color: #0366d6;
  background: #f1f8ff;
}

.topic-card h3 {
  margin: 0 0 10px 0;
  color: var(--text-color);
}

.topic-card p {
  margin: 0;
  color: #586069;
  font-size: 14px;
  line-height: 1.5;
}

.topic-count {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 14px;
  color: #586069;
}

.topic-card.active .topic-count {
  background: #0366d6;
  color: white;
  border-color: #0366d6;
}

/* Hide publications that don't match the selected topic */
.publication.hidden {
  display: none;
}

/* Teaching page styles */
.teaching-list {
  margin: 20px 0 40px;
}

.teaching-item {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.teaching-item-content {
  flex: 1;
}

.teaching-item h3 {
  display: inline;
  font-size: 16px;
  margin: 0;
  font-weight: 600;
  color: var(--text-color);
}

.teaching-meta {
  color: #586069;
  font-size: 14px;
  margin-left: 8px;
}

.teaching-links {
  margin: 0;
  white-space: nowrap;
}

.teaching-links a {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 8px;
  font-size: 14px;
  color: #24292e;
  background: #f6f8fa;
  border: none;
  border-radius: 6px;
  text-decoration: none;
}

@media (max-width: 600px) {
  .teaching-item {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .teaching-meta {
    display: block;
    margin: 4px 0 0 0;
  }

  .teaching-links {
    margin-top: 8px;
  }
}

/* People page styles */
.people-intro {
  color: #586069;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.highlight-tag {
  color: #0366d6;
  cursor: pointer;
  transition: color 0.2s;
}

.highlight-tag:hover {
  color: #044289;
  text-decoration: underline;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.person-link {
  text-decoration: none;
  transition: all 0.3s ease;
  opacity: 1;
}

/* Default state - all items visible */
.people-grid:not(.filtering) .person-link {
  opacity: 1;
}

/* Simple hover effect - dim others when hovering any item */
.people-grid:not(.filtering):hover .person-link {
  opacity: 0.5;
}

.people-grid:not(.filtering):hover .person-link:hover {
  opacity: 1;
}

/* Scale effect on hover */
.person-link:hover .person {
  transform: scale(1.05);
}

/* When filtering, dim unmatched items */
.people-grid.filtering .person-link:not(.highlight) {
  opacity: 0.2;
}

.person {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease;
}

.person img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .people-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px;
  }

  .person {
    width: 80px;
    height: 80px;
  }
}


/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
}

.menu-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #24292e;
  margin: 4px 0;
  transition: 0.3s;
}

/* Responsive navbar */
@media (max-width: 600px) {
  .menu-toggle {
    display: block;
  }

  .theme-toggle {
    margin-left: 10px;
    padding: 6px 8px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-bg);
    padding: 20px;
    gap: 15px;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 4px 6px var(--shadow);
  }

  .nav-links.active {
    display: flex;
  }

  /* Animate hamburger to X */
  .menu-toggle.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

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

  .menu-toggle.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}

/* Special cases where we don't want borders */
.nav-links a,
.social-links a,
.pub-links a,
.pub-thumbnail a,
.person-link {
  border-bottom: none;
}

.name-info {
  font-size: 14px;
  color: #24292e;
  margin-left: 8px;
  padding: 2px 8px;
  background: #f6f8fa;
  border-radius: 6px;
  border-bottom: none;
  transition: background 0.2s;
}

.name-info:hover {
  background: #eaecef;
  text-decoration: none;
}

/* Timeline styles */
.timeline {
  position: relative;
  margin: 20px 0;
  padding-left: 120px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Main vertical line */
.timeline::before {
  content: "";
  position: absolute;
  left: 90px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #e1e4e8;
}

.timeline-item {
  position: relative;
  min-height: 50px;
  padding-left: 40px;
}

/* Dots on the timeline */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  border: 2px solid #24292e;
  z-index: 1;
}

.timeline-date {
  position: absolute;
  left: -100px;
  top: 50%;
  transform: translateY(-50%);
  color: #586069;
  font-size: 13px;
  text-align: right;
  width: 80px;
}

.timeline-content {
  margin-left: 10px;
}

.timeline-title {
  font-weight: 600;
  color: #24292e;
  font-size: 15px;
  margin-bottom: 4px;
}

.timeline-subtitle {
  color: #586069;
  font-size: 13px;
  margin: 2px 0;
  line-height: 1.4;
}

/* Mobile responsive timeline */
@media (max-width: 768px) {
  .timeline-title {
    font-size: 14px;
  }
  .timeline-subtitle {
    font-size: 12px;
  }
  .timeline-date {
    font-size: 12px;
    left: -80px;
    width: 60px;
  }
}

@media (max-width: 600px) {
  .timeline {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 20px;
    margin: 20px -20px;
    height: 200px; /* Increased height further */
    -webkit-overflow-scrolling: touch;
  }

  .timeline-item {
    flex: 0 0 140px;
    margin-right: 20px;
    padding: 0 10px;
    height: 200px; /* Match container height */
  }

  .timeline::before {
    left: 20px;
    width: calc(100% + 600px);
    top: 100px; /* Move line to middle */
  }

  .timeline::after {
    left: 20px;
    width: calc(100% + 600px);
    top: 100px; /* Match line position */
    background: linear-gradient(
      to right,
      white,
      transparent 40px,
      transparent calc(100% - 40px),
      white
    );
  }

  .timeline-content,
  .timeline-date {
    white-space: normal;
    width: 130px;
    min-height: 40px; /* Ensure space for content */
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline-item:nth-child(odd) .timeline-date {
    top: 30px;
  }

  .timeline-item:nth-child(odd) .timeline-content {
    top: 120px;
  }

  .timeline-item:nth-child(even) .timeline-date {
    top: 160px;
  }

  .timeline-item:nth-child(even) .timeline-content {
    top: 60px;
    transform: translate(-50%, -100%);
  }

  .timeline-item::before {
    top: 100px; /* Match line position */
  }
}

/* Movie recommendations styles */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.movie-item {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.movie-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
}

.movie-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.movie-year {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
  }
}

/* Text-based movie cards */
.movie-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.movie-card {
  padding: 15px;
  border-radius: 8px;
  background: #f6f8fa;
  transition: transform 0.2s;
}

.movie-card:hover {
  transform: translateY(-2px);
  background: #eaecef;
}

.movie-card .movie-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #24292e;
}

.movie-card .movie-director {
  font-size: 13px;
  color: #586069;
  margin-top: 4px;
}

.movie-card .movie-year {
  font-size: 12px;
  color: #586069;
  margin-top: 2px;
}

/* Tab styles */
.tab-container {
  display: flex;
  margin-bottom: 30px;
}

.tab-button {
  border: 1px solid #e1e4e8;
  border-radius: 6px 6px 6px 6px;
  margin-right: -1px;
  background: white;
  padding: 8px 24px;
}

.tab-button:first-child {
  border-radius: 6px 0 0 6px;
}

.tab-button:last-child {
  border-radius: 0 6px 6px 0;
}

.tab-button.active {
  color: #24292e;
  font-weight: 600;
  background: #f6f8fa;
  position: relative;
  z-index: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Override margin for buttons with arrows */
.view-all,
a[href="/cv.pdf"],
#show-more-news {
  margin-right: 0;
}

/* Special styling for CV link in social links */
.social-links .social-cv {
  background: none;
  border-bottom: 1px dotted #666;
  border-radius: 0;
  padding: 0;
  margin-left: 8px;
  font-size: 14px;
}

.social-links .social-cv:hover {
  color: #0366d6;
  border-bottom-color: #0366d6;
  background: none;
}

.social-links .social-cv::after {
  content: " →";
}

/* Movie list styles */
.movie-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

/* Ensure hidden class actually hides content */
.movie-list.hidden {
  display: none;
}

.movie-card {
  padding: 15px;
  border-radius: 8px;
  background: #f6f8fa;
  transition: transform 0.2s;
}

.movie-card:hover {
  transform: translateY(-2px);
  background: #eaecef;
}

.movie-card .movie-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #24292e;
}

.movie-card .movie-director {
  font-size: 13px;
  color: #586069;
  margin-top: 4px;
}

.movie-card .movie-year {
  font-size: 12px;
  color: #586069;
  margin-top: 2px;
}

/* Show more button styling */
.show-more-btn {
  color: #586069;
  font-size: 14px;
  font-weight: normal;
  text-decoration: none;
  border-bottom: 1px dotted #666;
  cursor: pointer;
  background: none;
}

.show-more-btn:hover {
  color: #0366d6;
  border-bottom-color: #0366d6;
  background: none;
  text-decoration: none;
}

/* Ensure no arrow is added to show-more-btn */
.show-more-btn::after {
  content: none;
}

/* Author name styling */
.authors strong {
  font-style: normal;
  font-weight: 600;
}

/* Blog styles */
.blog-list {
  margin-top: 30px;
}

.blog-item {
  margin-bottom: 40px;
}

.blog-item h3 {
  margin-bottom: 5px;
}

.blog-item h3 a {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: none;
}

.blog-item h3 a:hover {
  color: var(--link-hover);
}

.blog-meta {
  font-size: 14px;
  color: #586069;
  margin-bottom: 10px;
}

.blog-description {
  color: #586069;
  font-size: 15px;
  margin-top: 5px;
}

/* Individual post styles */
.post {
  max-width: 700px;
  margin: 0 auto;
}

.post-meta {
  font-size: 14px;
  color: #586069;
  margin: 10px 0 30px;
}

.post-content {
  font-size: 16px;
  line-height: 1.6;
}
