/* Test Property Tour — self-hosted Pannellum + floor plan */
:root {
  --bg: #101318;
  --panel: rgba(16, 19, 24, 0.92);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f4f1ea;
  --muted: #b7b3aa;
  --accent: #e08a2c;
  --accent-soft: rgba(224, 138, 44, 0.28);
  --pin: #f3f0e8;
  --pin-active: #e08a2c;
  --cone: rgba(224, 138, 44, 0.42);
  --cone-stroke: rgba(224, 138, 44, 0.9);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#panorama {
  width: 100%;
  height: 100%;
}

#tour-ui {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

#tour-ui .ui-hit {
  pointer-events: auto;
}

.tour-title {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: min(72vw, 360px);
}

.tour-title strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.tour-title span {
  font-size: 12px;
  color: var(--muted);
}

#floorplan-toggle {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}

#floorplan-toggle:hover,
#floorplan-toggle:focus-visible {
  outline: none;
  border-color: var(--accent);
}

#floorplan-panel {
  position: absolute;
  left: 14px;
  bottom: 62px;
  width: min(360px, calc(100vw - 28px));
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: bottom left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

#floorplan-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.floorplan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.floorplan-header button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.floorplan-map {
  position: relative;
  margin: 0 10px 12px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}

.floorplan-map img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

.floorplan-pin {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 1;
}

.floorplan-pin.is-active {
  z-index: 2;
}

.floorplan-radar-wrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%) rotate(var(--cone-angle, 0deg));
  transform-origin: 50% 50%;
  pointer-events: none;
  opacity: 0;
}

.floorplan-pin.is-active .floorplan-radar-wrap {
  opacity: 1;
}

.floorplan-radar-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.floorplan-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid #1b140c;
  border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
}

.floorplan-pin.is-active .floorplan-dot {
  background: var(--pin-active);
  box-shadow: 0 0 0 4px var(--accent-soft);
  width: 20px;
  height: 20px;
}

.floorplan-label {
  position: absolute;
  left: 0;
  top: 14px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  color: #1b140c;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 1px 7px;
  pointer-events: none;
}

#status-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 28rem;
  padding: 16px 18px;
  background: #4a1c1c;
  border-radius: 12px;
  display: none;
}

#status-error.is-visible { display: block; }

@media (max-width: 767px) {
  .tour-title { top: 8px; left: 8px; padding: 8px 10px; }
  #floorplan-toggle { left: 8px; bottom: 8px; }
  #floorplan-panel {
    left: 8px;
    right: 8px;
    bottom: 54px;
    width: auto;
  }
}

/* Keep Pannellum controls reachable */
.pnlm-controls-container { z-index: 10; }

/* Hide Pannellum's built-in title/author box — we render our own chip. */
.pnlm-panorama-info { display: none !important; }

/* Keep zoom/fullscreen clear of the top-left title chip. */
.pnlm-controls-container { top: 72px; }
