/**
 * BEAUMONT MANOR — CHRISTMAS EVE COLD CASE (1898)
 * The Manor Floorplan & Room Inspector Styles
 * Architectural Blueprint Split-Pane Layout
 */

/* ==========================================================================
   1. FLOOR SELECTOR NAVIGATION
   ========================================================================== */
.mansion-floor-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}
.mansion-floor-nav::-webkit-scrollbar { display: none; }

.floor-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.floor-tab-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-brass);
  color: var(--text-main);
}

.floor-tab-btn.active {
  background: linear-gradient(135deg, rgba(197, 155, 39, 0.2) 0%, rgba(16, 25, 42, 0.95) 100%);
  border-color: var(--brass);
  color: var(--brass-light);
  box-shadow: 0 0 16px var(--brass-glow);
}

.floor-room-count-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-subtle);
}

.floor-tab-btn.active .floor-room-count-badge {
  background: var(--brass);
  color: #0b111e;
  font-weight: 800;
}

/* ==========================================================================
   2. SPLIT-PANE LAYOUT (MAP VIEW + ROOM INSPECTOR)
   ========================================================================== */
.mansion-split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: 100%;
  box-sizing: border-box;
  transition: grid-template-columns 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When room inspector drawer is active in desktop view */
.mansion-split-layout.inspector-open {
  grid-template-columns: 1.15fr 0.85fr;
}

/* ==========================================================================
   3. LEFT PANE: ARCHITECTURAL BLUEPRINT MAP
   ========================================================================== */
.mansion-map-pane {
  background: #060e1d;
  border: 1.5px solid var(--border-ice);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  max-width: 100%;
  box-sizing: border-box;
}

.blueprint-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(90deg, #0a172e 0%, #060e1d 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ice-cyan);
}

.blueprint-title-tag {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.blueprint-meta-tag {
  color: #64748b;
  font-size: 0.7rem;
}

/* Interactive Blueprint Stage */
.blueprint-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 400px;
  background-color: #050d1a;
  background-image: 
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  padding: 0.5rem;
}

.blueprint-image-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  margin: 0 auto;
}

.blueprint-photo-map {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}

.blueprint-svg-canvas,
svg.blueprint-svg-canvas {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

/* Room Hotspots / Interactive Pins */
.room-hotspot-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  z-index: 25;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

/* Ensure clicks and taps anywhere on the beacon, icon, or label register directly on the button */
.room-hotspot-pin * {
  pointer-events: none;
}

.pin-marker-beacon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--brass);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--brass-glow);
  position: relative;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.pin-marker-beacon::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--brass);
  opacity: 0.6;
  animation: radarPulse 2.4s infinite ease-out;
}

@keyframes radarPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.pin-icon {
  font-size: 0.95rem;
}

.pin-label-pill {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(11, 17, 30, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

/* Hotspot Variations */
.room-hotspot-pin:hover .pin-marker-beacon,
.room-hotspot-pin.active .pin-marker-beacon {
  transform: scale(1.15);
  border-color: var(--brass-light);
  background: var(--brass);
}

.room-hotspot-pin.active .pin-label-pill {
  border-color: var(--brass);
  color: var(--brass-light);
  background: #0f172a;
}

/* Crime scene indicator */
.room-hotspot-pin.crime-scene .pin-marker-beacon {
  border-color: var(--crimson-bright);
  box-shadow: 0 0 16px var(--crimson-glow);
}
.room-hotspot-pin.crime-scene .pin-marker-beacon::after {
  border-color: var(--crimson-bright);
}

/* Blueprint Footer Tools */
.blueprint-footer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #060e1d;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.btn-blueprint-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-ice);
  color: var(--ice-cyan);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-blueprint-fullscreen:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

/* Quick Room Selector Chips */
.room-quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  width: 100%;
  box-sizing: border-box;
}

.btn-room-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.btn-room-chip:hover {
  color: var(--text-main);
  border-color: var(--border-brass);
  background: var(--bg-surface-elevated);
  transform: translateY(-1px);
}

.btn-room-chip.active {
  background: linear-gradient(135deg, rgba(197, 155, 39, 0.25) 0%, rgba(16, 25, 42, 0.95) 100%);
  color: var(--brass-light);
  border-color: var(--brass);
  font-weight: 700;
  box-shadow: 0 0 12px var(--brass-glow);
}

/* ==========================================================================
   4. RIGHT PANE: ROOM INSPECTOR PANEL (DRAWER / OVERLAY)
   ========================================================================== */
.mansion-inspector-pane {
  display: none;
  flex-direction: column;
}

/* Shown on desktop when .inspector-open is active */
.mansion-split-layout.inspector-open .mansion-inspector-pane {
  display: flex;
  animation: slideInInspectorDesktop 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInInspectorDesktop {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.inspector-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-kicker-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inspector-icon {
  font-size: 0.9rem;
}

.inspector-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brass-light);
  text-transform: uppercase;
}

.btn-inspector-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-inspector-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.room-inspector-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-brass);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-shadow: var(--shadow-lg), var(--shadow-brass);
}

