:root {
  --bg-color: #ffffff;
  --text-color: #222;
  --highlight-color: #6d28d9;
  --font: "IBM Plex Mono", monospace;
  --update-color: #f8f8f800;
  --paper-color: #f8f8f800;
  --project-color: #f8f8f800;
}

[data-theme="dark"] {
  --bg-color: #1e1e1e;
  --text-color: #f0f0f0;
  --highlight-color: #8b5cf6;
  /* Dark mode overrides for section backgrounds */
  --update-color: #444;
  --paper-color: #444;
  --project-color: #444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font);
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  padding: 20px;
  transition:
    background 0.3s,
    color 0.3s;
  animation: fadeIn 0.5s ease-out forwards;
}

.nav {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 900px;
  margin: auto;
  padding: 30px 20px;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 10px;
  border-radius: 50px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.nav-links:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-links a:hover {
  color: var(--highlight-color);
  background: rgba(109, 40, 217, 0.08);
}

.nav-links a.active {
  background: var(--highlight-color);
  color: white;
  box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
}

.theme-toggle {
  position: absolute;
  right: 20px;
  cursor: pointer;
  font-size: 22px;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: rotate(15deg) scale(1.1);
}

/* Dark mode overrides */
[data-theme="dark"] .nav-links {
  background: rgba(30, 30, 30, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .nav-links a:hover {
  background: rgba(139, 92, 246, 0.15);
  color: var(--highlight-color);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  color: #fbbf24; /* Sun color */
}

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

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 20px;
    padding-top: 20px;
  }

  .theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
  }

  .nav-links {
    flex-wrap: wrap;
    width: 100%;
    border-radius: 20px;
  }
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 15px; /* Space between logo and text */
  justify-content: center; /* Center alignment */
  margin-bottom: 10px;
}

.profile-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--highlight-color);
  box-shadow: 0 0 20px rgba(109, 40, 217, 0.3);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.profile-logo:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 0 30px rgba(109, 40, 217, 0.5);
}

.profile-name {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 5px;
}

.profile-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-color); /* Matches theme */
  border: none;
  margin: 5px 0;
}

.profile-tagline {
  font-size: 14px;
  font-style: italic;
  color: var(--highlight-color);
  margin-top: 5px;
}

.profile {
  max-width: 900px;
  margin: 40px auto;
  text-align: left;
}

.profile img {
  width: 50px;
  height: 50px;
}

.profile h1 {
  font-size: 32px;
  font-weight: bold;
  margin-top: 10px;
}

.profile p {
  font-size: 16px;
  margin-top: 10px;
  line-height: 1.6;
}

.highlight {
  color: var(--highlight-color);
  text-decoration: none;
  font-weight: bold;
}

.reading-list {
  margin-top: 30px;
}

.reading-list h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.reading-list ul {
  list-style-type: none;
}

.reading-list li {
  margin: 5px 0;
}

.reading-list a {
  color: var(--highlight-color);
  text-decoration: none;
}

.image-section {
  max-width: 900px;
  margin: 30px auto;
}

.image-section img {
  width: 100%;
  border-radius: 6px;
}

.ongoing {
  max-width: 900px;
  margin: 30px auto;
}

.ongoing h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.ongoing ul {
  list-style-type: none;
  padding-left: 0;
}

.ongoing li {
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ongoing li::before {
  content: "⚙️";
}

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .profile h1 {
    font-size: 28px;
  }
}

/* Updates, Papers, Projects Sections */
.updates,
.papers,
.projects {
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
  border-radius: 8px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.updates:hover,
.papers:hover,
.projects:hover {
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.25),
    0 10px 10px rgba(0, 0, 0, 0.22);
}

.updates {
  background-color: var(--update-color);
}
.papers {
  background-color: var(--paper-color);
}
.projects {
  background-color: var(--project-color);
}

.updates h2,
.papers h2,
.projects h2 {
  font-size: 24px;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--text-color);
  padding-bottom: 5px;
}

.updates ul,
.papers ul,
.projects ul {
  list-style-type: none;
  padding-left: 0;
}

/* Common styling for item blocks */
.update-item,
.paper-item,
.project-item {
  margin: 15px 0;
  padding: 10px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.85);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.update-item:hover,
.paper-item:hover,
.project-item:hover {
  transform: translateY(-3px) translateX(5px);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.15);
}

