/* Modern CSS file for Xiangchun Chen's academic website */

:root {
  --primary-color: #2c5aa0;
  --secondary-color: #3a7bd5;
  --accent-color: #00b4d8;
  --text-color: #2d3748;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow-color: rgba(0,0,0,0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

html {
  background-color: var(--light-bg);
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--light-bg);
  text-align: left;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main layout container */
#layout-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--card-bg);
  box-shadow: 0 10px 30px var(--shadow-color);
  border-radius: 12px;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* Header and profile section */
#layout-content h1:first-child {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  border-bottom: none;
  position: relative;
}

#layout-content h1:first-child::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Profile image styling */
img[src*="xiangchunchen.jpg"] {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--card-bg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  margin-bottom: 1.5rem;
  display: block;
}

/* Section headers */
h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
}

h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--gradient-primary);
}

h3 {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--secondary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: none;
}

/* Paragraphs and text */
p {
  margin-bottom: 1.2rem;
  line-height: 1.7;
  color: var(--text-color);
}

/* Links */
a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

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

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* Unordered lists */
ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
  position: relative;
  background: var(--light-bg);
  padding: 1.2rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

li:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

li::before {
  content: '→';
  position: absolute;
  left: 0.5rem;
  color: var(--accent-color);
  font-weight: bold;
}

/* Publication items */
li:has(font[color="#527bbd"]) {
  border-left-color: #527bbd;
  background: linear-gradient(90deg, rgba(44, 90, 160, 0.05) 0%, rgba(255,255,255,0) 100%);
}

/* Education items */
li:has(font[color="#527bbd"]:contains("Ph.D.")),
li:has(font[color="#527bbd"]:contains("Visiting Scholar")),
li:has(font[color="#527bbd"]:contains("B.E.")) {
  border-left-color: #00b4d8;
  background: linear-gradient(90deg, rgba(0, 180, 216, 0.05) 0%, rgba(255,255,255,0) 100%);
}

/* Card-like styling for publication entries */
ul > li {
  margin-bottom: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

ul > li:hover {
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Publication journal tags */
font[style*="color:#527bbd"] {
  font-weight: 600;
  color: var(--primary-color) !important;
  background: var(--light-bg);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-right: 0.5rem;
}

/* Email and contact info styling */
p:contains("Email:") {
  font-weight: 500;
  color: var(--text-color);
}

p:contains("Email:") b {
  color: var(--primary-color);
}

/* Sponsored by section */
img[src*="polyu.jpg"] {
  max-height: 80px;
  width: auto;
  border-radius: 8px;
  margin-right: 2rem;
  margin-bottom: 1rem;
  filter: grayscale(0.3);
  transition: filter 0.3s ease;
}

img[src*="polyu.jpg"]:hover {
  filter: grayscale(0);
}

/* Responsive design */
@media (max-width: 768px) {
  #layout-content {
    padding: 1.5rem;
    margin: 1rem;
    border-radius: 8px;
  }

  #layout-content h1:first-child {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  img[src*="xiangchunchen.jpg"] {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
  }

  ul > li {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  #layout-content {
    padding: 1rem;
    margin: 0.5rem;
  }

  #layout-content h1:first-child {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#layout-content > * {
  animation: fadeInUp 0.6s ease forwards;
}

#layout-content > *:nth-child(1) { animation-delay: 0.1s; }
#layout-content > *:nth-child(2) { animation-delay: 0.2s; }
#layout-content > *:nth-child(3) { animation-delay: 0.3s; }
#layout-content > *:nth-child(4) { animation-delay: 0.4s; }
#layout-content > *:nth-child(5) { animation-delay: 0.5s; }
#layout-content > *:nth-child(6) { animation-delay: 0.6s; }

/* Smooth scrolling for navigation */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  #layout-content {
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  body {
    background: white;
  }

  a::after {
    display: none;
  }
}