:root { 
  --brand-color: #0f766e; 
  --brand-light: #14b8a6;
  --brand-gradient: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  --text-dark: #111827;
  --text-medium: #374151;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border-light: #e5e7eb;
  --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 25px rgba(0,0,0,.15);
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
}

/* Modern Navbar Styling */
.navbar {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid var(--glass-border) !important;
  box-shadow: 0 1px 20px rgba(0,0,0,.08) !important;
  padding: 0.8rem 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  transition: all 0.3s ease !important;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 30px rgba(0,0,0,.12) !important;
}

.navbar-brand { 
  font-weight: 700 !important;
  font-size: 1.4rem !important;
  background: var(--brand-gradient) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  position: relative !important;
  transition: all 0.3s ease !important;
}

.navbar-brand::after {
  content: '' !important;
  position: absolute !important;
  bottom: -2px !important;
  left: 0 !important;
  width: 0 !important;
  height: 2px !important;
  background: var(--brand-gradient) !important;
  transition: width 0.3s ease !important;
}

.navbar-brand:hover::after {
  width: 100% !important;
}

/* Enhanced Navigation Links */
.navbar-nav .nav-link {
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  color: var(--text-medium) !important;
  padding: 0.6rem 1.2rem !important;
  margin: 0 0.2rem !important;
  border-radius: 12px !important;
  position: relative !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  overflow: hidden !important;
}

.navbar-nav .nav-link::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.1), transparent) !important;
  transition: left 0.6s ease !important;
}

.navbar-nav .nav-link:hover {
  color: var(--brand-color) !important;
  background: rgba(15, 118, 110, 0.08) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2) !important;
}

.navbar-nav .nav-link:hover::before {
  left: 100% !important;
}

.navbar-nav .nav-link.active {
  font-weight: 600 !important;
  color: white !important;
  background: var(--brand-gradient) !important;
  box-shadow: 0 4px 15px rgba(15, 118, 110, 0.3) !important;
  transform: translateY(-1px) !important;
}

/* Modern Search Button */
.quarto-navbar-tools {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.quarto-navbar-tools .quarto-navigation-tool {
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  background: var(--bg-light) !important;
  border: 1px solid var(--border-light) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
}

.quarto-navbar-tools .quarto-navigation-tool::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 0 !important;
  height: 0 !important;
  background: var(--brand-gradient) !important;
  border-radius: 50% !important;
  transition: all 0.4s ease !important;
  transform: translate(-50%, -50%) !important;
  z-index: 0 !important;
}

.quarto-navbar-tools .quarto-navigation-tool:hover {
  border-color: var(--brand-color) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.2) !important;
}

.quarto-navbar-tools .quarto-navigation-tool:hover::before {
  width: 100% !important;
  height: 100% !important;
}

.quarto-navbar-tools .quarto-navigation-tool:hover i {
  color: white !important;
  z-index: 1 !important;
  position: relative !important;
}

/* Enhanced body and typography */
.quarto-title h1.title { 
  font-weight: 700; 
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: linear-gradient(135deg, #fafafa 0%, #f5f7fa 100%);
  min-height: 100vh;
}

.home-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 3.5rem;
  max-width: 1450px;
  margin: 0 auto;
  align-items: start;
  padding: 2rem 1rem;
}

@media (max-width: 860px) {
  .home-grid { 
    grid-template-columns: 1fr; 
    gap: 2rem; 
    padding: 1rem;
  }
}

.right-col { 
  display: flex; 
  flex-direction: column; 
  gap: 3rem; 
}

/* Enhanced Card System */
.profile-card, .section-card, .area-card {
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.profile-card::before, .section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.profile-card:hover::before, .section-card:hover::before {
  transform: scaleX(1);
}

.profile-card:hover, .section-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.95);
}

.profile-card { 
  padding: 3rem 2rem; 
  text-align: center; 
  position: sticky;
  top: 6rem;
}

.section-card { 
  padding: 2.5rem; 
  position: relative;
}

/* Enhanced section titles with modern gradient */
.section-card h2, .section-card h3 {
  color: var(--text-dark);
  font-weight: 700;
  margin-bottom: 1.8rem;
  padding-bottom: 0.8rem;
  position: relative;
  font-size: 1.4rem;
}

.section-card h2::after, .section-card h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--brand-gradient);
  border-radius: 2px;
}

.area-card { overflow: hidden; }

/* Optimized Research page layout */

/* Main container for Research page */
.quarto-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Research page title */
.quarto-title .title {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Optimized research area grid layout */
.areas-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
  gap: 2.5rem; 
  margin-top: 2rem;
  padding: 0;
}

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

/* Redesigned research area cards */
.area-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 6px 25px rgba(0,0,0,.08);
  border: 1px solid rgba(15, 118, 110, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  height: fit-content;
}

.area-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  z-index: 2;
}

.area-card:hover::before {
  transform: scaleX(1);
}

.area-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 45px rgba(0,0,0,.12);
  border-color: var(--brand-color);
}

/* Research area image optimization */
.area-card img { 
  width: 100%; 
  height: 250px;
  object-fit: cover;
  display: block; 
  transition: transform 0.4s ease;
  border-radius: 0;
}

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

