/**
 * LUXE RESIDENCES — 3D Architectural Viewer HUD Styles
 */

.engine3d-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 380px;
  background: #06090e;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.engine3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
}

.engine3d-canvas:active {
  cursor: grabbing;
}

/* Floating HUD Top Bar */
.engine3d-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.engine3d-hud-top > * {
  pointer-events: auto;
}

.engine3d-dimension-pill {
  background: rgba(10, 14, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.engine3d-dimension-pill strong {
  color: #fff;
  font-weight: 600;
}

.engine3d-dimension-pill .dim-accent {
  color: #38bdf8;
}

/* Floating Camera Presets */
.engine3d-cam-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}

.engine3d-controls-panel .engine3d-cam-controls {
  position: static;
  display: flex;
  width: fit-content;
}

.engine3d-cam-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.engine3d-cam-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.engine3d-cam-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Dual Staging & Lighting Controls */
.engine3d-hud-bottom-right {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.engine3d-toggle-group {
  display: flex;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.engine3d-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.engine3d-toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.engine3d-toggle-btn.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* 2D Dimension Vector Overlay */
.engine3d-dim-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.dim-line {
  stroke: rgba(56, 189, 248, 0.85);
  stroke-width: 1.5;
  stroke-dasharray: 4, 3;
}

.dim-arrow {
  fill: #38bdf8;
}

.dim-text {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  fill: #f8fafc;
  text-anchor: middle;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.dim-text-bg {
  fill: rgba(10, 15, 25, 0.85);
  stroke: rgba(56, 189, 248, 0.5);
  stroke-width: 1;
  rx: 4;
}

/* Tabs for Section 4 Mode */
.section-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.8rem;
}

.mode-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.mode-tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 2D Floor Plan Radar (Mini-Map) HUD */
.engine3d-minimap {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 120px;
  height: 120px;
  background: rgba(8, 12, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 6px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.engine3d-minimap:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: scale(1.02);
}

.minimap-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.minimap-outer-wall {
  fill: rgba(15, 23, 42, 0.6);
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5;
}

.minimap-room-rect {
  fill: rgba(30, 41, 59, 0.5);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.minimap-room-group:hover .minimap-room-rect {
  fill: rgba(56, 189, 248, 0.15);
  stroke: rgba(56, 189, 248, 0.5);
}

.minimap-room-group.active .minimap-room-rect {
  fill: rgba(56, 189, 248, 0.25);
  stroke: #38bdf8;
  stroke-width: 1.5;
}

.minimap-room-label {
  font-family: inherit;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
  fill: #94a3b8;
  text-anchor: middle;
  pointer-events: none;
}

.minimap-room-group.active .minimap-room-label {
  fill: #fff;
  font-weight: 700;
}

.minimap-cam-dot {
  fill: #38bdf8;
  stroke: #fff;
  stroke-width: 1;
  filter: drop-shadow(0 0 4px #38bdf8);
}

/* Developer Finish Palettes */
.palette-btn.active {
  background: rgba(180, 154, 101, 0.3) !important;
  border-color: rgba(180, 154, 101, 0.6) !important;
  color: #fff !important;
}

/* 3D Threshold Portal Markers */
.portal-marker-overlay {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  background: rgba(10, 15, 25, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 20px;
  padding: 5px 12px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(56, 189, 248, 0.3);
  transition: all 0.2s ease;
  z-index: 6;
}

.portal-marker-overlay:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  transform: translate(-50%, -50%) scale(1.05);
}

.engine3d-portals-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

@media (max-width: 640px) {
  .engine3d-minimap {
    width: 90px;
    height: 90px;
    top: 10px;
    right: 10px;
    padding: 4px;
  }
  .portal-marker-overlay {
    font-size: 0.65rem;
    padding: 4px 8px;
  }
}

.engine3d-portal-btn {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: rgba(10, 14, 20, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(197, 160, 89, 0.6);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 7px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 14px rgba(197, 160, 89, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.engine3d-portal-btn:hover {
  background: rgba(197, 160, 89, 0.35);
  border-color: var(--gold, #c5a059);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.08);
}

.engine3d-portal-btn:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.portal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #c5a059);
  display: inline-block;
  box-shadow: 0 0 6px var(--gold, #c5a059);
}

/* AI Architectural Concept Disclaimer Pill */
.engine3d-ai-pill {
  background: rgba(180, 83, 9, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.engine3d-ai-pill .ai-sparkle {
  color: #fde68a;
  font-size: 0.85rem;
}

/* HUD Top Button (Fullscreen) */
.engine3d-hud-btn {
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.engine3d-hud-btn:hover {
  background: rgba(197, 160, 89, 0.25);
  border-color: var(--gold, #c5a059);
  color: #fff;
}

/* Luxury 360 Loading Spinner Overlay */
.engine3d-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 20;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.engine3d-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.engine3d-spinner {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(197, 160, 89, 0.2);
  border-top-color: var(--gold, #c5a059);
  border-radius: 50%;
  animation: engine3dSpin 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  box-shadow: 0 0 16px rgba(197, 160, 89, 0.3);
}

@keyframes engine3dSpin {
  to {
    transform: rotate(360deg);
  }
}

.engine3d-loader-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #e2e8f0;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
