/* ================================================================
   FLOORPLAN.CSS — BellaVita Cabanatuan Virtual Tour
   v1.0

   NOTE: The recorder panel, notification toast, and dot markers
   are all inline-styled in floorplan.js (same approach as
   coordinates.js) so this file only covers structural layout
   for the floor plan container and nav dots.
================================================================ */

/* ──────────────────────────────────────────────────────────────
   FLOOR PLAN CONTAINER
   Mirrors #minimap-container (collapsed state):
     position: fixed; top: 50%; right: 0;
     width: 250px; border-radius: 14px 0 0 14px;
────────────────────────────────────────────────────────────── */
#fp-container {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 9999;

  width: 250px;
  height: 430px; /* match your minimap collapsed height */

  background: #fff;
  border-radius: 14px 0 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-right: none;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.16);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Slide animation — same timing as minimap hide/show */
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

/* Hidden — slide off to the right (mirrors minimap-hidden) */
#fp-container.fp-hidden {
  transform: translateY(-50%) translateX(110%);
  opacity: 0;
  pointer-events: none;
}

/* Visible */
#fp-container.fp-visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Hide during intro ── */
body.intro-active #fp-container,
body.intro-active #fp-show-toggle {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────
   HEADER
────────────────────────────────────────────────────────────── */
.fp-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  background: linear-gradient(135deg, #ff6b00, #e65100);
  user-select: none;
}

.fp-title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #fff;
}

/* Hide button — mirrors .minimap-hide-btn */
.fp-hide-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s ease;
}
.fp-hide-btn:hover {
  background: rgba(255, 255, 255, 0.38);
}
.fp-hide-btn:active {
  background: rgba(255, 255, 255, 0.55);
}

/* ──────────────────────────────────────────────────────────────
   IMAGE WRAPPER
────────────────────────────────────────────────────────────── */
.fp-image-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

#fp-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ──────────────────────────────────────────────────────────────
   NAV DOTS LAYER
────────────────────────────────────────────────────────────── */
#fp-dots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}

/* ──────────────────────────────────────────────────────────────
   NAV DOT  (mirrors .minimap-dot)
────────────────────────────────────────────────────────────── */
.fp-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: all;
  z-index: 20;
  overflow: visible;
  background: transparent;
}

/* FOV cone wrapper — JS rotates this via inline style */
.fp-fov-wrapper {
  position: absolute;
  width: 60px;
  height: 60px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  pointer-events: none;
  will-change: transform;
  opacity: 0; /* hidden on non-current dots */
  transition: opacity 0.25s ease;
}
.fp-dot.fp-dot-current .fp-fov-wrapper {
  opacity: 1;
}

.fp-fov-fan {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fp-fov-path {
  fill: #ff6b00;
  stroke: #e65100;
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0.85;
}

/* Core circle */
.fp-dot-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff6b00;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 12;
  transition: transform 0.2s ease;
}
.fp-dot:hover .fp-dot-core {
  transform: translate(-50%, -50%) scale(1.28);
}

/* Current dot — glowing pulse */
.fp-dot.fp-dot-current .fp-dot-core {
  box-shadow:
    0 0 0 3px rgba(255, 107, 0, 0.3),
    0 0 12px rgba(255, 107, 0, 0.6),
    0 1px 5px rgba(0, 0, 0, 0.4);
  animation: fpCoreGlow 2s ease-in-out infinite;
}

@keyframes fpCoreGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(255, 107, 0, 0.3),
      0 0 12px rgba(255, 107, 0, 0.6),
      0 1px 5px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 107, 0, 0.13),
      0 0 20px rgba(255, 107, 0, 0.38),
      0 1px 5px rgba(0, 0, 0, 0.4);
  }
}

