/* ==========================================================================
   scene-picker.css — overlay for multi-panorama hotspot selection.
   ========================================================================== */

/* Utility class toggled by ScenePicker to hide hotspots/UI during the overlay.
   Targets individual hotspot elements to avoid stacking-context issues on the
   Marzipano container. The base transition ensures a smooth fade back in. */
.hotspot.link-hotspot {
  transition: opacity 0.4s ease;
}

.scene-picker-hidden .hotspot {
  opacity: 0 !important;
  pointer-events: none !important;
}

#ui.scene-picker-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease-out !important;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */

#scene-picker {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

#scene-picker.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.6s ease, visibility 0s linear 0s;
}

#scene-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

#scene-picker.is-visible #scene-picker__backdrop {
  pointer-events: auto;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */

#scene-picker__grid {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.22, 0.9, 0.36, 1) 0.15s,
              opacity 0.6s ease 0.15s;
}

#scene-picker.is-visible #scene-picker__grid {
  transform: translateY(0);
  opacity: 1;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.scene-picker__card {
  flex: 0 0 auto;
  width: 240px;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.scene-picker__card:hover {
  transform: translateY(-6px);
  border-color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.scene-picker__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a1e;
}

.scene-picker__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-picker__card:hover .scene-picker__thumb {
  filter: brightness(1.1);
  transition: filter 0.3s;
}

.scene-picker__label {
  display: block;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.scene-picker__card:hover .scene-picker__label {
  color: #fff;
}

/* ── Small screens ───────────────────────────────────────────────────────── */

/* Two 240px cards side by side need ~550px; on a phone they ran off both
   edges. Stack them instead, and let them scroll if the screen is too short
   to hold both (a small phone, or more than two panoramas). */
@media (max-width: 600px) {
  #scene-picker__grid {
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
    max-height: 100%;
    overflow-y: auto;
  }

  .scene-picker__card {
    width: 240px;
    max-width: 100%;
  }
}
