/* layout.css */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* Ensure minimum font size for iOS */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Improve touch scrolling on iOS */
body {
  -webkit-overflow-scrolling: touch;
}

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
  /* Fix flexbox issues in Safari */
  .tag-row {
    -webkit-flex-wrap: wrap;
  }
  
  /* Fix image rendering in Safari */
  .publication-image img,
  .software-image img {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Header */
.site-header {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  flex-shrink: 0;
}

.logo-icon {
  display: inline-block;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #C99700, var(--accent-color));
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.site-title {
margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.site-title a {
  color: var(--text-dark);
}

.site-title a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  z-index: 101;
}

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

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

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

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 1.05rem;
  font-weight: 500;
  font-style: normal;
  color: var(--text-medium);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary-color);
}

/* Hero Section */
/* Sidebar Navigation */
.sidebar-nav {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background-color: var(--bg-white);
  padding: 1rem 0.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-style: normal;
  white-space: nowrap;
}

.sidebar-link:hover {
  color: var(--primary-color);
  background-color: var(--bg-light);
}

.sidebar-link.active {
  color: var(--primary-color);
  background-color: var(--highlight-bg);
  font-weight: 600;
}

.hero {
  padding: 3rem 0;
  background-color: var(--bg-white);
}

.hero-content {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-left-column {
  display: flex;
  flex-direction: column;
}

.hero-image {
  width: 300px;
  height: 400px;
  margin-bottom: 1.5rem;
  background-color: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-image .placeholder-image {
  width: 100%;
  height: 100%;
  font-size: 1.1rem;
  border-radius: 12px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 0;
  color: var(--text-dark);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--accent-color);
  font-weight: 600;
  margin: 0.5rem 0 1rem 0;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.contact-links a {
  font-size: 1rem;
  color: var(--accent-color);
  font-weight: 500;
}

.contact-links a i,
.footer-column p i,
.footer-column ul i {
  margin-right: 0.4rem;
  font-style: normal;
}

.research-interests-text {
  background-color: var(--bg-light);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.research-interests-text p {
  margin: 0;
  color: var(--text-dark);
  line-height: 1.7;
  font-size: 0.95rem;
}

.research-interests-text strong {
  color: var(--primary-color);
}

.bio-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bio-text p {
  margin: 0;
  color: var(--text-medium);
  line-height: 1.8;
  text-align: justify;
}

.bio-text strong {
  color: var(--primary-color);
}

/* News Section */
.news {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.news .section-header-with-link {
  margin-bottom: 2rem;
}

.news-container {
  margin-bottom: 1.5rem;
}

.news-toggle-container {
  text-align: left;
  margin-top: 1.5rem;
}

.news-toggle-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.news-toggle-btn:hover {
  color: var(--primary-color);
}

.news-toggle-btn:active {
  color: var(--text-dark);
}

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

.year-section:last-child {
  margin-bottom: 0;
}

.year-heading {
  color: var(--primary-color);
  font-size: 1.6rem;
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--highlight-bg);
}

.news-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.news-list li {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.6;
  align-items: flex-start;
}

.news-list li:last-child {
  border-bottom: none;
}

/* Unified date styling for all sections - readable but subtle */
.news-date,
.award-year,
.service-date,
.experience-year {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  background-color: var(--bg-light);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  min-width: 70px;
  text-align: center;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  display: inline-block;
  opacity: 0.9;
}

.news-content {
  color: var(--text-medium);
  flex: 1;
  font-size: 1rem;
  line-height: 1.5;
}

.news-content strong {
  color: var(--text-dark);
  font-weight: 600;
}

/* Research Areas / Publications Section */
.research-areas {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.research-areas .section-header-with-link {
  margin-bottom: 1.5rem;
}

/* Filter Section */
.filter-section {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 1rem;
  border: none;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
  max-width: 100%;
  margin: 1rem auto;
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

/* Terminal icon before tags */
.interest-tags::before {
  content: '\f120'; /* FontAwesome terminal icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: #495057;
  font-size: 1.1rem;
  margin-right: 0.8rem;
  flex-shrink: 0;
  align-self: center;
}

.tag-row {
  display: contents; /* Make tag-row transparent, tags flow naturally */
}


.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.6rem;
  background-color: #ffffff;
  color: #495057;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 400;
  font-family: 'Courier New', Monaco, monospace;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid #dee2e6;
  white-space: nowrap;
  text-align: center;
  flex: 0 0 auto;
  min-width: fit-content;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.tag:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
}

.tag.active {
  background-color: #495057;
  border-color: #495057;
  color: #ffffff;
}

/* Active Research Areas View */
.research-view {
  transition: opacity 0.3s ease;
}

.research-card {
  margin-bottom: 4rem;
  padding: 2.5rem;
  background-color: var(--bg-light);
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 2rem;
}

.research-card h3 {
  grid-column: 1 / 2;
  grid-row: 1;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.7rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.research-description {
  grid-column: 1 / 2;
  grid-row: 2;
  color: var(--text-medium);
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.research-publications {
  grid-column: 1 / 2;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.research-images {
  grid-column: 2 / 3;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
  position: sticky;
  top: 100px;
}

.publication-highlight {
  background-color: var(--bg-white);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 0;
  border: 1px solid var(--border-color);
}

.publication-highlight h4 {
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.paper-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.paper-authors {
  color: var(--text-medium);
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.paper-venue {
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.3;
  display: inline;
}

.paper-note {
  color: var(--primary-color);
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  line-height: 1.3;
  font-weight: 500;
}

.paper-links {
  display: inline;
  margin-left: 0.5rem;
}

.paper-links a {
  margin-right: 0.6rem;
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 500;
  white-space: nowrap;
}

.research-image {
  background-color: var(--bg-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.research-image img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  border-radius: 4px;
}

.research-image .placeholder-image {
  width: 100%;
  height: 280px;
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Filtered Publications List View */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Books Section */
.books-section {
  margin-bottom: 3rem;
}

.books-section .section-heading {
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

/* Preprints Section */
.preprints-section {
  margin-bottom: 3rem;
}

.preprints-section .section-heading {
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.publications-separator {
  margin-bottom: 2rem;
}

.publications-separator .section-heading {
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

/* Page Headers */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
padding: 2rem 0;
}

.page-header h1 {
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-medium);
  margin: 0;
}

.publication-item {
  background-color: transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: stretch;
  overflow: visible;
  min-height: auto;
  gap: 0;
}

/* Cards with images get taller minimum height */
.publication-item:has(.publication-image) {
  min-height: 200px;
}

/* Cards without images get smaller minimum height */
.publication-item:not(:has(.publication-image)) {
  min-height: 120px;
}

.publication-item:hover .publication-content {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

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

.publication-image {
  flex-shrink: 0;
  width: 300px;
  max-height: 200px;
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.publication-image img {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  padding: 1.2rem;
  box-sizing: border-box;
}

.publication-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--bg-white);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-left: 1.5rem;
  transition: all 0.2s ease;
}

/* Cards without images don't need left margin */
.publication-item:not(:has(.publication-image)) .publication-content {
  margin-left: 0;
}

.publication-item .paper-title {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.publication-item .paper-authors {
  margin-bottom: 0.35rem;
}

.publication-item .paper-venue {
  margin-bottom: 0.4rem;
  display: inline;
}

.publication-item .paper-links {
  display: inline;
  margin-left: 0.5rem;
}

/* Software Section */
.software {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.section-header-with-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.section-header-with-link h2 {
  margin: 0;
  color: var(--text-dark);
  font-size: 2rem;
}

.view-all-link {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
}

.view-all-link:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.section-description {
  color: var(--text-medium);
  font-size: 1rem;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
  font-style: italic;
}

.software-grid {
  display: grid;
  gap: 2rem;
  justify-content: center;
  align-items: start;
}

/* Dynamic grid layout based on number of items */
.software-grid:has(.software-item:nth-child(1):last-child) {
  /* 1 item */
  grid-template-columns: 1fr;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.software-grid:has(.software-item:nth-child(2):last-child) {
  /* 2 items */
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.software-grid:has(.software-item:nth-child(3):last-child) {
  /* 3 items */
  grid-template-columns: repeat(3, 1fr);
  max-width: 1200px;
}

.software-grid:has(.software-item:nth-child(4):last-child) {
  /* 4 items - 4x1 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(5):last-child) {
  /* 5 items - 4+1 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(6):last-child) {
  /* 6 items - 4+2 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(7):last-child) {
  /* 7 items - 4+3 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(8):last-child) {
  /* 8 items - 4x2 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(9):last-child) {
  /* 9 items - 4+4+1 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(10):last-child) {
  /* 10 items - 4+4+2 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(11):last-child) {
  /* 11 items - 4+4+3 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-grid:has(.software-item:nth-child(12):last-child) {
  /* 12 items - 4x3 grid */
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

/* Fallback for more than 12 items */
.software-grid:has(.software-item:nth-child(n+13)) {
  grid-template-columns: repeat(4, 1fr);
  max-width: 1600px;
}

.software-item {
  background-color: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
  transition: all 0.3s ease;
}

.software-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Expandable software items */
.software-item.expandable {
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.software-item.expandable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

/* Plus/Minus toggle indicator */
.software-item.expandable::after {
  content: '+';
  position: absolute;
  bottom: 8px;
  right: 12px;
  width: 24px;
  height: 24px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  opacity: 0.7;
  font-family: monospace;
  line-height: 1;
}

.software-item.expandable:hover::after {
  opacity: 1;
  transform: scale(1.1);
  background-color: var(--primary-color);
}

/* When expanded, show minus sign */
.software-item.expandable.expanded::after {
  content: '−';
  background-color: var(--primary-color);
  opacity: 1;
}

.software-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 140px;
  justify-content: center;
  position: relative;
}

/* When there's an image, make it take full card */
.software-item.expandable:has(.software-image-compact) .software-preview {
  padding: 0;
  min-height: 160px;
}

.software-image-compact {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0;
}

.software-image-compact img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

/* Hide text when there's an image */
.software-item.expandable:has(.software-image-compact) .software-preview-content {
  display: none;
}

.software-preview-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: relative;
}

.software-preview h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-dark);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  word-wrap: break-word;
  hyphens: auto;
}


/* For items without images - make text more prominent */
.software-item.expandable:not(:has(.software-image-compact)) .software-preview {
  min-height: 160px;
  padding: 1.5rem;
  justify-content: center;
}

.software-item.expandable:not(:has(.software-image-compact)) .software-preview h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.4;
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

/* No expand icon styles needed */

/* Prevent contact links from being italicized */
.contact-links a {
  font-style: normal !important;
}

.software-expanded {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.software-item.expanded .software-preview {
  opacity: 0.7;
}

.software-item.expanded .software-expanded {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.software-image {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.software-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Changed from cover to contain to preserve aspect ratio */
  display: block;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  /* Ensure small images don't get too tiny */
  min-width: 80px;
  min-height: 60px;
}

.software-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.software-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.4rem;
}

.software-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.25rem 0.75rem;
  background-color: var(--text-dark);
  color: var(--bg-white);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.github-stars {
  background-color: var(--accent-color);
}

.software-description {
  color: var(--text-medium);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.software-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.5rem 1.25rem;
  background-color: var(--primary-color);
  color: var(--bg-white);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  text-decoration: none;
}

.btn-secondary {
  padding: 0.5rem 1.25rem;
  background-color: var(--bg-white);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

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

/* Awards Section */
.awards {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.awards .section-header-with-link {
  margin-bottom: 1.5rem;
}

.awards-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.awards-list li {
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-light);
  border-radius: 6px;
  border-left: 3px solid var(--accent-color);
  color: var(--text-medium);
  line-height: 1.6;
  transition: all 0.2s ease;
}

.awards-list li:hover {
  background-color: var(--highlight-bg);
  transform: translateX(4px);
}

.award-year {
  font-weight: 700;
  color: var(--primary-color);
  margin-right: 0.5rem;
  font-family: 'Courier New', monospace;
}

/* Service Section */
.service {
  padding: 3rem 0;
}

.service-content {
  max-width: 100%;
}

.service-heading {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.service-heading:first-child {
  margin-top: 0;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-list li {
  margin-bottom: 0.85rem;
  line-height: 1.6;
  color: var(--text-medium);
  font-size: 0.95rem;
}

/* Add extra spacing between service dates and content */
.service-list .service-date {
  margin-right: 1.5rem; /* Increased spacing from date to content */
  display: inline-block;
  vertical-align: top;
}


/* service-date styling now handled by unified date styling above */

/* Experience Section */
.experience {
  padding: 3rem 0;
}

.experience-content {
  max-width: 100%;
}

.experience-heading {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.experience-heading:first-child {
  margin-top: 0;
}

.experience-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  align-items: start;
}

/* experience-year styling now handled by unified date styling above */

.experience-details {
  line-height: 1.6;
  color: var(--text-medium);
  font-size: 0.95rem;
}

.experience-details strong {
  color: var(--text-dark);
  font-size: 1rem;
}

.experience-details em {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  background-color: var(--text-dark);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h4 {
  color: var(--bg-white);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-column p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  font-size: 0.9rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.footer-column a:hover {
  color: var(--bg-white);
}

.footer-copyright {
text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #475569;
  color: #94a3b8;
font-size: 0.9rem;
}


.software-category-section {
  margin-bottom: 5rem;
  padding-top: 2rem;
}

.software-category-section:first-child {
  padding-top: 0;
}

.software-category-section:not(:first-child) {
  border-top: 2px solid var(--border-color);
  padding-top: 3rem;
}

.software-category-section:last-child {
  margin-bottom: 2rem;
}

.software-category-section h2 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.software-category-section .section-description {
  color: var(--text-medium);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.software-year {
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 1440px) {
  .container {
    max-width: 1200px;
  }
}

@media (max-width: 1200px) {
  .container {
    max-width: 1000px;
    padding: 0 2rem;
  }

  .hero-content {
    grid-template-columns: 340px 1fr;
    gap: 2.5rem;
  }

  .research-card {
    grid-template-columns: 1.3fr 1fr;
  }

  .software-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 1200px !important;
  }
}

@media (max-width: 1024px) {
  .container {
    max-width: 900px;
  }

  .hero-content {
    grid-template-columns: 320px 1fr;
    gap: 2rem;
  }

  .hero-image {
    width: 300px;
    height: 300px;
  }

  .research-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .research-card h3 {
    grid-column: 1;
    grid-row: auto;
  }

  .research-description {
    grid-column: 1;
    grid-row: auto;
  }

  .research-publications {
    grid-column: 1;
    grid-row: auto;
  }

  .research-images {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }

  .software-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 800px !important;
  }
}

@media (max-width: 480px) {
  .software-grid {
    grid-template-columns: 1fr !important;
    max-width: 400px !important;
  }
}

@media (max-width: 768px) {
  .sidebar-nav {
    display: none;
  }

  .container {
    padding: 0 1rem;
  }

  .site-header {
    padding: 1rem 0;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .site-title {
    font-size: 1.3rem;
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Hide navigation by default on mobile */
  .site-nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 0;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
  }

  /* Show navigation when active */
  .site-nav.active {
    max-height: 300px;
    opacity: 1;
  }

  .site-nav a {
    min-height: 44px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-light);
    transition: all 0.2s ease;
    width: 100%;
    font-size: 1rem;
  }

  .site-nav a:hover,
  .site-nav a.active {
    background: var(--primary-color);
    color: white;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .hero-image {
    width: 120px;
    height: 120px;
    margin: 0 auto;
  }

  .hero-text {
    text-align: left;
  }
  
  .experience-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .hero-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-contact {
    font-size: 0.9rem;
  }

  .contact-links {
    gap: 0.75rem;
  }

  .contact-links a {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .news-list li {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Unified date styling on mobile - readable but compact */
  .news-date,
  .award-year,
  .service-date,
  .experience-year {
    align-self: flex-start;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    min-width: 60px;
    margin-bottom: 0.4rem;
    opacity: 0.85;
    font-weight: 600;
  }
  
  /* Increase content text size on mobile */
  .news-content {
    font-size: 0.95rem;
  }
  
  .experience-details {
    font-size: 0.9rem;
  }
  
  /* Mobile spacing for service sections */
  .service-list .service-date {
    margin-right: 1rem; /* Slightly less spacing on mobile */
    margin-bottom: 0.5rem;
    display: block; /* Stack on mobile for better readability */
  }

  .research-card {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .research-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
  }

  .research-description {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .section-heading {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  /* Responsive images for publications and software */
  .publication-item {
    flex-direction: column;
    min-height: auto;
    gap: 1rem;
  }

  /* Mobile: cards with images get taller */
  .publication-item:has(.publication-image) {
    min-height: 200px;
  }

  /* Mobile: cards without images stay compact */
  .publication-item:not(:has(.publication-image)) {
    min-height: 100px;
  }

  .publication-image {
    width: 100%;
    max-height: 160px; /* Reduced for mobile */
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
  }

  .publication-image img {
    padding: 0.5rem; /* Reduced padding on mobile */
    max-height: 160px;
    width: 100%;
    object-fit: contain;
  }

  .publication-content {
    padding: 1rem; /* Reduced padding */
    margin-left: 0;
    border-radius: 8px;
  }

  .software-image {
    height: 150px;
  }

  /* Ensure images scale properly on mobile */
  .publication-image img,
  .software-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }

  /* Mobile responsive for expandable software */
  .software-preview {
    min-height: 140px; /* Increased for better touch targets */
    padding: 1rem;
  }

  .software-item {
    margin-bottom: 1.5rem;
  }

  .software-item.expandable:has(.software-image-compact) .software-preview {
    min-height: 140px;
  }

  .software-image-compact {
    height: 100%;
    margin-bottom: 0;
  }

  .software-preview h3 {
    font-size: 0.9rem;
  }

  /* Plus/Minus indicator on mobile - consistent style */
  .software-item.expandable::after {
    width: 28px;
    height: 28px;
    font-size: 18px;
    bottom: 10px;
    right: 10px;
  }

  /* For items without images on mobile */
  .software-item.expandable:not(:has(.software-image-compact)) .software-preview {
    min-height: 140px;
    padding: 1rem;
  }

  .software-item.expandable:not(:has(.software-image-compact)) .software-preview h3 {
    font-size: 1.1rem;
  }

  /* Improved typography hierarchy for mobile */
  h1 { 
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }
  h2 { 
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }
  h3 { 
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }
  h4 {
    font-size: 1rem;
    line-height: 1.4;
  }

  /* Better paragraph spacing */
  p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
  }

  /* Improved button spacing */
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.9rem;
    margin: 4px;
  }

  /* Footer adjustments for mobile */
  .site-footer {
    padding: 2rem 0 1rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-column {
    text-align: left;
  }

  .footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }

  .footer-column p,
  .footer-column li {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .footer-copyright {
    font-size: 0.85rem;
    padding-top: 1rem;
  }
}

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

  .site-header {
    padding: 0.75rem 0;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .site-title {
    font-size: 1.15rem;
  }

  .hero-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .hero-contact {
    font-size: 0.85rem;
  }

  .contact-links {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .contact-links a {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 0.85rem;
    width: 100%;
    max-width: 280px;
  }

  .interest-tags {
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
  }
  
  .interest-tags::before {
    font-size: 0.95rem;
    margin-right: 0.4rem;
  }

  .tag {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    min-height: 26px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  p {
    font-size: 0.9rem;
  }

  .research-card h3 {
    font-size: 1rem;
  }

  .research-description {
    font-size: 0.85rem;
  }

  .software-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-column h4 {
    font-size: 1rem;
  }

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

  .btn-primary, .btn-secondary {
    text-align: center;
    width: 100%;
    min-height: 40px;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .footer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .footer-section ul {
    gap: 0.75rem;
  }

  .footer-section a {
    min-height: 44px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
