/* ============================================================
   RESET / GLOBAL
============================================================ */

* {
  -webkit-user-drag: none;
  user-select: none;
  font-family: "Manrope", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

.material-symbols-sharp {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24
}

body {
  margin: 0;
  overflow: hidden;
  background: #ddd9da;
  touch-action: none;
}


#topbar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	display: grid;
	grid-template-columns: auto 1fr auto; /* 🔴 key */
	align-items: center;
  padding: 24px 0;
	z-index: 10;
	pointer-events: none;
}

.topbar-left {
	justify-self: start;
	pointer-events: auto;
  padding-left: 42px;
}

.topbar-center {
	justify-self: center;
	pointer-events: auto;
}

.topbar-right {
	justify-self: end;
	pointer-events: auto;
  padding-right: 42px;
}

#logo-main {
	height: 72px;
	width: auto;
	object-fit: contain;
}

#logo-secondary {
	height: 32px;
	width: auto;
	object-fit: contain;
}

@media (max-width: 768px) {
	#topbar {
		height: 60px;
		padding: 0 12px;
	}

	#logo-main,
	#logo-secondary {
		height: 28px;
	}
}

#project-name {
	color: black;
	font-size: 24px;
	font-weight: 900;
  text-transform: uppercase;
}

#side-controls {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);

	display: flex;
	flex-direction: column;
	gap: 12px;

	z-index: 60;
	pointer-events: auto;
}

.side-btn {
	width: 44px;
	height: 44px;

	border-radius: 10px;
	border: none;

	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(10px);

	color: white;
	cursor: pointer;

	display: flex;
	align-items: center;
	justify-content: center;

	transition: 0.2s;
}

.side-btn:hover {
	background: rgba(0, 0, 0, 0.85);
}

.side-panel {
	position: absolute;
	left: 80px;
	top: 50%;
	transform: translateY(-50%);

	width: 280px;
	max-height: 70%;

	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(15px);

	border-radius: 12px;
	padding: 16px;

	display: flex;
	flex-direction: column;
	gap: 12px;

	z-index: 999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 12px;
}

/* hide native checkbox */
.filter-checkbox input {
	display: none;
}

/* custom box */
.filter-checkbox span::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;

	border: 1px solid rgba(255,255,255,0.6);
	border-radius: 2px;

	margin-right: 6px;
	transition: 0.2s;
}

/* checked state */
.filter-checkbox input:checked + span::before {
	background: white;
	border-color: white;
}

.filter-checkbox input:checked + span {
	color: white;
}

.filter-checkbox span {
	color: rgba(255,255,255,0.6);
}

.filter-inline {
	display: flex;
	gap: 8px;
	flex-wrap: 100%;
}

.filter-pill {
	flex: 1;
	display: flex;
}

.filter-pill input {
	display: none;
}

.filter-pill span {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 32px;

	font-size: 11px;

	background: rgba(255,255,255,0.06);
	color: rgba(255,255,255,0.6);

	border-radius: 4px; /* 🔴 smaller = cleaner */
	transition: 0.2s;
}

/* hover */
.filter-pill span:hover {
	background: rgba(255,255,255,0.12);
}

.filter-pill input:checked + span {
	background: white;
	color: black;
}


/* active */
.filter-pill input:checked + span {
	background: white;
	color: black;
}

.filter-pill input[value="disponible"]:checked + span {
	background: #4caf50;
	color: white;
}

.filter-pill input[value="reserve"]:checked + span {
	background: #ff9800;
	color: white;
}

.filter-pill input[value="vendu"]:checked + span {
	background: #f44336;
	color: white;
}

.side-arrow {
	position: absolute;
	right: -16px;
	top: 50%;
	transform: translateY(-50%);

	width: 0;
	height: 0;

	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
	border-right: 12px solid rgba(0, 0, 0, 0.85);

	opacity: 0;
	transition: 0.2s;
}

/* active state */
.side-btn.active .side-arrow {
	opacity: 1;
}

.panel-header {
	color: white;
  text-transform: uppercase;
	font-weight: 600;
	font-size: 14px;
}

.panel-content {
	color: white;
	font-size: 13px;
}

.hidden {
	display: none;
}

.filter-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.filter-label {
	font-size: 13px;
	font-weight: 500;
	color: rgba(255,255,255,0.8);
}

.filter-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	cursor: pointer;
}

.filter-checkbox input {
	accent-color: white;
}

.filter-range-values {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: rgba(255,255,255,0.6);
}

input[type="range"] {
	-webkit-appearance: none;
	width: 100%;
	height: 4px;
	background: rgba(255,255,255,0.2);
	border-radius: 2px;
	outline: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: white;
	cursor: pointer;
}

.scenes-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-top: 12px;
}

