/* ===== Viewer Header ===== */
#viewer-header {
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

#viewer-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

#viewer-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Empty State ===== */
#empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  color: var(--border);
  margin-bottom: 16px;
}

#empty-state p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-link {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Photo Grid ===== */
#photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  background: var(--border);
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.photo-tile:hover img {
  transform: scale(1.05);
}

.photo-tile .tile-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.photo-tile .video-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ===== Lightbox ===== */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

#lightbox.hidden {
  display: none !important;
}

#lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 101;
  padding: 8px;
  line-height: 1;
}

#lightbox-prev, #lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  cursor: pointer;
  padding: 12px;
  border-radius: 50%;
  z-index: 101;
  transition: background 0.2s;
}

#lightbox-prev:hover, #lightbox-next:hover {
  background: rgba(255,255,255,0.3);
}

#lightbox-prev { left: 12px; }
#lightbox-next { right: 12px; }

#lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 60px 48px 0;
  min-height: 0;
}

#lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

#lightbox-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 4px;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  gap: 2px;
}

#lightbox-name {
  color: white;
  font-weight: 500;
}

#lightbox-actions {
  padding: 8px 16px 24px;
}

.danger-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.danger-btn:hover {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.danger-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Admin badge */
.admin-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

#viewer-loading {
  font-size: 0.85rem;
  color: var(--primary);
  margin-top: 4px;
}

