/* ═══════════════════════════════════════════════════
   ROTARY DISTRICT 3060 - GALLERY LIGHTBOX & ZOOM VIEWER
   Interactive Fullscreen Gallery with Zoom & Pan
═══════════════════════════════════════════════════ */

#lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 15, 46, 0.94);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
  user-select: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .25s ease-out;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

/* ─── IMAGE STAGE & WRAPPER ─── */
.lightbox-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 82vh;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  cursor: zoom-in;
}

.lightbox-img-wrapper.is-zoomed {
  cursor: grab;
  max-width: none;
  max-height: none;
}

.lightbox-img-wrapper.is-dragging {
  cursor: grabbing !important;
  transition: none !important;
}

#lightbox-img, #lightbox img.lightbox-display-img {
  max-width: 90vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(201, 146, 42, 0.35);
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  display: block;
}

/* ─── TOP CONTROL TOOLBAR ─── */
.lightbox-topbar {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100010;
  pointer-events: none;
}

.lightbox-counter {
  pointer-events: auto;
  background: rgba(1, 35, 106, 0.8);
  border: 1px solid rgba(201, 146, 42, 0.5);
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 8px 18px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lightbox-counter .badge-dot {
  width: 8px;
  height: 8px;
  background: #C9922A;
  border-radius: 50%;
  display: inline-block;
}

.lightbox-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  backdrop-filter: blur(8px);
  font-size: 16px;
  outline: none;
}

.lightbox-btn:hover {
  background: rgba(201, 146, 42, 0.85);
  border-color: #C9922A;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(201, 146, 42, 0.35);
}

.lightbox-btn:active {
  transform: scale(0.95);
}

.lightbox-btn.btn-close {
  background: rgba(217, 83, 79, 0.3);
  border-color: rgba(217, 83, 79, 0.6);
  font-size: 20px;
}

.lightbox-btn.btn-close:hover {
  background: #d9534f;
  border-color: #d9534f;
}

/* ─── SIDE NAVIGATION BUTTONS ─── */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(1, 35, 106, 0.75);
  border: 1.5px solid rgba(201, 146, 42, 0.5);
  color: #ffffff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100005;
  transition: all .2s ease;
  backdrop-filter: blur(8px);
  outline: none;
}

.lightbox-nav-btn:hover {
  background: #C9922A;
  color: #fff;
  border-color: #C9922A;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(201, 146, 42, 0.4);
}

.lightbox-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.lightbox-nav-prev {
  left: 20px;
}

.lightbox-nav-next {
  right: 20px;
}

/* ─── BOTTOM CAPTION BAR ─── */
.lightbox-bottombar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 820px;
  width: calc(100% - 40px);
  text-align: center;
  z-index: 100010;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.lightbox-caption {
  pointer-events: auto;
  background: rgba(1, 15, 46, 0.85);
  border: 1px solid rgba(201, 146, 42, 0.4);
  color: #ffffff;
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-hint {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: .04em;
  font-family: 'DM Mono', monospace;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ─── RESPONSIVE BREAKPOINTS ─── */
@media (max-width: 768px) {
  .lightbox-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
  .lightbox-counter {
    font-size: 12px;
    padding: 6px 12px;
  }
  .lightbox-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  .lightbox-nav-prev {
    left: 10px;
  }
  .lightbox-nav-next {
    right: 10px;
  }
  .lightbox-caption {
    font-size: 12.5px;
    padding: 6px 16px;
    white-space: normal;
  }
  .lightbox-hint {
    display: none;
  }
}