/* Enhanced paper item animations */
.paper-item {
  border-left: 3px solid transparent;
  margin-bottom: 30px;
}

.paper-item:hover {
  border-left-color: var(--highlight-color);
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 32px rgba(109, 40, 217, 0.2);
}

/* Enhanced project item animations */
.project-item {
  border: 1px solid rgba(109, 40, 217, 0.1);
}

.project-item:hover {
  border-color: var(--highlight-color);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 40px rgba(109, 40, 217, 0.25);
}

.project-item:hover .project-image {
  transform: scale(1.1) rotate(3deg);
}

.update-item .date {
  font-weight: bold;
  margin-right: 10px;
}

/* Year and Venue Badge Styling */
.paper-item .year-badge {
  display: inline-block;
  font-weight: 700;
  color: white;
  background: var(--highlight-color);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  margin-right: 12px;
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
}

[data-theme="dark"] .paper-item .year-badge {
  background: var(--highlight-color);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.35);
}

.paper-item .title {
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: color 0.3s ease;
}

.paper-item .title:hover {
  color: var(--highlight-color);
}

.paper-item .venue-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 14px;
  background: rgba(109, 40, 217, 0.1);
  color: var(--highlight-color);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(109, 40, 217, 0.2);
}

[data-theme="dark"] .paper-item .venue-badge {
  background: rgba(139, 92, 246, 0.15);
  color: var(--highlight-color);
  border-color: rgba(139, 92, 246, 0.3);
}

.project-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 5px;
  transition: transform 0.2s ease-in-out;
}

.project-item:hover {
  transform: translateX(5px);
}

.project-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.15);
}

.project-content {
  flex: 1;
}

.project-content h3 {
  font-size: 20px;
  margin-bottom: 5px;
}

.project-content p {
  font-size: 16px;
  margin-bottom: 10px;
}

.project-link {
  display: inline-block;
  padding: 5px 10px;
  background-color: var(--highlight-color);
  color: white;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.2s ease-in-out;
}

.project-link:hover {
  background-color: #5b21b6;
}

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

/* Social Links */
.social-links {
  display: flex;
  justify-content: center; /* Center align */
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  border: 2px solid rgba(109, 40, 217, 0.2);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.1);
}

.social-icon img {
  width: 20px;
  height: 20px;
  filter: invert(10%) sepia(100%) saturate(0%) brightness(0%) contrast(100%);
  transition: filter 0.3s ease;
}

/* Adapt social icons for dark/light themes */
[data-theme="dark"] .social-icon img {
  filter: invert(100%) sepia(0%) saturate(0%) brightness(200%) contrast(100%);
}

[data-theme="dark"] .social-icon {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

/* Enhanced Hover effect with animation */
.social-icon:hover {
  transform: translateY(-5px) scale(1.1);
  background: var(--highlight-color);
  border-color: var(--highlight-color);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.3);
}

.social-icon:hover img {
  filter: invert(100%) brightness(200%);
}

/* Default link styling */
p a {
  text-decoration: none;
  font-weight: bold;
}

/* Color-specific link styling */
p a[href*="dgist.ac.kr"] {
  color: #6d28d9;
} /* Purple for DGIST */
p a[href*="yu.ac.kr"] {
  color: #d97706;
} /* Amber for Yeungnam University */
p a[href*="kangwon.ac.kr"] {
  color: #059669;
} /* Green for Kangwon University */
p a[href*="x-up-lab.github.io"] {
  color: #ef4444;
} /* Red for Xiatian Zhu’s Lab */
p a[href*="wixsite.com"] {
  color: #2563eb;
} /* Blue for Professor Kim Sungho */
p a[href*="drdo.gov.in"],
p a[href*="drl.drdo.gov.in"] {
  color: #dc2626;
} /* Deep Red for DRDO */

/* Hover effect for links */
p a:hover {
  filter: brightness(1.2);
}

/* Dark mode overrides for item backgrounds to ensure visibility */
[data-theme="dark"] .updates .update-item {
  background-color: #444; /* Contrast against var(--update-color) */
}

[data-theme="dark"] .papers .paper-item {
  background-color: #555; /* Contrast against var(--paper-color) */
}

[data-theme="dark"] .projects .project-item {
  background-color: #666; /* Contrast against var(--project-color) */
}

/* ============================================
   Creative Updates Section with Toggle
   ============================================ */

