.filter-container {
  margin-top: 40px;
  padding-top: 30px; 
  padding-bottom: 15px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* Gallery Items */
.item {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: block;
  cursor: pointer;
}

.item.hide-animate {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.item.hidden {
  display: none;
}

.item img {
  width: 100%;
  transition: transform 0.3s ease;
  display: block;
  border-radius: 4px;
}

.item:hover img {
  transform: scale(1.05);
}


.item:hover video {
  transform: scale(1.05);
}

.title {
  margin-top: 10px;
  text-align: center;
  font-weight: 400;
  font-size: 12.5px;
}

.item video {
  width: 100%;
  border-radius: 4px;
  transition: transform 0.3s ease;
  display: block;
  object-fit: cover;
}

/* Button styles */
.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.button {
  padding: 10px 20px;
  background-color: #c8d1d8;
  color: #000000;
  font-weight: 600;
  text-transform: uppercase;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 14px;
  flex: 1 1 auto;
  max-width: 200px;
  text-align: center;
}

.button.active,
.button:hover {
  background-color: #1B68A8;
  color: #fff;
}

/* Subcategory */
.subcategory-group {
  display: none;
  flex-wrap: wrap;
  gap: 20px;
}

.subcategory {
  cursor: pointer;
  text-align: center;
  padding: 10px;
  font-weight: 400;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.3s ease, color 0.3s ease;
}

.subcategory:hover {
  color: #1B68A8;
}

.subcategory.active {
  border-bottom: 1px solid #1B68A8;
  color: #1B68A8;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .subcategory-group {
    gap: 16px;
    padding: 0 8px;
  }

  .subcategory {
    font-size: 13px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .subcategory-group {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .subcategory {
    width: 100%;
    max-width: 280px;
  }
}


/* Popup Styles */
.popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  text-align: center;
  overflow: auto;
  overflow-y: auto;
  flex:1;
}

.popup-content > * {
  max-width: 100%;
  box-sizing: border-box;
}

.popup-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

#lightbox-title {
  background: #f9f9f9;
  padding: 0.75rem;
  font-weight: 500;
  font-size: 16px;
  text-align: center;
  border-top: 1px solid #ccc;
  flex-shrink: 0;
  z-index: 1;
}

/* Popup Controls */
.popup-close,
.popup-prev,
.popup-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  z-index: 2;
  transition: background 0.2s ease;
}

.popup-content-wrapper {
  background: white;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}

.popup-close {
  top: 10px;
  right: 10px;
}

.popup-prev {
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}

.popup-next {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.popup-close:hover,
.popup-prev:hover,
.popup-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
  .button-group {
    flex-wrap: wrap;
  }

  .button {
    flex: 1 1 45%;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 480px) {
  .button {
    flex: 1 1 100%;
    font-size: 13px;
    padding: 10px;
  }

  .popup-content {
    max-width: 95vw;
    max-height: 95vh;
    padding: 0.5rem;
  }
}