/* ========================================
   Main Stylesheet - Tianshi Xu's Academic Website
   ======================================== */

/* =============== Variables =============== */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --accent-color: #3498db;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --info-color: #9b59b6;
  
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --text-white: #fff;
  
  --bg-primary: #fafafa;
  --bg-white: #fff;
  --bg-light: #f8f9fa;
  --bg-dark: #2c3e50;
  
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 5px rgba(0,0,0,0.08);
  --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  
  --font-primary: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;
  
  --container-width: 1200px;
  --header-height: 70px;
  --transition: all 0.3s ease;
}

/* =============== Reset & Base =============== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============== Typography =============== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: 2.5rem;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

h2 {
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

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

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

strong {
  font-weight: 600;
  color: var(--primary-color);
}

em {
  font-style: italic;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* =============== Layout =============== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.page-content {
  min-height: calc(100vh - var(--header-height));
  padding: 3rem 0;
}

.section {
  background: var(--bg-white);
  margin-bottom: 2rem;
  padding: 3rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

/* =============== Header & Navigation =============== */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--text-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  gap: 3rem;  /* Add gap between logo and navigation */
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-white);
  text-decoration: none;
  margin-right: 2rem;  /* Additional spacing from nav links */
}

.logo:hover {
  text-decoration: none;
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
  margin-left: auto;  /* Push nav links to the right */
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: var(--text-white);
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

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

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-color);
  text-decoration: none;
}

/* =============== Mobile Menu =============== */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* =============== Profile Section =============== */
.profile-container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 2rem;
}

.profile-image {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

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

.profile-info h1 {
  margin-bottom: 0.5rem;
  border: none;
  font-size: 2.8rem;
  padding: 0;
}

.profile-info .title {
  font-size: 1.3rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.profile-info .affiliation {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.profile-info .contact-info {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* =============== Buttons =============== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

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

.btn-primary:hover {
  background: #2980b9;
  text-decoration: none;
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #95a5a6;
  color: var(--text-white);
}

.btn-secondary:hover {
  background: #7f8c8d;
  text-decoration: none;
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--success-color);
  color: var(--text-white);
}

.btn-outline:hover {
  background: #229954;
  color: var(--text-white);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  text-align: center;
}

/* =============== Cards =============== */
.card {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  transition: var(--transition);
  margin-bottom: 1rem;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.card-content {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* =============== Grid Layouts =============== */
.grid {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* =============== Research Interests =============== */
.research-interests {
  margin: 2rem 0;
}

.research-list {
  list-style: none;
  padding: 0;
}

.research-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.research-list li:last-child {
  border-bottom: none;
}

.research-list li::before {
  content: "▸";
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-right: 1rem;
}

/* =============== News Section =============== */
.news-section {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 10px;
  margin: 2rem 0;
}

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

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

.news-date {
  display: inline-block;
  background: var(--accent-color);
  color: var(--text-white);
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 1rem;
  width: 85px;
  text-align: center;
  box-sizing: border-box;
  vertical-align: top;
}

.news-content {
  display: inline;
  color: var(--text-primary);
}

/* =============== Publications =============== */
.publication {
  background: var(--bg-light);
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 8px;
  border-left: 4px solid var(--success-color);
  transition: var(--transition);
}

.publication:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.publication-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.publication-authors {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.publication-venue {
  color: var(--success-color);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.publication-links {
  margin-top: 0.5rem;
}

.publication-links a {
  margin-right: 1rem;
  font-size: 0.9rem;
}

/* =============== Footer =============== */
footer {
  background: var(--bg-dark);
  color: var(--text-white);
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--accent-color);
}

/* =============== Utilities =============== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }

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

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

/* =============== Print Styles =============== */
@media print {
  header, footer, .btn, .mobile-menu-toggle {
    display: none;
  }
  
  .section {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}