/* Tooltip label */
.fp-dot-label {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(18, 18, 18, 0.92);
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  z-index: 100;
}
.fp-dot-label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(18, 18, 18, 0.92);
}
.fp-dot:hover .fp-dot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ──────────────────────────────────────────────────────────────
   BOTTOM BAR
   Injected at runtime by floorplan-recorder.js (dev tool only).
   Not present in production.
────────────────────────────────────────────────────────────── */
/* .fp-bottom-bar styles are applied inline by floorplan-recorder.js */

/* ──────────────────────────────────────────────────────────────
   SHOW TOGGLE  (mirrors .minimap-show-toggle exactly)
   Appears at right edge, vertically centred, when panel hidden.
────────────────────────────────────────────────────────────── */
#fp-show-toggle {
  position: fixed;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;

  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #ff6b00, #e65100);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.32);

  display: none; /* hidden until needed */
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#fp-show-toggle.fp-show-toggle-active {
  display: flex;
  opacity: 1;
  pointer-events: all;
  animation: fpSlideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fpSlideInRight {
  from {
    transform: translateY(-50%) translateX(60px);
    opacity: 0;
  }
  to {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
  }
}

#fp-show-toggle:hover {
  transform: translateY(-50%) scale(1.07);
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.44);
}

#fp-show-toggle img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════
   TABLET  769px – 1024px
═══════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  #fp-container {
    width: 230px;
    height: 420px;
  }
  .fp-hide-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .fp-dot-core {
    width: 13px;
    height: 13px;
  }
  .fp-fov-wrapper {
    width: 54px;
    height: 54px;
  }
  #fp-show-toggle {
    width: 48px;
    height: 48px;
    right: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE PORTRAIT  ≤ 768px
   Same compact size as minimap — right-edge strip.
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #fp-container {
    width: 250px;
    height: 430px;
  }
  .fp-header {
    padding: 10px 12px 8px;
  }
  .fp-title {
    font-size: 11px;
  }
  .fp-hide-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .fp-dot {
    width: 26px;
    height: 26px;
  }
  .fp-dot-core {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
  }
  /* No grow animation on current dot on mobile */
  .fp-dot.fp-dot-current .fp-dot-core {
    animation: none !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4) !important;
  }
  .fp-fov-wrapper {
    width: 50px;
    height: 50px;
  }
  .fp-dot-label {
    font-size: 10px;
    padding: 4px 9px;
  }
  #fp-show-toggle {
    width: 46px;
    height: 46px;
    right: 10px;
  }
  #fp-show-toggle img {
    width: 24px;
    height: 24px;
  }
}

/* ── Small phones ≤ 480px ── */
@media (max-width: 480px) {
  #fp-container {
    width: 220px;
    height: 380px;
  }
  .fp-dot-core {
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
  }
  .fp-dot.fp-dot-current .fp-dot-core {
    animation: none !important;
  }
  .fp-fov-wrapper {
    width: 44px;
    height: 44px;
  }
  .fp-hide-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  #fp-show-toggle {
    width: 44px;
    height: 44px;
    right: 8px;
  }
}

/* ── Very small phones ≤ 360px ── */
@media (max-width: 360px) {
  #fp-container {
    width: 190px;
    height: 340px;
  }
  .fp-dot-core {
    width: 14px;
    height: 14px;
    border: 2.5px solid #fff;
  }
  .fp-dot.fp-dot-current .fp-dot-core {
    animation: none !important;
  }
  .fp-hide-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  #fp-show-toggle {
    width: 40px;
    height: 40px;
    right: 6px;
  }
}

/* ═══════════════════════════════════════════════════════════
   LANDSCAPE PHONE  max-height ≤ 500px
═══════════════════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  #fp-container {
    width: 200px;
    height: 86vh;
  }
  .fp-dot-core {
    width: 11px;
    height: 11px;
  }
  .fp-fov-wrapper {
    width: 40px;
    height: 40px;
  }
  .fp-hide-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  #fp-show-toggle {
    width: 42px;
    height: 42px;
    right: 8px;
  }
}