/* Research area content */
.area-card .body { 
  padding: 2rem; 
  position: relative;
  background: white;
}

.area-card .title { 
  font-weight: 700; 
  margin: 0 0 1rem;
  color: var(--text-dark);
  font-size: 1.3rem;
  line-height: 1.3;
}

.area-card .description {
  color: var(--text-medium);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.area-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-color);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}

.area-card .read-more::after {
  content: '→';
  transition: transform 0.3s ease;
}

.area-card .read-more:hover {
  color: var(--brand-light);
  transform: translateX(3px);
}

.area-card .read-more:hover::after {
  transform: translateX(3px);
}

/* Super enhanced profile card */
.profile-card img {
  width: 85%;
  max-width: 260px;
  border-radius: 50%;
  border: 4px solid transparent;
  background: var(--brand-gradient);
  padding: 4px;
  margin: 0.5rem auto 2rem;
  display: block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.profile-card img:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 15px 35px rgba(15, 118, 110, 0.3);
}

.profile-card .name { 
  font-size: 1.5rem; 
  font-weight: 700; 
  margin: 1.2rem 0 0.8rem; 
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-card .role { 
  color: var(--text-medium); 
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Super enhanced icon badges */
.badge-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto 0;
  max-width: 650px;
}

.icon-badge {
  flex: 0 1 280px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-medium);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 118, 110, 0.1);
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

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

.icon-badge:hover {
  background: var(--brand-gradient);
  border-color: transparent;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.25);
  color: white;
}

.icon-badge:hover::before {
  left: 100%;
}

.icon-badge i { 
  justify-self: center; 
  font-size: 1.2rem; 
  color: var(--text-light);
  transition: all 0.3s ease;
}

.icon-badge:hover i {
  color: white;
  transform: scale(1.1);
}

.icon-badge span { 
  text-align: center; 
  display: block; 
  width: 100%; 
}

/* News listing with modern cards */
.quarto-listing .listing-item {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.quarto-listing .listing-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.1);
  border-color: var(--brand-color);
}

.quarto-listing .listing-date { 
  font-size: 0.85rem; 
  color: white;
  background: var(--brand-gradient);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}

.quarto-listing .listing-title,
.quarto-listing .listing-title a {
  font-weight: 700 !important;
  font-size: 1.15rem;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.quarto-listing .listing-title a:hover {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced publications */
#refs .csl-entry {
  margin-bottom: 1.5rem;
  line-height: 1.7;
  padding: 1rem 1.5rem 1rem 2rem;
  background: rgba(15, 118, 110, 0.02);
  border-radius: 8px;
  border-left: 3px solid var(--brand-color);
  position: relative;
  transition: background-color 0.2s ease;
}

#refs .csl-entry:hover {
  background: rgba(15, 118, 110, 0.05);
}

/* #refs .csl-entry::before {
  content: "•";
  color: var(--brand-color);
  font-weight: 700;
  font-size: 1.2rem;
  position: absolute;
  left: 0.7rem;
  top: 1rem;
} */

/* Experience section improvements */
.section-card ul {
  list-style: none;
  padding: 0;
}

.section-card li {
  padding: 0.8rem 0;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
  padding-left: 1.5rem;
}

.section-card li::before {
  content: "▸";
  color: var(--brand-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

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

/* Fix CV PDF display issues */
.embed-pdf { 
  width: 100% !important; 
  height: 900px !important; 
  min-height: 900px !important;
  border: 1px solid var(--border-light); 
  border-radius: 12px; 
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
  display: block !important;
}

.quarto-container,
.quarto-container > *,
.column-page-inset,
.column-page-inset > * {
  max-width: none !important;
  width: 100% !important;
}

body.quarto-light .embed-pdf,
.quarto-document .embed-pdf {
  max-width: 100% !important;
  width: 100% !important;
  height: 900px !important;
  object-fit: contain;
}

/* Modern scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--brand-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-color);
}

/* Smooth animations */
* {
  scroll-behavior: smooth;
}

/* Enhanced focus states */
.icon-badge:focus,
.nav-link:focus {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Loading animation for the entire page */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-grid > * {
  animation: fadeInUp 0.6s ease-out forwards;
}

.home-grid > *:nth-child(2) {
  animation-delay: 0.2s;
}

/* Simple news listing - fix disappearing text on hover */
#listing-latest-news {
  margin: 0 !important;
  padding: 0 !important;
}

#listing-latest-news .quarto-listing,
#listing-latest-news .list {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

/* Style each news item as simple bullet point */
#listing-latest-news .quarto-post {
  display: block !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 0 0.5rem 0 !important;
  padding: 0 0 0 1.2rem !important;
  position: relative !important;
}

/* Add simple bullet point */
#listing-latest-news .quarto-post::before {
  content: "▸" !important;
  color: var(--brand-color) !important;
  font-weight: bold !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
}

/* Hide thumbnail and metadata */
#listing-latest-news .thumbnail,
#listing-latest-news .metadata {
  display: none !important;
}

