/* Theme image lightbox */
.tlb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  padding: 20px;
}

.tlb-overlay.visible { opacity: 1; }

.tlb-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}
.tlb-close:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.05); }

.tlb-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 10;
}

.tlb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}
.tlb-nav:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-50%) scale(1.08); }
.tlb-prev { inset-inline-start: 24px; }
.tlb-next { inset-inline-end: 24px; }

.tlb-stage {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 60px 20px 20px;
  min-height: 0;
  cursor: zoom-out;
}

.tlb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 32px;
  pointer-events: none;
}

.tlb-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: default;
}

.tlb-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: nowrap;
}

.tlb-thumbs::-webkit-scrollbar { height: 6px; }
.tlb-thumbs::-webkit-scrollbar-track { background: transparent; }
.tlb-thumbs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }

.tlb-thumb {
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.05);
}
.tlb-thumb:hover { opacity: 0.85; }
.tlb-thumb.active {
  border-color: #fff;
  opacity: 1;
  transform: scale(1.06);
}
.tlb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Theme card "zoom" badge button */
.theme-zoom-btn {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s ease;
  opacity: 0;
}

/* Reveal on parent hover */
.theme-item:hover .theme-zoom-btn,
.card:hover .theme-zoom-btn,
.theme-card:hover .theme-zoom-btn { opacity: 1; }

.theme-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Mobile: always show the zoom button */
@media (max-width: 768px) {
  .theme-zoom-btn { opacity: 0.9; }
  .tlb-nav { width: 44px; height: 44px; font-size: 18px; }
  .tlb-prev { inset-inline-start: 8px; }
  .tlb-next { inset-inline-end: 8px; }
  .tlb-thumb { width: 60px; height: 60px; }
  .tlb-stage { padding: 60px 8px 12px; }
}
