.work-section {
  background-color: var(--bg-color);
  padding: 70px 0;
  text-align: center;
}

.work-section h2 {
  font-size: 2.5rem;
  font-family: var(--heading-font);
  margin-bottom: 20px;
}

/* Category Buttons */
.category-buttons {
  margin-bottom: 50px;
}

.category-button {
  background: rgba(255, 255, 255, 0.304);
  color: var(--text-color);
  padding: 10px 15px;
  margin: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease-in-out;
  font-weight: 600;
}

.category-button.active {
  background: var(--secondary-color);
  color: var(--text-color);
  border: none;
}
.category-button.active:hover {
  background-color: var(--secondary-color);
}
/* Masonry Gallery */
.work-gallery {
  column-count: 3;
  column-gap: 15px;
  max-width: 1050px;
  margin: 0 auto 50px;
  transition: opacity 0.3s ease-in-out;
}

.work-gallery img {
  width: 100%;
  margin-bottom: 15px;
  display: block;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.work-gallery img.fade-in {
  opacity: 1;
  transform: scale(1);
}

/* Fade-out effect when changing images */
.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

/* Fade-in effect when new images load */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.book-btn {
  font-size: 1rem;
  margin-top: 40px;
  text-decoration: none;
}

/* Image Modal when image is clicked */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.modal-image {
  width: auto;
  height: 80vh;
  max-width: 100%;
  border-radius: 8px;
}
.close-btn {
  position: absolute;
  top: 15px;
  right: 10px;
  font-size: 30px;
  color: white;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  opacity: 0.7;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
  opacity: 1;
  transform: scale(1.2);
  outline: none;
}

/* Responsive Design */

@media (max-width: 1400px) {
  .image-modal {
    display: none;
  }
}

@media (max-width: 768px) {
  .work-gallery {
    column-count: 2;
  }
}

@media (max-width: 480px) {
  .work-section {
    background-color: var(--bg-color);
    padding: 20px 0 70px;
    text-align: center;
  }
  .category-buttons {
    display: none; /* Hide category buttons on mobile */
  }

  .work-gallery {
    column-count: 2; /* Single column for mobile */
    margin-bottom: 0;
  }

  .category-section {
    margin-bottom: 40px;
  }

  .category-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    margin-top: 30px;
    text-align: center;
    color: var(--text-color);
  }
  .fade-in,
  .fade-out {
    opacity: 1 !important; /* Ensure images are fully visible instantly */
    animation: none !important; /* Disable fade-in animation */
    transition: none !important; /* Remove transition delays */
  }
  .book-btn {
    margin-top: 10px;
  }
}
