/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
}

.font-brand {
  font-family: 'Montserrat', Arial, sans-serif;
  letter-spacing: 1.5px;
}

.glass {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}

/* Navbar Styles */
.main-header {
  transition: transform 0.3s ease-out;
}

.main-header.hidden-nav {
  transform: translateY(-100%);
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  background-color: #2563eb;
  color: white;
  padding: 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
  z-index: 100;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background-color: #1d4ed8;
  transform: translateY(-3px);
}

/* Gallery Styles */
.gallery-item {
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.03);
}

/* Modal Styles */
#galleryModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#galleryModal.active {
  opacity: 1;
  visibility: visible;
}

.gallery-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

#modalImage {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

#modalImage.fade-out {
  opacity: 0;
}

#modalCaption {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  padding: 0.5rem 1rem;
  background-color: rgba(0,0,0,0.5);
  border-radius: 0.25rem;
}

#modalCloseBtn,
#modalPrevBtn,
#modalNextBtn {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#galleryModal.active #modalCloseBtn,
#galleryModal.active #modalPrevBtn,
#galleryModal.active #modalNextBtn {
  opacity: 0.7;
}

#galleryModal.active #modalCloseBtn:hover,
#galleryModal.active #modalPrevBtn:hover,
#galleryModal.active #modalNextBtn:hover {
  opacity: 1;
}


/* Pastikan tombol benar-benar tersembunyi di awal */
#modalCloseBtn,
#modalPrevBtn,
#modalNextBtn {
  display: none; /* Awalnya disembunyikan */
  opacity: 0; /* Backup untuk transisi */
  transition: opacity 0.3s ease;
}

/* Munculkan saat modal aktif */
#galleryModal.active #modalCloseBtn,
#galleryModal.active #modalPrevBtn,
#galleryModal.active #modalNextBtn {
  display: flex; /* Tampilkan sebagai flex (sesuai layout Anda) */
  opacity: 0.7;
}

/* Efek hover */
#galleryModal.active #modalCloseBtn:hover,
#galleryModal.active #modalPrevBtn:hover,
#galleryModal.active #modalNextBtn:hover {
  opacity: 1;
}

/* Navigation Buttons */
#modalCloseBtn,
#modalPrevBtn,
#modalNextBtn {
  position: absolute;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  font-size: 1.25rem;
}

#modalCloseBtn {
  top: 1.25rem;
  right: 1.25rem;
}

#modalPrevBtn,
#modalNextBtn {
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
}

#modalPrevBtn {
  left: 1.25rem;
}

#modalNextBtn {
  right: 1.25rem;
}

#modalPrevBtn:hover,
#modalNextBtn:hover,
#modalCloseBtn:hover {
  background-color: #1d4ed8;
  opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  #modalPrevBtn,
  #modalNextBtn {
    display: none;
  }
  
  #modalImage {
    max-height: 70vh;
  }

  #back-to-top {
    bottom: 5rem;
    right: 1rem;
    padding: 0.5rem;
  }
}