.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  overflow: auto;
}

.modal-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-frame {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background-color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-frame img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
  position: relative;
}

.modal-frame .frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../assets/bingkai-artalex.png') no-repeat center center;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 2;
}

.close-btn,
.nav-btn {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  font-size: 2em;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.close-btn:hover,
.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.close-btn {
  top: 20px;
  right: 20px;
}

.nav-btn {
  top: 50%;
  transform: translateY(-50%);
}

#prevBtn {
  left: 20px;
}

#nextBtn {
  right: 20px;
}

.download-wrapper {
  margin-top: 10px;
}

#downloadBtn {
  background-color: #f1c40f;
  color: #000;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

#downloadBtn:hover {
  background-color: #d4ac0d;
}

.thumbnail-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.thumbnail-bar img {
  width: 60px;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.thumbnail-bar img:hover {
  transform: scale(1.1);
  opacity: 1;
}

.thumbnail-bar img.active {
  border: 2px solid #f1c40f;
  opacity: 1;
}

.modal-caption {
  color: #fff;
  font-size: 1.1em;
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}
