/* Academic Pages Inspired CSS */

:root {
  --sidebar-width: 300px;
  --sidebar-bg: #f5f5f5;
  --sidebar-text: #333;
  --main-bg: #fff;
  --text-color: #333;
  --link-color: #0066cc;
  --link-hover: #004499;
  --border-color: #e0e0e0;
  --section-spacing: 3rem;
  --font-serif: 'PT Serif', Georgia, serif;
  --font-sans: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark mode variables */
[data-theme="dark"] {
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #e0e0e0;
  --main-bg: #121212;
  --text-color: #e0e0e0;
  --link-color: #4a9eff;
  --link-hover: #6bb3ff;
  --border-color: #333;
}

[data-theme="dark"] .top-nav {
  background-color: #1a1a1a;
  border-bottom-color: #333;
}

/* Dark mode specific styles */
[data-theme="dark"] .experience-item,
[data-theme="dark"] .project-item,
[data-theme="dark"] .role-item,
[data-theme="dark"] .poster-item {
  background-color: #1e1e1e;
  border-color: #333;
}

[data-theme="dark"] .theme-toggle:hover {
  background-color: #2a2a2a;
}

[data-theme="dark"] .mobile-menu-toggle:hover {
  background-color: #2a2a2a;
}

[data-theme="dark"] .callout-box {
  background-color: #1e3a5f;
}

[data-theme="dark"] .timeline-item::before {
  border-color: var(--main-bg);
}

[data-theme="dark"] .theme-toggle #theme-icon.fa-sun {
  color: #ffd700;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--main-bg);
  overflow-x: hidden;
}

/* Top Navigation Menu */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid var(--border-color);
  z-index: 1001;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.top-nav-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 60px;
  width: 100%;
  position: relative;
}

.top-nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 2rem;
  position: fixed;
  left: calc(var(--sidebar-width) / 2);
  top: 0;
  height: 60px;
  display: flex;
  align-items: center;
  transform: translateX(-50%);
  z-index: 1002;
}

.top-nav-brand a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.top-nav-brand a:hover {
  color: var(--link-color);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  margin-left: auto;
  margin-right: 1rem;
  flex-shrink: 0;
  color: var(--text-color);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.theme-toggle:hover {
  background-color: #f0f0f0;
  border-color: var(--link-color);
}

.theme-toggle i {
  display: block;
}

.top-nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 4px;
  margin-left: 1rem;
  flex-shrink: 0;
}

.top-nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

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

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

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

.top-nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  margin-left: var(--sidebar-width);
  padding-left: 3rem;
}

.top-nav-menu li {
  margin: 0;
  white-space: nowrap;
}

.top-nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color 0.2s ease;
  display: block;
}

.top-nav-menu a:hover {
  color: var(--link-color);
}

.top-nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--link-color);
  transition: width 0.3s ease;
}

.top-nav-menu a:hover::after,
.top-nav-menu a.active::after {
  width: 100%;
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 60px; /* Start below top nav */
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - 60px); /* Adjust height for top nav */
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-content {
  padding: 2rem 1.5rem;
}

