:root {
  --bg-color: #ffffff;
  --sidebar-bg: #f8fafc;
  --text-color: #1a1a1a;
  --text-muted: #4b5563;
  --accent-color: #2563eb;
  --border-color: #e5e7eb;
  --sidebar-width: 280px;
  --nav-height: 70px;
  --content-max-width: 1400px;
  --image-border-radius: 12px;
  --arxiv-color: #ff4444;
  --youtube-color: #ff0000;
  --pdf-color: #ee3124;
  --doi-color: #3b82f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-color: #60a5fa;
    --border-color: #334155;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--sidebar-bg); /* Use sidebar-bg for the "void" space */
  display: flex;
  justify-content: center;
}

.page-wrapper {
  display: flex;
  width: 100%;
  max-width: var(--content-max-width);
  background-color: var(--bg-color);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* Specific styling for content-heavy links (paragraphs, lists in main content) */
.main-content a, .sidebar-tagline a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .main-content a, .sidebar-tagline a {
    color: #ffffff;
  }
}

/* Top Navigation */
.top-nav {
  height: var(--nav-height);
  width: 100%; /* Keep it full width but inner aligns */
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.nav-inner {
  max-width: var(--content-max-width);
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

.nav-brand {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-brand a {
  color: var(--text-color);
  text-decoration: none;
}

.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 10px;
  margin-bottom: 0px !important;
}

.nav-mobile-socials {
  display: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background-color: var(--accent-color);
  color: white !important;
}

/* Sidebar Styling (Profile & Socials) */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--nav-height));
  position: sticky;
  top: var(--nav-height);
  background-color: var(--sidebar-bg); /* Distinct sidebar color */
  border-right: 1px solid var(--border-color);
  padding: 50px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  overflow-y: auto; /* Allow scrolling if many social links */
}

.sidebar-profile {
  text-align: center;
  margin-bottom: 40px;
}

.sidebar-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  margin-bottom: 25px;
}

.sidebar-name {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.sidebar-name a {
  color: var(--text-color);
  text-decoration: none;
}

.sidebar-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  margin-bottom: auto;
}

.nav-item {
  margin-bottom: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  display: block;
  padding: 10px 15px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background-color: var(--accent-color);
  color: white;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 20px;
}

.social-icon-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.social-icon-link:hover {
  background-color: var(--accent-color);
  color: white !important;
  transform: translateX(5px);
  border-color: var(--accent-color);
}

.social-icon-link span {
  text-decoration: none !important;
}

.social-icon {
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  display: inline-block;
  flex-shrink: 0;
}

.icon-scholar { 
  mask-image: url('../icons/scholar.svg'); 
  -webkit-mask-image: url('../icons/scholar.svg'); 
}
.icon-orcid { 
  mask-image: url('../icons/orcid.svg'); 
  -webkit-mask-image: url('../icons/orcid.svg'); 
}
.icon-researchgate { 
  mask-image: url('../icons/researchgate.svg'); 
  -webkit-mask-image: url('../icons/researchgate.svg'); 
}
.icon-github { 
  mask-image: url('../icons/github.svg'); 
  -webkit-mask-image: url('../icons/github.svg'); 
}
.icon-linkedin { 
  mask-image: url('../icons/linkedin.svg'); 
  -webkit-mask-image: url('../icons/linkedin.svg'); 
}
.icon-globe { 
  mask-image: url('../icons/globe.svg'); 
  -webkit-mask-image: url('../icons/globe.svg'); 
}
.icon-email { 
  mask-image: url('../icons/email.svg'); 
  -webkit-mask-image: url('../icons/email.svg'); 
}

/* Main Content Styling */
.main-content {
  flex: 1;
  padding: 60px 80px;
  background-color: var(--bg-color); /* Bright white for content */
  min-width: 0;
}

h1 {
  font-family: 'Lora', serif;
  font-size: 2.25rem;
  color: var(--text-color);
  margin-top: 0;
  margin-bottom: 2rem;
}

