/* Snapshot Gallery (Horizontal) - bottom panel */

.potree-snapshot-gallery-horizontal {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 900;

  width: min(900px, 92vw);
  max-height: 30vh;

  --snapshot-gallery-bg: rgba(255, 255, 255, 0.85);
  --snapshot-gallery-border: rgba(255, 255, 255, 0.5);
  --snapshot-gallery-header-color: #111827;
  --snapshot-gallery-header-border: rgba(17, 24, 39, 0.08);
  --snapshot-gallery-empty-color: #6b7280;
  --snapshot-gallery-item-bg: rgba(0, 0, 0, 0.04);
  --snapshot-gallery-item-border: rgba(0, 0, 0, 0.08);
  /* Acciones sobre un fondo oscuro/semioscuro (al hacer hover). En modo claro, iconos en blanco. */
  --snapshot-gallery-btn-bg: rgba(255, 255, 255, 0.2);
  --snapshot-gallery-btn-bg-hover: rgba(255, 255, 255, 0.35);
  --snapshot-gallery-btn-color: #fff;
  --snapshot-gallery-actions-bg: rgba(17, 24, 39, 0.55);
  --snapshot-gallery-box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);

  background: var(--snapshot-gallery-bg);
  border: 1px solid var(--snapshot-gallery-border);
  border-radius: 12px;
  box-shadow: var(--snapshot-gallery-box-shadow);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.dark .potree-snapshot-gallery-horizontal {
  --snapshot-gallery-bg: rgba(3, 7, 18, 0.96);
  --snapshot-gallery-border: rgba(55, 65, 81, 0.85);
  --snapshot-gallery-header-color: #f3f4f6;
  --snapshot-gallery-header-border: rgba(255, 255, 255, 0.08);
  --snapshot-gallery-empty-color: #9ca3af;
  --snapshot-gallery-item-bg: rgba(17, 24, 39, 0.72);
  --snapshot-gallery-item-border: rgba(148, 163, 184, 0.2);
  --snapshot-gallery-btn-bg: rgba(255, 255, 255, 0.2);
  --snapshot-gallery-btn-bg-hover: rgba(255, 255, 255, 0.35);
  --snapshot-gallery-btn-color: #fff;
  --snapshot-gallery-actions-bg: rgba(0, 0, 0, 0.75);
  --snapshot-gallery-box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.potree-snapshot-gallery-horizontal.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.potree-snapshot-gallery-horizontal__header {
  flex-shrink: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--snapshot-gallery-header-color);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--snapshot-gallery-header-border);
}

.potree-snapshot-gallery-horizontal__title {
  flex: 1;
  min-width: 0;
}

.potree-snapshot-gallery-horizontal__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.potree-snapshot-gallery-horizontal__header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--snapshot-gallery-header-color);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.potree-snapshot-gallery-horizontal__header-btn:focus-visible,
.potree-snapshot-gallery-horizontal__btn:focus-visible,
.potree-snapshot-gallery-horizontal-zoom__close:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.potree-snapshot-gallery-horizontal__header-btn:hover {
  background: rgba(17, 24, 39, 0.06);
}

.dark .potree-snapshot-gallery-horizontal__header-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.potree-snapshot-gallery-horizontal__header-btn svg {
  display: block;
}

.potree-snapshot-gallery-horizontal__header-btn span {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.potree-snapshot-gallery-horizontal__header-btn--danger {
  color: #b91c1c;
}

.potree-snapshot-gallery-horizontal__header-btn--danger:hover {
  background: rgba(185, 28, 28, 0.08);
}

.dark
  .potree-snapshot-gallery-horizontal__header-btn--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.dark .potree-snapshot-gallery-horizontal__header-btn--danger {
  color: #f87171;
}

.potree-snapshot-gallery-horizontal__list {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;

  padding: 10px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}

.potree-snapshot-gallery-horizontal__empty {
  padding: 20px 12px;
  font-size: 12px;
  color: var(--snapshot-gallery-empty-color);
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;
}

.potree-snapshot-gallery-horizontal__item {
  flex-shrink: 0;
  width: 180px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--snapshot-gallery-item-bg);
  border: 1px solid var(--snapshot-gallery-item-border);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.potree-snapshot-gallery-horizontal__thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.potree-snapshot-gallery-horizontal__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.potree-snapshot-gallery-horizontal__actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(transparent, var(--snapshot-gallery-actions-bg));
  opacity: 0;
  transition: opacity 0.15s ease;
}

.potree-snapshot-gallery-horizontal__item:hover
  .potree-snapshot-gallery-horizontal__actions {
  opacity: 1;
}

.potree-snapshot-gallery-horizontal__btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--snapshot-gallery-btn-bg);
  color: var(--snapshot-gallery-btn-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.potree-snapshot-gallery-horizontal__btn:hover {
  background: var(--snapshot-gallery-btn-bg-hover);
}

.potree-snapshot-gallery-horizontal__btn:active {
  transform: scale(0.95);
}

.potree-snapshot-gallery-horizontal__btn--zoom {
  background: rgba(59, 130, 246, 0.25);
}
.potree-snapshot-gallery-horizontal__btn--zoom:hover {
  background: rgba(59, 130, 246, 0.45);
}

.potree-snapshot-gallery-horizontal__btn--download {
  background: rgba(16, 185, 129, 0.25);
}
.potree-snapshot-gallery-horizontal__btn--download:hover {
  background: rgba(16, 185, 129, 0.45);
}

.potree-snapshot-gallery-horizontal__btn--delete {
  background: rgba(239, 68, 68, 0.25);
}
.potree-snapshot-gallery-horizontal__btn--delete:hover {
  background: rgba(239, 68, 68, 0.45);
}

.potree-snapshot-gallery-horizontal__btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Zoom overlay */
.potree-snapshot-gallery-horizontal-zoom {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}

.potree-snapshot-gallery-horizontal-zoom__img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  cursor: default;
  position: relative;
}

.potree-snapshot-gallery-horizontal-zoom__img-wrap img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 10px 45px rgba(0, 0, 0, 0.6);
}

.potree-snapshot-gallery-horizontal-zoom__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #f9fafb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.potree-snapshot-gallery-horizontal-zoom__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.dark .potree-snapshot-gallery-horizontal-zoom__close {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dark .potree-snapshot-gallery-horizontal-zoom__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.potree-snapshot-gallery-horizontal-zoom__close svg {
  width: 16px;
  height: 16px;
}

