/* ===================================
   Simple, Clean Design
   =================================== */

:root {
  /* Light Mode */
  --color-primary: #0066cc;
  --color-text: #333;
  --color-text-light: #666;
  --color-bg: #fff;
  --color-border: #ddd;
}

[data-theme="dark"] {
  --color-primary: #4da3ff;
  --color-text: #e0e0e0;
  --color-text-light: #999;
  --color-bg: #1a1a1a;
  --color-border: #444;
}

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

html {
  font-size: 16px;
}

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

/* Typography */
h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

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

/* Navigation */
.main-nav {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  background-color: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-text);
}

.nav-link.active {
  color: var(--color-primary);
  font-weight: 500;
}

.nav-toggle {
  display: none;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.9rem;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
}

/* Main Content */
.main-content {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

/* Profile Picture */
.profile-picture {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: block;
  border: 2px solid var(--color-border);
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero-subtitle {
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.hero-bio {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--color-text);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}

/* Contact Section */
.contact-section {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
}

.contact-info {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-icon {
  width: 28px;
  height: 28px;
  opacity: 0.7;
}

.social-link:hover .social-icon {
  opacity: 1;
}

/* Projects */
.projects-grid {
  margin: 2rem 0;
}

.project-card {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.project-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 4px;
  margin: 0 auto 1rem;
  display: block;
}

.project-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.project-description {
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

/* Patents */
.patents-section {
  margin-top: 3rem;
}

.publication-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.publication-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--color-text);
  flex: 1;
  min-width: 280px;
}

.publication-link:hover {
  border-color: var(--color-primary);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.publication-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Chart Styles */
.chart-container {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 8px;
}

.chart-title {
  margin: 0 0 1rem;
  color: var(--color-text);
  font-size: 1.1rem;
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.legend-color-patents {
  background: #17a2b8;
}

.legend-color-citations {
  background: #ffc107;
}

.combo-chart {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.chart-svg {
  width: 100%;
  height: auto;
  min-height: 300px;
}

/* Resume - Vertical Timeline */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.resume-section {
  margin-bottom: 3rem;
}

/* Timeline Legend */
.timeline-legend {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid;
}

.experience-dot {
  border-color: var(--color-primary);
}

.education-dot {
  border-color: #28a745;
}

.timeline-vertical {
  position: relative;
  padding-left: 120px;
  padding-right: 120px;
}

/* Dim wavy line when hovering or clicking */
.timeline-vertical:has(.timeline-item:hover) .timeline-wavy-line,
.timeline-vertical:has(.timeline-item.active) .timeline-wavy-line {
  opacity: 0.5;
}

/* Dim wavy line when hovering or clicking */
.timeline-vertical:has(.timeline-item:hover) .timeline-wavy-line path,
.timeline-vertical:has(.timeline-item.active) .timeline-wavy-line path {
  opacity: 0.3;
  transition: opacity 0.3s;
}

.timeline-wavy-line path {
  transition: opacity 0.3s;
}

/* Dim all items when one is hovered or active */
.timeline-vertical:has(.timeline-item:hover) .timeline-item:not(:hover),
.timeline-vertical:has(.timeline-item.active) .timeline-item:not(.active) {
  opacity: 0.4;
  transition: opacity 0.3s;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: stretch;
  z-index: 5;
}

.timeline-left {
  position: absolute;
  left: -120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  height: 100%;
  top: 0;
}

.timeline-dot {
  width: 80px;
  height: 80px;
  background: var(--color-bg);
  border: 4px solid var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
  position: relative;
  flex-shrink: 0;
  margin-top: 0.5rem;
  margin-bottom: auto;
}

.timeline-dot::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 3px;
  background: var(--color-primary);
  transition: all 0.3s;
}

.timeline-item:hover .timeline-dot::after,
.timeline-item.active .timeline-dot::after {
  width: 50px;
  height: 4px;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.15);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  border-width: 6px;
}

.timeline-item.active .timeline-dot {
  transform: scale(1.15);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  border-width: 6px;
}

.timeline-item:hover .timeline-year {
  font-weight: 900;
  transform: scale(1.05);
}

.timeline-item.active .timeline-year {
  font-weight: 900;
  transform: scale(1.05);
}

.timeline-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--color-bg);
  padding: 5px;
  overflow: hidden;
}

.timeline-year {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  transition: all 0.3s;
  background: var(--color-bg);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.timeline-year-end {
  order: -1;
  margin-bottom: 0;
}
  transition: all 0.3s;
  background: var(--color-bg);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.timeline-year-end {
  align-self: flex-start;
  order: -1;
}

.timeline-details {
  background: var(--color-bg);
  border: 2px solid var(--color-primary);
  border-radius: 8px;
  padding: 1.2rem;
  transition: all 0.3s;
  width: 500px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
  opacity: 1;
  pointer-events: auto;
  z-index: 6;
}

.timeline-item:hover .timeline-details {
  border-width: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.timeline-item.active .timeline-details {
  border-width: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.timeline-details h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.detail-company {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.detail-date {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 0.8rem;
}

.detail-description {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: 0;
}

.timeline-details ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--color-text);
}

.timeline-details li {
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

/* Education Items on the Right */
.education-right {
  flex-direction: row-reverse;
}

.education-right .timeline-left {
  left: auto;
  right: -120px;
  flex-direction: column;
  top: 0;
  transform: none;
}

.education-right .timeline-dot {
  border-color: #28a745;
}

.education-right .timeline-dot::after {
  left: auto;
  right: 100%;
  transform: translateY(-50%) scaleX(-1);
  background: #28a745;
}

.education-right .timeline-year {
  position: relative;
  left: auto;
  right: auto;
  color: #28a745;
  border-color: #28a745;
}

.education-right .timeline-details {
  margin-left: 0;
  margin-right: 0;
  border-color: #28a745;
  background: var(--color-bg);
}

.education-right .detail-company {
  color: #28a745;
}

.education-item .detail-description {
  color: var(--color-text-light);
}

/* Education Items */
.education-item .timeline-dot {
  border-color: #28a745;
}

.education-item .timeline-dot::after {
  background: #28a745;
}

.education-item .timeline-year {
  color: #28a745;
  border-color: #28a745;
}

.education-item .timeline-details {
  border-color: #28a745;
}

.education-item .detail-company {
  color: #28a745;
}

.education-item:hover .timeline-dot,
.education-item.active .timeline-dot {
  transform: scale(1.15);
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
  border-width: 6px;
}

.education-item:hover .timeline-dot::after,
.education-item.active .timeline-dot::after {
  width: 50px;
  height: 4px;
}

.education-item:hover .timeline-year,
.education-item.active .timeline-year {
  font-weight: 900;
  transform: scale(1.05);
}

.education-item:hover .timeline-details,
.education-item.active .timeline-details {
  border-width: 3px !important;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.25) !important;
  transform: translateY(-2px) !important;
}

.education-item:hover .detail-company,
.education-item.active .detail-company {
  font-weight: 700 !important;
}

.detail-description {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: 0;
}

/* AWS Sub-roles */
.sub-role {
  margin-top: 0.8rem;
  padding: 0.8rem;
  background: rgba(0, 102, 204, 0.03);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  position: relative;
}

[data-theme="dark"] .sub-role {
  background: rgba(77, 163, 255, 0.08);
}

.sub-role::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

/* Keep blue color scheme for all sub-roles (they are all experience/internships) */
.education-item .sub-role {
  background: rgba(0, 102, 204, 0.03);
  border-left-color: var(--color-primary);
}

[data-theme="dark"] .education-item .sub-role {
  background: rgba(77, 163, 255, 0.08);
}

.education-item .sub-role::before {
  background: var(--color-primary);
}

.sub-role h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sub-role-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.sub-role-date {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.sub-role ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
}

.sub-role li {
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.skill-tag {
  padding: 0.4rem 0.8rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Updates */
.updates-section,
.talks-section {
  margin-bottom: 3rem;
}

.updates-list,
.talks-list {
  margin-top: 1.5rem;
}

.update-item,
.talk-item {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.update-item:hover,
.talk-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.update-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--color-text);
}

.update-link:hover {
  text-decoration: none;
}

.link-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.update-item h3,
.talk-item h3 {
  font-size: 1rem;
  margin: 0;
}

.update-link h3 {
  color: var(--color-text);
  transition: color 0.2s;
}

.update-link:hover h3 {
  color: var(--color-primary);
}

/* Footer */
.main-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 768px) {
  .nav-right {
    flex-direction: column;
    gap: 1rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
}
