/* CSS Variables for theming */
:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-muted: #666666;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --border-color: #e5e5e5;
  --card-bg: #f9fafb;
  --nav-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
  --bg-color: #0f0f0f;
  --text-color: #e5e5e5;
  --text-muted: #a0a0a0;
  --accent-color: #60a5fa;
  --accent-hover: #93c5fd;
  --border-color: #333333;
  --card-bg: #1a1a1a;
  --nav-bg: rgba(15, 15, 15, 0.95);
}

/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for sticky nav */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
  transition: background-color 0.3s, color 0.3s;
}

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

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 1rem 0;
  height: 64px;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

nav ul li {
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  display: inline-block;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom-color: var(--accent-color);
}

.theme-toggle,
.style-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-color);
  transition: background-color 0.2s;
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-toggle:hover,
.style-toggle:hover {
  background-color: var(--card-bg);
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero Section */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 3px solid var(--border-color);
}

.profile-photo-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

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

.social-links .icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Sections */
section {
  padding: 2rem 0;
}

/* Add extra spacing between major sections */
section#research,
section#cv {
  padding-top: 4rem;
  margin-top: 2rem;
}

section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

/* Add spacing between subsections within research */
section#research h2:not(:first-of-type) {
  margin-top: 4rem;
  padding-top: 2rem;
}

/* Bio Section */
.bio {
  margin-bottom: 2rem;
}

.bio p {
  margin-bottom: 1rem;
}

.roles {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.role {
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
}

.role h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.role p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* News Section */
.news-list {
  list-style: none;
}

.news-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.news-date {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  width: 80px;
}

.news-content {
  flex: 1;
}

/* Publications */
.publication {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.publication-venue {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.publication-venue.in-review {
  background: #f59e0b;
}

.publication-venue.upcoming {
  background: #8b5cf6;
}

.publication h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}


.publication-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.publication-authors strong {
  color: var(--text-color);
}

.publication-abstract {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.publication-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.publication-links a,
.publication-links button {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-color);
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

.publication-links a:hover,
.publication-links button:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  text-decoration: none;
}

.bibtex {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-color);
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  border: 1px solid var(--border-color);
}

.bibtex.show {
  display: block;
}

/* Projects */
.project {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.project h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.project p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.project .publication-links {
  margin-top: 1rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.project-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Footer */
footer {
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Sidebar layout */
.page-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  text-align: center;
  position: sticky;
  top: 96px;
}

.sidebar h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sidebar .tagline {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.sidebar .social-links {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0;
}

.sidebar .social-links a {
  justify-content: flex-start;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* Responsive */
@media (max-width: 860px) {
  .page-layout {
    flex-direction: column;
    padding: 2rem 1.5rem;
  }

  .sidebar {
    width: 100%;
    position: static;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
  }

  .sidebar .social-links {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .tagline {
    font-size: 1rem;
  }

  nav ul {
    gap: 1rem;
  }

  .social-links {
    gap: 0.5rem;
  }

  .social-links a {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .news-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .news-date {
    width: auto;
  }
}