.scene-item {
	display: flex;
	align-items: center;
	gap: 10px;

	padding: 12px;
	border-radius: 10px;

	background: rgba(255,255,255,0.05);
	cursor: pointer;
	transition: 0.2s;
}

.scene-item:hover {
	background: rgba(255,255,255,0.1);
}

.scene-item.active {
	background: rgba(255,255,255,0.15);
}

.scene-icon {
	font-size: 20px;
}

.scene-label {
	font-size: 12px;
	letter-spacing: 0.05em;
}


.filter-hotspot {
	position: absolute;
	transform: translate(-50%, -50%);

	background: rgba(0,0,0,0.8);
	color: white;

	font-size: 11px;
	padding: 4px 6px;
	border-radius: 4px;

	pointer-events: none;
	z-index: 6;
}
/* ============================================================
   MAIN LAYERS (CRITICAL FOR ALIGNMENT)
============================================================ */


/* Turntable image */
#viewer {
  z-index: 1;
  display: flex;
  cursor: grab;
}

#viewer:active {
  cursor: grabbing;
}

#frame {
  pointer-events: none;
  display: block;
}

/* Three.js canvas */
#three-container {
  z-index: 2;
}
#render-root {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* both layers fill SAME box */
#viewer,
#three-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* image fills container exactly */
#frame {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#three-container canvas {
  position: absolute;
  inset: 0;
}

/* ============================================================
   UI LAYER
============================================================ */

#ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#ui * {
  pointer-events: auto;
}

/* Logos */
.top-left,
.top-right {
  position: absolute;
  top: 40px;
}

.top-left { left: 40px; }
.top-right { right: 40px; }

.logo { height: 120px; }
.lucid_logo { height: 40px; }

/* Bottom controls */
.bottom-center {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
}

/* Buttons */
.ui-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: 0.2s;
}

.ui-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.ui-btn:active {
  transform: scale(0.95);
}

/* ============================================================
   HOTSPOTS
============================================================ */

#hotspots {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.filter-hotspot {
	position: absolute;
	transform: translate(-50%, -50%);
	background: black;
	color: white;
	font-size: 10px;
	padding: 4px 6px;
	border-radius: 4px;
	pointer-events: none;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -130%);
  pointer-events: auto;
  cursor: pointer;
}

.hotspot-label {
  width: 42px;
  height: 42px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.92);
  color: white;
}

.hotspot-label .material-symbols-sharp {
  font-size: 22px;
}

.hotspot-label::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);

  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0,0,0,0.92);
}

/* ============================================================
   TOOLTIP
============================================================ */

#tooltip {
  position: fixed;
  transform: translate(12px, -120%);
  padding: 10px 14px;
  border-radius: 10px;

  background: rgba(0,0,0,0.78);
  color: white;

  font-size: 14px;
  white-space: nowrap;

  pointer-events: none;
  z-index: 30;

  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#tooltip.visible {
  opacity: 1;
  transform: translate(12px, -140%);
}

/* ============================================================
   PANEL
============================================================ */

#villa-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 92vw);

  transform: translateX(100%);
  transition: transform 0.35s ease;

  z-index: 50;
}

#villa-type {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: white;
}

#villa-title {
  font-size: 12px;
  opacity: 0.5;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
#panel-close {
  position: absolute;
  top: 16px;
  right: 16px;

  width: 36px;
  height: 36px;

  border-radius: 10px;
  border: none;

  background: rgba(255,255,255,0.08);
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: 0.2s;
}

#panel-close:hover {
  background: rgba(255,255,255,0.15);
}

#panel-close .material-symbols-rounded {
  font-size: 20px;
}
.panel-row {
  font-size: 14px;
  letter-spacing: 0.2px;
}

#villa-panel.active {
  transform: translateX(0);
}

.panel-card {
  height: 100%;
  background: #0f0f10;
  color: white;
  padding: 26px;

  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Header */
.panel-header {
  text-align: center;
}

.panel-logo {
  height: 70px;
  margin-bottom: 12px;
}

/* Typography */
#villa-type {
  font-size: 32px;
  font-weight: 500;
}

#villa-title {
  font-size: 12px;
  opacity: 0.5;
  letter-spacing: 1px;
}

/* Content */
.panel-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 15px;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 8px;
}

.panel-description {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.7;
}
#villa-vr {
    cursor: pointer;
}
/* Status colors */
.status-row span:last-child {
    font-weight: 700;
}

.status-green {
    color: #00c853;
}

.status-yellow {
    color: #ffd600;
}

.status-red {
    color: #ff3d00;
}

/* VR button */
.panel-vr {
  height: 52px;
  border-radius: 12px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   MAP MODAL
============================================================ */

#map-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: none;
  z-index: 999;
}

#map-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-content {
  width: min(90vw, 900px);
  height: min(70vh, 600px);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.map-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.map-close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 40px;
  height: 40px;
  border-radius: 10px;

  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
}