h2 {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  color: var(--text-color);
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

h3 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  color: var(--text-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: var(--accent-color);
}

.page-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.page-header h1 { 
  margin: 0; 
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.home-hero {
  display: flex;
  gap: 40px;
  align-items: center;
  margin-bottom: 40px;
}

.home-hero-text {
  flex: 1;
}

.home-hero-img {
  width: 200px;
  height: 200px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.sidebar-img-hidden .sidebar-img {
  display: none;
}

@media (max-width: 768px) {
  .home-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 25px;
  }
  
  .home-hero-img {
    width: 180px;
    height: 180px;
  }
}

.research-impact-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.metric-tag {
  background: var(--sidebar-bg);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.metric-tag strong {
  color: var(--accent-color);
}

p {
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  color: var(--text-color);
}

.highlight {
  color: var(--accent-color);
  font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  body {
    background-color: var(--bg-color);
    flex-direction: column;
    align-items: center;
  }

  .page-wrapper {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
  }

  /* Top Navigation */
  .top-nav {
    position: sticky;
    height: auto;
    width: 100%;
    left: 0;
    top: 0;
  }

  .nav-inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 15px 20px;
    align-items: center;
  }

  .nav-brand {
    font-size: 1.3rem;
    text-align: left;
  }

  .nav-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 100%;
    padding: 10px 0;
  }

  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block;
    background: var(--text-color);
    height: 2px;
    width: 22px;
    border-radius: 2px;
    position: relative;
    transition: all 0.3s;
  }

  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    content: '';
    position: absolute;
    width: 22px;
  }

  .nav-toggle-label span::before { bottom: 7px; }
  .nav-toggle-label span::after { top: 7px; }

  /* Animated X */
  .nav-toggle:checked ~ .nav-toggle-label span { background: transparent; }
  .nav-toggle:checked ~ .nav-toggle-label span::before { transform: rotate(45deg); bottom: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span::after { transform: rotate(-45deg); top: 0; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
    z-index: 1000;
  }

  .nav-toggle:checked ~ .nav-menu {
    max-height: 600px;
    padding-bottom: 10px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
  }

  .nav-item {
    width: 100%;
    text-align: left;
  }

  .nav-link {
    width: 100%;
    padding: 14px 25px;
    border-radius: 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-mobile-socials {
    display: block;
    padding: 25px;
    background: var(--sidebar-bg);
  }

  .social-links-inline {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
  }

  .social-links-inline .social-icon {
    width: 24px;
    height: 24px;
    color: var(--text-color);
  }

  /* Sidebar */
  .sidebar {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    top: 0 !important;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px !important; /* Extremely tight padding */
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
  }

  .sidebar-header {
    margin-right: 0;
    margin-bottom: 4px; /* Minimal margin */
    text-align: center;
  }

  .sidebar-img {
    width: 100px; /* Even smaller for mobile */
    height: 100px;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .sidebar-name {
    display: block;
    font-size: 1.1rem;
    line-height: 1.1;
  }

  .sidebar-tagline {
    display: block;
    font-size: 0.75rem; /* Smaller tagline to save height */
    margin-top: 1px;
    margin-bottom: 0px;
  }

  .sidebar .social-links {
    display: none;
  }

  .social-icon-link span:not(.social-icon) {
    display: none;
  }

  .social-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
  }

  .social-icon-link {
    padding: 0;
    width: 44px;
    height: 44px;
    justify-content: center;
    background-color: var(--bg-color);
    border-radius: 50%;
  }

  .main-content {
    width: 100% !important;
    padding: 30px 25px !important; /* Increased from 20px for better breathing room */
  }

  .page-header h1 {
    display: block; /* Reset flex for mobile titles */
    margin-bottom: 5px;
  }

  .page-header {
    display: flex; /* Ensure flex is active */
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
  }
}

/* Section Specific Utilities */
.entry {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
}

.entry:not(:last-of-type) {
  border-bottom: 1px dashed var(--border-color);
}

.entry-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.entry-title { font-weight: 600; font-size: 1.2rem; }
.entry-org { font-style: italic; color: var(--text-muted); }
.entry-time { color: var(--text-muted); font-size: 0.95rem; }

.publication {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
}

.publication:not(:last-of-type) {
  border-bottom: 1px dashed var(--border-color);
}

.publication-cover {
  width: 320px;
  height: auto;
  display: flex;
  align-items: flex-start;
}

.publication-cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--image-border-radius);
  border: none;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08); /* More pronounced shadow since border is gone */
  transition: transform 0.3s ease;
}

.publication:hover .publication-cover img {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .publication {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .publication-cover {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    justify-content: center;
  }
}

.publication-title { font-weight: 600; margin-bottom: 6px; display: block; font-size: 1.25rem; }
.publication-authors { color: var(--text-color); margin-bottom: 4px; }
.publication-authors strong { color: var(--accent-color); }
.publication-venue { font-style: italic; color: var(--text-muted); margin-bottom: 8px; }
.publication-links { margin-top: 12px; }
.pub-link {
  text-decoration: none;
  font-size: 0.95rem; /* Increased from 0.85rem */
  padding: 6px 14px; /* Increased from 4px 10px */
  border: 1px solid var(--border-color);
  background: var(--sidebar-bg); /* Add subtle background */
  border-radius: 8px; /* Slightly rounder */
  color: var(--text-muted);
  margin-right: 12px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Increased gap */
  transition: all 0.2s;
}

.pub-link svg, .pub-link img {
  width: 18px; /* Fixed size */
  height: 18px;
  flex-shrink: 0;
}

/* Make PNG icons (like arXiv) pop more */
.pub-link img {
  filter: contrast(1.2) saturate(1.2) drop-shadow(0.5px 0.5px 0px rgba(0,0,0,0.1));
}

.pub-link svg {
  fill: currentColor;
}

/* Brand specific icon colors */
.pub-link[href*="youtube.com"] svg { color: var(--youtube-color); }
.pub-link[href*="watch?v="] svg { color: var(--youtube-color); }
.pub-link[href$=".pdf"] svg { color: var(--pdf-color); }
.pub-link[href*="ieeexplore.ieee.org"] svg, 
.pub-link[href*="doi.org"] svg { color: var(--doi-color); }

.pub-link:hover { 
  border-color: var(--accent-color); 
  color: var(--accent-color);
  background: var(--bg-color);
  transform: translateY(-2px); /* Subtle lift effect */
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Keep icon colors on hover or let them inherit? 
   Let's make them slightly more vibrant on hover */
.pub-link:hover svg {
  filter: brightness(1.1);
}
