/* Basic style reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333;
  padding-top: 60px; /* Reserve space for fixed navigation bar */
}

/* Navigation bar style */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #333;
  padding: 1rem;
  z-index: 100;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

nav a:hover {
  color: #4CAF50;
}

/* General section style */
section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

section h1, 
section h2 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: #2c3e50;
}

section h3 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1.5rem;
  color: #2c3e50;
  text-align: center;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 0.8rem;
}

section h4 {
  font-size: 1.2rem;
  margin: 1.2rem 0 1rem;
  color: #34495e;
  text-align: center;
}

section h5 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: #2c3e50;
}

section p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Home section style */
#home {
  text-align: center;
  padding: 5rem 2rem;
  background-color: #f8f9fa;
}

#home h1 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  line-height: 1.4;
}

/* Abstract section style */
#abstract {
  background-color: white;
}

#abstract p {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.8;
}

#abstract figure {
  margin: 2rem auto;
  text-align: center;
}

#abstract img {
  max-width: 70%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#abstract figcaption {
  margin-top: 0.5rem;
  font-style: italic;
  color: #666;
}

/* Samples section style */
#samples {
  background-color: #f8f9fa;
  padding-bottom: 5rem;
}

.demo {
  margin-bottom: 3rem;
  padding: 2rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.demo:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Video group layout - Ensure adaptive number of videos per row */
.video-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Minimum column width 300px */
  gap: 2rem;
  margin-top: 1rem;
  justify-items: center; /* Center video containers in grid */
}

/* Video container - Force uniform size */
.video-item {
  text-align: center;
  width: 300px; /* Fixed width */
  height: 220px; /* Fixed height (including title space) */
  padding: 0.5rem;
}

/* Video tag - Uniform display size */
video {
  width: 100%;
  height: 180px; /* Fixed video playback area height */
  object-fit: cover; /* Maintain aspect ratio and fill container (crop overflow) */
  /* To display the entire video completely (may leave black bars), replace with: object-fit: contain; */
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}

video:hover {
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.disclaimer {
  margin-top: 3rem;
  text-align: center;
  color: #7f8c8d;
  font-style: italic;
  padding: 0 1rem;
}

/* Adjust only the size of Demo1 result analysis image */
figure.demo1-analysis img {
  max-width: 60%; /* Adjustable as needed, slightly smaller than other images */
  height: auto;
}

/* Responsive adjustment - Small screen adaptation */
@media (max-width: 768px) {
  #home h1 {
    font-size: 1.5rem;
  }
  
  nav ul {
    gap: 1rem;
  }
  
  .video-group {
    grid-template-columns: 1fr; /* Single column display */
  }
  
  .video-item {
    width: 260px; /* Reduce container width on small screens */
    height: 200px;
  }
  
  video {
    height: 160px; /* Reduce video height on small screens */
  }
  
  section {
    padding: 2rem 1rem;
  }
  
  section h3 {
    font-size: 1.3rem;
  }
  
  section h4 {
    font-size: 1.1rem;
  }
  
  #abstract img {
    max-width: 90%;
  }
}