/* Judging Gallery Styles */

.bg {
  background-image: url("../asset/background.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
}

/* Gallery Styles */
.gallery-container {
  min-height: 50vh;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

/* Simple fade-in animation for gallery items */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  aspect-ratio: 4/3;
  background: rgba(128, 120, 197, 0.15);
  cursor: pointer;
  will-change: transform;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow:
    0 -20px 50px rgba(128, 120, 197, 0.4),
    0 0 40px rgba(128, 120, 197, 0.5),
    0 0 80px rgba(128, 120, 197, 0.25);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: opacity 0.3s ease;
}

.gallery-item:hover img {
  opacity: 0.95;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  background: linear-gradient(
    to top,
    rgba(99, 87, 171, 0.95) 0%,
    rgba(128, 120, 197, 0.85) 60%,
    transparent 100%
  );

  padding: 1rem;
  padding-top: 2rem;

  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-overlay h5 {
  color: #E0DBFF;
  /* font-family: 'Lemon Milk', sans-serif; */
  font-size: 0.9rem;
  margin: 0;
}

.gallery-overlay p {
  color: white;
  /* font-family: 'Lemon Milk', sans-serif; */
  font-size: 0.75rem;
  margin: 0.25rem 0 0;
}


/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  flex-wrap: wrap;

  background-color: rgba(128, 120, 197, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border: 1px solid rgba(224, 219, 255, 0.2);
  border-radius: 20px;

  margin: 1rem auto;
  max-width: 80vw;
}

.pagination button {
  padding: 0.75rem 1.5rem;

  background: rgba(128, 120, 197, 0.15);
  color: white;

  border: 1px solid rgba(224, 219, 255, 0.25);
  border-radius: 12px;

  cursor: pointer;
  transition: all 0.3s ease;

  /* font-family: 'Lemon Milk', sans-serif; */
  font-size: 0.9rem;
}

.pagination button:hover:not(:disabled) {
  background: rgba(128, 120, 197, 0.35);

  border-color: rgba(224, 219, 255, 0.5);

  transform: translateY(-2px);

  box-shadow:
    0 0 12px rgba(128, 120, 197, 0.5);
}

.pagination button.active {
  background: #8078C5;

  border-color: #E0DBFF;

  color: white;

  box-shadow:
    0 0 20px rgba(128, 120, 197, 0.6);
}

/* Page info text */
.pagination .page-info {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  padding: 0 0.5rem;
}

/* Pagination dots */
.pagination-dots {
  color: rgba(255, 255, 255, 0.4);
  font-size: 1rem;
  padding: 0 0.25rem;
}

/* Mobile pagination styles */
@media (max-width: 768px) {
  .pagination {
    gap: 0.35rem;
    padding: 0.7rem 0.4rem;
    max-width: 94vw;
  }
  
  .pagination button {
    padding: 0.4rem 0.55rem;
    font-size: 0.68rem;
    min-width: 34px;
    border-radius: 8px;
  }
  
  .pagination-dots {
    padding: 0 0.08rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .pagination {
    gap: 0.25rem;
    padding: 0.55rem 0.35rem;
    max-width: 97vw;
  }
  
  .pagination button {
    padding: 0.3rem 0.4rem;
    font-size: 0.62rem;
    min-width: 30px;
    border-radius: 6px;
  }
  
  .pagination-dots {
    padding: 0 0.05rem;
    font-size: 0.68rem;
  }
}

/* Filter Buttons */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;

  background: rgba(128, 120, 197, 0.15);

  color: white;

  border: 2px solid rgba(224, 219, 255, 0.15);

  border-radius: 20px;

  cursor: pointer;

  transition: all 0.3s ease;

  /* font-family: 'Poppins SemiBold', sans-serif !important; */
}

.filter-btn:hover {
  background: rgba(128, 120, 197, 0.35);

  border-color: #E0DBFF;

  box-shadow:
    0 0 15px rgba(128, 120, 197, 0.4);
}

.filter-btn.active {
  background: #8078C5;

  border-color: #E0DBFF;

  box-shadow:
    0 0 20px rgba(128, 120, 197, 0.6);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  padding: 2rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  display: block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  max-height: calc(90vh - 80px);
  height: auto;
  border-radius: 12px;
}

.modal-close {
  background: #8078C5;
  color: white;
  border: none;
  border-radius: 12px;
}

.modal-nav {
  background: rgba(128, 120, 197, 0.9);
  color: white;
  border: none;
  border-radius: 16px;
}

.modal-prev,
.modal-next {
  background: rgba(128, 120, 197, 0.9) !important;
}

@media (max-width: 768px) {
  .modal-nav {
    padding: 0.5rem;
    font-size: 1.2rem;
  }
  
  .modal-prev {
    left: 10px;
  }
  
  .modal-next {
    right: 10px;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
  }
}

@media (min-width: 769px) {
  .modal-prev,
  .modal-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001; 
    padding: 1rem;
    font-size: 1.5rem;
    background: rgba(119,166,150,0.9);
    border-radius: 8px;
  }

  .modal-prev {
    left: 20px;
  }

  .modal-next {
    right: 20px;
  }
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 2rem;
  color: #E0DBFF;
  font-size: 1.2rem;
}

/* Lazy load placeholder */
img[data-src] {
  filter: blur(10px);
  transition: filter 0.3s;
}

img.loaded {
  filter: blur(0);
}