.updates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.updates-toggle {
  display: flex;
  gap: 10px;
  background: rgba(109, 40, 217, 0.1);
  padding: 4px;
  border-radius: 25px;
  border: 1px solid rgba(109, 40, 217, 0.2);
}

[data-theme="dark"] .updates-toggle {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
}

.toggle-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

.toggle-btn.active {
  background: var(--highlight-color);
  color: white;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}

[data-theme="dark"] .toggle-btn.active {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Update item animations */
.update-item {
  opacity: 1;
  max-height: 200px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-item[style*="display: none"] {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
}

/* Add timeline indicator for updates */
.update-item::before {
  content: "📌";
  margin-right: 10px;
  font-size: 14px;
  opacity: 0.7;
}

.update-item[data-category="archive"]::before {
  content: "📁";
}

/* Archive updates styling - muted colors */
.update-item[data-category="archive"] {
  background-color: rgba(128, 128, 128, 0.15) !important;
  border-left-color: rgba(128, 128, 128, 0.4);
}

.update-item[data-category="archive"] .date {
  color: rgba(128, 128, 128, 0.8) !important;
}

.update-item[data-category="archive"] .content {
  color: rgba(128, 128, 128, 0.7) !important;
}

[data-theme="dark"] .update-item[data-category="archive"] {
  background-color: rgba(100, 100, 100, 0.2) !important;
}

[data-theme="dark"] .update-item[data-category="archive"] .date {
  color: rgba(180, 180, 180, 0.7) !important;
}

[data-theme="dark"] .update-item[data-category="archive"] .content {
  color: rgba(160, 160, 160, 0.6) !important;
}

/* Conference Timeline */
.conference-timeline {
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
  border-radius: 8px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background-color: var(--paper-color);
}

.conference-timeline:hover {
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.25),
    0 10px 10px rgba(0, 0, 0, 0.22);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.timeline-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid rgba(109, 40, 217, 0.2);
  background: transparent;
  color: var(--text-color);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  border-radius: 15px;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--highlight-color);
  color: white;
  border-color: var(--highlight-color);
}

.timeline-container {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid rgba(109, 40, 217, 0.3);
  margin-left: 10px;
}

.timeline-month {
  margin-top: 25px;
  margin-bottom: 15px;
  font-weight: bold;
  font-size: 18px;
  color: var(--highlight-color);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timeline-month::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--highlight-color);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-color); /* Gap effect */
}

.timeline-item {
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.timeline-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-left-color: var(--highlight-color);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .timeline-item {
  background: rgba(60, 60, 60, 0.4);
}
[data-theme="dark"] .timeline-item:hover {
  background: rgba(80, 80, 80, 0.8);
}

.conf-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.conf-acronym {
  font-weight: bold;
  font-size: 16px;
  color: var(--text-color);
}

.conf-date {
  font-size: 13px;
  font-weight: bold;
  color: var(--highlight-color);
}

.conf-name {
  font-size: 13px;
  color: var(--text-color);
  opacity: 0.8;
  display: block;
  margin-top: 4px;
  line-height: 1.4;
}

.conf-meta {
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.conf-domain {
  background: rgba(109, 40, 217, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--highlight-color);
  font-weight: 500;
}

[data-theme="dark"] .conf-domain {
  background: rgba(139, 92, 246, 0.2);
}

.conf-rating {
  font-weight: bold;
  color: #e67e22; /* Orange for rating */
}

.conf-tba {
  color: #e67e22;
  font-size: 11px;
  border: 1px solid #e67e22;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 5px;
}

.conf-abstract {
  font-size: 11px;
  color: var(--text-color);
  opacity: 0.7;
}

/* Floating Timeline Button */
.floating-timeline-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--highlight-color);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
  z-index: 1000;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-timeline-btn::before {
  content: "📅";
  font-size: 16px;
}

.floating-timeline-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.6);
  background: #5b21b6; /* Darker shade */
}

[data-theme="dark"] .floating-timeline-btn {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .floating-timeline-btn:hover {
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
}

/* Typing Animation */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--highlight-color);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
  display: inline-block;
  max-width: 100%;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--highlight-color) }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Profile Image Pulse */
.profile-logo {
  animation: pulse-border 3s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(109, 40, 217, 0); }
  100% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0); }
}

/* Hover Card Effect */
.paper-item, .project-item, .update-item {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.paper-item:hover, .project-item:hover, .update-item:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