/* Style the body */
#listing-latest-news .body {
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  width: 100% !important;
}

/* Reset title styling */
#listing-latest-news .listing-title,
#listing-latest-news .listing-title h3,
#listing-latest-news h3.listing-title {
  margin: 0 !important;
  display: inline !important;
  font-weight: normal !important;
  font-size: 1rem !important;
  border: none !important;
  border-bottom: none !important;
  background: none !important;
  line-height: 1.6 !important;
}

/* Fix the disappearing text issue */
#listing-latest-news .listing-title a,
#listing-latest-news .listing-title h3 a,
#listing-latest-news h3.listing-title a {
  font-weight: normal !important;
  font-size: 1rem !important;
  border: none !important;
  border-bottom: none !important;
  /* Use default link colors */
}

#listing-latest-news .listing-title a:hover,
#listing-latest-news .listing-title h3 a:hover,
#listing-latest-news h3.listing-title a:hover {
  /* Override the problematic transparent text style */
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
  /* Use default hover behavior instead */
}

/* Remove any pseudo-elements */
#listing-latest-news .listing-title::after,
#listing-latest-news .listing-title h3::after,
#listing-latest-news h3.listing-title::after {
  display: none !important;
  content: none !important;
}

/* Hide description */
#listing-latest-news .listing-description,
#listing-latest-news .delink {
  display: none !important;
}

/* Remove hover effects on post container */
#listing-latest-news .quarto-post:hover {
  background: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Reset h3 styling */
#listing-latest-news h3 {
  font-weight: normal !important;
  font-size: 1rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-bottom: none !important;
  background: none !important;
  line-height: 1.6 !important;
}

#listing-latest-news h3::after {
  display: none !important;
  content: none !important;
}

/* Enhanced bibliography styling - Fixed version */
#refs {
  margin-top: 2rem;
}

#refs .csl-bib-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

#refs .csl-entry {
  margin-bottom: 0 !important;
  line-height: 1.65;
  padding: 1.5rem 1.8rem 1.5rem 3.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.08);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

#refs .csl-entry:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 118, 110, 0.08);
  border-color: rgba(15, 118, 110, 0.2);
}

/* Hide original numbers and create custom circular badges */
#refs .csl-left-margin {
  position: absolute !important;
  left: 1.2rem;
  top: 1.5rem;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--brand-gradient);
  color: white;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
  float: none !important;
  min-width: auto !important;
  /* Hide the original text content */
  text-indent: -9999px;
  overflow: hidden;
}

/* Add the number back with CSS counter or extract from content */
#refs .csl-left-margin::before {
  content: attr(data-number);
  text-indent: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* If the above doesn't work, try this alternative approach */
#refs .csl-entry:nth-child(1) .csl-left-margin::before { content: "1"; }
#refs .csl-entry:nth-child(2) .csl-left-margin::before { content: "2"; }
#refs .csl-entry:nth-child(3) .csl-left-margin::before { content: "3"; }
#refs .csl-entry:nth-child(4) .csl-left-margin::before { content: "4"; }
#refs .csl-entry:nth-child(5) .csl-left-margin::before { content: "5"; }
#refs .csl-entry:nth-child(6) .csl-left-margin::before { content: "6"; }
#refs .csl-entry:nth-child(7) .csl-left-margin::before { content: "7"; }
#refs .csl-entry:nth-child(8) .csl-left-margin::before { content: "8"; }
#refs .csl-entry:nth-child(9) .csl-left-margin::before { content: "9"; }
#refs .csl-entry:nth-child(10) .csl-left-margin::before { content: "10"; }
#refs .csl-entry:nth-child(11) .csl-left-margin::before { content: "11"; }
#refs .csl-entry:nth-child(12) .csl-left-margin::before { content: "12"; }

#refs .csl-right-inline {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Style links in bibliography */
#refs .csl-entry a {
  color: var(--brand-color);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

#refs .csl-entry a:hover {
  color: var(--brand-light);
  border-bottom-color: var(--brand-light);
}

/* Journal names styling */
#refs .csl-entry em {
  color: var(--text-medium);
  font-style: italic;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .profile-card {
    position: static !important;
    top: auto !important;
    margin-bottom: 2rem !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .profile-card {
    position: static !important;
    top: auto !important;
  }
}

/* Add underline to News item titles */
#listing-latest-news .listing-title a {
  text-decoration: underline !important;
  text-decoration-color: var(--brand-color) !important; /* use your theme color */
  text-underline-offset: 3px !important; /* spacing between text and underline */
}

/* Optional: change color on hover */
#listing-latest-news .listing-title a:hover {
  color: var(--brand-light) !important;
  text-decoration-color: var(--brand-light) !important;
}

/* Allow long URLs/links to break across lines */
#listing-latest-news .listing-title a,
#listing-latest-news .listing-description a,
a {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word; /* fallback for very long continuous strings */
}

/* make card clickable*/
.area-card {
  position: relative;
}
.area-card a:first-of-type {
  position: absolute;
  inset: 0; /* cover the whole card */
  z-index: 1;
  text-indent: -9999px; /* hide text */
  overflow: hidden;
}
