/* --- Project Section (Gallery) --- */
.project-section {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5));
  background-size: cover;
  background-position: center;
  clip-path: polygon(50% 0%, 100% 8%, 100% 92%, 50% 100%, 0% 92%, 0% 8%);
  margin-bottom: -10vh;
  z-index: 3;
  padding: 16vh 0 20vh 0;
}

.project-section h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--text-light);
  text-align: center;
}

.gallery-container {
  width: 100%;
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.main-image-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 2rem;
  border: 5px solid white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative; /* For slide effect */
  aspect-ratio: 16 / 9; /* Set a fixed aspect ratio to define the height */
}

#main-gallery-image {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: opacity 0.3s ease-in-out;
}

.thumbnail-slider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

.thumbnail-track-container {
  overflow: hidden;
  width: 100%;
  max-width: 700px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  backdrop-filter: blur(5px);
  cursor: grab;
}

.thumbnail-track {
  display: flex;
  gap: 10px;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  padding: 5px;
}

.thumbnail {
  width: 80px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  border: 3px solid transparent;
  border-radius: 8px;
  opacity: 0.6;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.thumbnail:hover {
  opacity: 0.9;
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
}

.thumbnail.active {
  opacity: 1;
  border-color: var(--accent-cyan);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 188, 212, 0.4);
}

.arrow {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1; /* Always visible */
  visibility: visible; /* Always visible */
}

.arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

.arrow:active {
  transform: scale(0.95);
}

/* --- Responsive Design for Gallery --- */
@media (max-width: 768px) {
  .project-section {
    clip-path: polygon(50% 0%, 100% 4%, 100% 96%, 50% 100%, 0% 96%, 0% 4%);
    padding: 12vh 0 16vh 0;
  }

  .project-section h2 {
    font-size: 2rem;
  }

  .main-image-wrapper {
    margin: 0 auto 1.5rem;
    border-width: 3px;
  }

  .thumbnail-slider {
    gap: 0.5rem;
  }

  .thumbnail-track-container {
    max-width: 500px;
  }

  .thumbnail {
    width: 60px;
    height: 45px;
    border-width: 2px;
  }

  .arrow {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .project-section {
    padding: 10vh 0 14vh 0;
  }

  .thumbnail-slider {
    flex-direction: row; /* Keep it horizontal */
    gap: 0.5rem;
  }

  .arrow {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .thumbnail-track-container {
    width: 100%;
    max-width: none;
  }

  .thumbnail {
    width: 50px;
    height: 40px;
  }
}