.room-hero-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #020408;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.room-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.room-hero-media-wrap:hover .room-hero-img {
  transform: scale(1.04);
}

.room-status-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  background: rgba(11, 17, 30, 0.9);
  border: 1px solid currentColor;
  backdrop-filter: blur(4px);
}

.status-crime-scene { color: var(--crimson-light); border-color: var(--crimson-bright); }
.status-cleared { color: var(--emerald); border-color: var(--emerald-dim); }
.status-cold { color: var(--ice-cyan); border-color: var(--ice-cyan-dim); }

.room-info-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.room-title-h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brass-light);
}

.room-ambient-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-ice);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  align-self: flex-start;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.room-narrative-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-main);
  background: rgba(11, 17, 30, 0.5);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brass);
}

/* Forensic Findings in Room */
.room-evidence-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.evidence-section-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brass-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.room-evidence-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.room-clue-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.room-clue-card:hover {
  border-color: var(--border-brass);
  background: var(--bg-surface-elevated);
}

.clue-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.clue-text-block {
  flex: 1;
  min-width: 0;
}

.clue-name-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clue-meta-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dynamic elements support for floorplan */
.map-view-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #020408;
}

.map-schematic-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-chip-btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
  min-height: 44px;
}

.room-chip-btn.active {
  background: var(--brass);
  color: #0b111e;
  border-color: var(--brass-light);
  font-weight: 700;
}

.room-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #020408;
  cursor: pointer;
}

.room-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brass-light);
}

.room-desc {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-main);
}

.room-evidence-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brass-light);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.room-evidence-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.evidence-item-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 44px;
}

.evidence-item-card:hover {
  border-color: var(--border-brass);
  background: var(--bg-surface-elevated);
}

.evidence-thumb-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.evidence-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.evidence-info {
  flex: 1;
  min-width: 0;
}

.evidence-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.evidence-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   5. RESPONSIVE DESIGN ADJUSTMENTS
   ========================================================================== */
@media (max-width: 1024px) {
  .mansion-map-pane,
  .blueprint-stage,
  .mansion-split-layout {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .blueprint-svg-canvas,
  svg.blueprint-svg-canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .mansion-split-layout,
  .mansion-split-layout.inspector-open {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Drawer transforms into a modal backdrop overlay sheet on tablet & mobile */
  .mansion-inspector-pane {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(4, 8, 16, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.25rem;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
  }

  .mansion-split-layout.inspector-open .mansion-inspector-pane {
    display: flex;
    animation: fadeInInspectorBackdrop 0.25s ease forwards;
  }

  .mansion-inspector-pane .room-inspector-card {
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    margin: auto;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.95), 0 0 0 1px var(--brass);
    animation: slideUpInspectorSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .blueprint-stage {
    min-height: 320px;
  }
}

@keyframes fadeInInspectorBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpInspectorSheet {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .mansion-map-pane,
  .blueprint-stage,
  .mansion-split-layout {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .blueprint-svg-canvas,
  svg.blueprint-svg-canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .mansion-map-pane,
  .blueprint-stage,
  .mansion-split-layout {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .blueprint-svg-canvas,
  svg.blueprint-svg-canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .room-quick-chips-row {
    padding: 0.65rem 0.5rem;
    gap: 0.38rem;
  }

  .btn-room-chip {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
  }

  .mansion-inspector-pane {
    padding: 0.75rem;
  }

  .mansion-inspector-pane .room-inspector-card {
    max-height: 92vh;
    padding: 1rem;
    gap: 0.85rem;
  }

  .blueprint-stage {
    min-height: 260px;
  }

  .room-hotspot-pin {
    min-width: 40px;
    min-height: 40px;
  }

  .pin-marker-beacon {
    width: 28px;
    height: 28px;
  }

  .pin-label-pill {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  .room-inspector-card {
    padding: 1rem;
  }
}