.sidebar-profile {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.profile-title {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* Sidebar Info */
.sidebar-info {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.sidebar-info-item {
  font-size: 0.9rem;
  color: var(--text-color);
  margin: 0;
  margin-bottom: 0.75rem;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-info-item:last-child {
  margin-bottom: 0;
}

.sidebar-info-item i {
  color: #666;
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.sidebar-info-item a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-info-item a:hover {
  color: var(--link-color);
}

.sidebar-info-item strong {
  font-weight: 600;
  color: var(--text-color);
}

/* Sidebar Social */
.sidebar-social {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.follow-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.social-icons {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-icons li {
  margin: 0;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-color);
  background-color: #fff;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.social-icons a:hover {
  background-color: var(--link-color);
  color: #fff;
  border-color: var(--link-color);
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: 60px; /* Start below top nav */
  min-height: calc(100vh - 60px);
  padding: 2rem 3rem;
  max-width: none;
  width: calc(100% - var(--sidebar-width));
}

/* Content Sections */
.content-section {
  margin-bottom: var(--section-spacing);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.content-section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.section-content {
  font-size: 1rem;
  line-height: 1.8;
}

.section-content p {
  margin-bottom: 1.25rem;
}

.section-content a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

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

/* Callout Box */
.callout-box {
  background-color: #6bb3ff;
  color: #fff;
  padding: 1.5rem;
  border-radius: 6px;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.callout-box p {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
}

.callout-box a {
  color: #fff;
  text-decoration: underline;
  border-bottom: none;
}

.callout-box a:hover {
  color: #e0e0e0;
  border-bottom: none;
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: 2rem;
  max-width: 100%;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 140px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 132px; /* Centered on timeline line */
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--link-color);
  border: 3px solid var(--main-bg);
  z-index: 1;
  flex-shrink: 0;
}

.timeline-date {
  width: 120px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 1rem;
}

.timeline-range {
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 600;
  display: block;
  white-space: nowrap;
}

.timeline-content {
  flex: 1;
  padding-left: 1rem;
}

.timeline-position {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--link-color);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.timeline-position a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.timeline-position a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.timeline-place {
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 600;
  margin-bottom: 0;
}

.timeline-place a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.timeline-place a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.timeline-location {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0;
  margin-top: 0.25rem;
}

.timeline-status {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* Experience Highlights */
.experience-highlights {
  margin-top: 2rem;
}

.experience-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background-color: #fafafa;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.experience-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.experience-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 6px;
}

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

.experience-content {
  flex: 1;
}

.experience-content h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.experience-role {
  font-weight: 600;
  color: #555;
  margin-bottom: 0.5rem;
}

.experience-details {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.read-more-link {
  display: inline-block;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.read-more-link:hover {
  transform: translateX(4px);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-item {
  padding: 1.5rem;
  background-color: #fafafa;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

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

.project-item h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.project-item p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* Roles List */
.roles-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.role-item {
  display: flex;
  gap: 0.75rem;
  background-color: #fafafa;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  padding: 0.5rem;
  align-items: center;
}

.role-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.role-image {
  flex-shrink: 0;
  width: 140px;
  height: 105px;
  overflow: hidden;
  border-radius: 4px;
}

.role-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.role-item:hover .role-image img {
  transform: scale(1.05);
}

.role-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.role-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--link-color);
}

.role-conference {
  font-size: 0.9rem;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
}

.role-link {
  display: inline-block;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.role-link:hover {
  transform: translateX(4px);
}

/* Teaching List */
.teaching-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.teaching-item {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.teaching-term {
  font-weight: 600;
  color: var(--text-color);
  min-width: 100px;
  flex-shrink: 0;
}

.teaching-course {
  color: var(--text-color);
  flex: 1;
}

/* Publications List */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
  overflow: visible;
}

.publication-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  overflow: visible;
  margin-bottom: 1rem;
}

.publication-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
  line-height: 1.5;
}

.publication-conference {
  font-size: 0.95rem;
  color: #666;
  margin: 0;
  font-style: italic;
}

[data-theme="dark"] .publication-conference {
  color: #999;
}

.publication-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.award-badge {
  display: inline-block;
  background-color: #ffd700;
  color: #333;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

[data-theme="dark"] .award-badge {
  background-color: #ffd700;
  color: #1a1a1a;
}

.poster-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--link-color);
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  height: auto;
  min-width: fit-content;
  box-sizing: border-box;
  background-color: var(--link-color);
}

.poster-download-link:hover {
  background-color: var(--link-hover);
  color: #ffffff !important;
}

[data-theme="dark"] .poster-download-link {
  color: #ffffff !important;
  background-color: var(--link-color);
}

[data-theme="dark"] .poster-download-link:hover {
  color: #ffffff !important;
  background-color: var(--link-hover);
}

/* Contact Info */
.contact-info {
  margin-top: 1rem;
}

.contact-info p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.contact-info strong {
  font-weight: 600;
  color: var(--text-color);
  margin-right: 0.5rem;
}

.contact-info a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-info a:hover {
  border-bottom-color: var(--link-color);
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-color);
  transition: all 0.2s ease;
  margin-right: 1rem;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mobile-menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .top-nav-container {
    padding: 0 1rem;
    padding-left: 1rem;
    max-width: 100%;
  }

  .top-nav-brand {
    position: static;
    transform: none;
    left: auto;
    margin-right: auto;
    font-size: 1.1rem;
    flex: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .top-nav-toggle {
    display: flex;
    order: 3;
  }

  .top-nav-menu {
    gap: 0;
    order: 2;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding-left: 0;
  }

  .top-nav-menu li {
    width: 100%;
  }

  .top-nav-menu a {
    padding: 1rem 2rem;
    width: 100%;
    text-align: left;
  }

  .sidebar {
    top: 60px; /* Still below top nav on mobile */
    height: calc(100vh - 60px);
  }

  .theme-toggle {
    order: 2;
    margin-left: auto;
  }

  .top-nav-toggle {
    display: flex;
  }

  .top-nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--main-bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .top-nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .top-nav-menu li {
    width: 100%;
  }

  .top-nav-menu a {
    display: block;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
  }

  .top-nav-menu a::after {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 5rem;
    width: 100%;
  }

  .role-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .role-image {
    width: 100%;
    height: 180px;
  }

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

  .publication-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .experience-item {
    flex-direction: column;
  }

  .experience-image {
    width: 100%;
    height: 200px;
  }

  .projects-grid,
  .roles-grid,
  .posters-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 15px;
  }

  .timeline-item {
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 2.5rem;
    margin-bottom: 2rem;
  }

  .timeline-item::before {
    left: 7px; /* (15px center - 6px half-width - 2px border) */
    top: 0.4rem;
  }

  .timeline-date {
    width: 100%;
    text-align: left;
    padding-right: 0;
    margin-bottom: 0.1rem;
  }

  .timeline-content {
    padding-left: 0;
  }

  .timeline-range {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem;
    padding-top: 4rem;
  }

  .sidebar-content {
    padding: 1.5rem 1rem;
  }

  .profile-image {
    width: 120px;
    height: 120px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .publication-title {
    font-size: 1rem;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background-color: var(--link-color);
  color: #fff;
}

