/* app/src/styles.css */
:root {
  --bg: #131516;
  --panel: #1c1f20;
  --panel-strong: #232728;
  --panel-soft: #f0eee6;
  --text: #f4f1e8;
  --muted: #c4beb1;
  --line: #ffffff17;
  --accent: #d7a86e;
  --accent-strong: #b4742d;
  --shadow: 0 18px 40px #00000047;
}

* {
  box-sizing: border-box;
}

html, body {
  color: var(--text);
  background: radial-gradient(circle at 0 0, #d7a86e2e, #0000 28%), linear-gradient(#181b1c 0%, #111314 100%);
  min-height: 100%;
  margin: 0;
  font-family: IBM Plex Sans, Segoe UI, sans-serif;
}

body, #app {
  min-height: 100vh;
}

.app-loading {
  display: grid;
  color: var(--muted);
  letter-spacing: .04em;
  place-items:  center;
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  background: #131516b8;
  padding: 28px;
}

.sidebar__eyebrow, .section-label {
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
}

.sidebar__title {
  margin: 10px 0 12px;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1;
}

.sidebar__copy {
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

.sidebar__section + .sidebar__section {
  margin-top: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-card, .active-card, .room-card, .viewer-shell__card, .floorplan-shell {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(#ffffff0a, #ffffff05);
  border-radius: 18px;
}

.summary-card {
  padding: 14px;
}

.summary-card__label {
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-size: 11px;
}

.summary-card__value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 700;
}

.active-card {
  margin-top: 10px;
  padding: 16px;
}

.active-card__title {
  font-size: 18px;
  font-weight: 700;
}

.active-card__meta {
  color: var(--muted);
  margin-top: 6px;
}

.room-list {
  display: grid;
  list-style: none;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
}

.room-card {
  padding: 14px 16px;
}

.room-card__title {
  font-weight: 600;
}

.room-card__meta {
  color: var(--muted);
  margin-top: 5px;
  font-size: 14px;
}

.room-button-list {
  display: grid;
  gap: 10px;
}

.room-button {
  display: flex;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: #ffffff08;
  border-radius: 16px;
  justify-content: space-between;
  align-items:  center;
  width: 100%;
  padding: 13px 15px;
}

.room-button:hover, .room-button.is-active {
  background: #d7a86e1f;
  border-color: #d7a86e80;
}

.room-button__label {
  font-weight: 600;
}

.room-button__count {
  color: var(--muted);
  font-size: 14px;
}

.main-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.viewer-panel, .floorplan-panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #1c1f20db;
  border-radius: 28px;
  padding: 22px;
}

.viewer-panel__header, .floorplan-panel__header {
  display: flex;
  justify-content: space-between;
  align-items:  start;
  gap: 16px;
  margin-bottom: 18px;
}

.viewer-panel__title {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.viewer-panel__pill, .floorplan-panel__count {
  color: #f3c48f;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #d7a86e24;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
}

.viewer-shell {
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at top, #ffffff14, #0000 35%), linear-gradient(#090a0a 0%, #151718 100%);
  border: 1px solid #ffffff14;
  border-radius: 22px;
  min-height: 58vh;
}

.viewer-shell__card {
  text-align: center;
  background: #f0eee614;
  min-width: min(480px, 100% - 32px);
  padding: 22px;
}

.viewer-shell__spot {
  font-size: 30px;
  font-weight: 700;
}

.viewer-shell__path {
  color: var(--muted);
  word-break: break-all;
  margin-top: 10px;
}

.viewer-fallback {
  display: grid;
  text-align: center;
  place-items:  center;
  min-height: 58vh;
  padding: 24px;
}

.viewer-fallback__title {
  font-size: 24px;
  font-weight: 700;
}

.viewer-fallback__meta, .viewer-fallback__path {
  color: var(--muted);
  margin-top: 10px;
}

.viewer-fallback__path {
  word-break: break-all;
}

.viewer-debug {
  position: absolute;
  z-index: 4;
  backdrop-filter: blur(14px);
  pointer-events: none;
  background: #0e1011d1;
  border: 1px solid #ffffff1f;
  border-radius: 18px;
  width: min(380px, 100% - 32px);
  padding: 14px;
  top: 16px;
  right: 16px;
  box-shadow: 0 20px 48px #00000057;
}

.viewer-debug__meta, .viewer-debug__hotspots {
  display: grid;
  gap: 8px;
}

.viewer-debug__row, .viewer-debug__hotspot-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.viewer-debug__row span, .viewer-debug__hotspot-row strong {
  color: var(--accent);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.viewer-debug__row strong, .viewer-debug__hotspot-row span {
  color: var(--text);
}

.viewer-debug__click {
  color: var(--muted);
  white-space: pre-line;
  background: #ffffff0f;
  border-radius: 14px;
  margin: 12px 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.viewer-debug__hotspots {
  border-top: 1px solid #ffffff14;
  padding-top: 12px;
}

.viewer-debug__hotspot-row {
  grid-template-columns: 30px repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.viewer-debug-marker {
  background: #ffffff1f;
  border: 2px solid #fffffff5;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  box-shadow: 0 0 0 6px #ffffff1a, 0 10px 22px #00000047;
}

.floorplan-shell {
  background: linear-gradient(135deg, #d7a86e17, #0000 55%), #ffffff05;
  min-height: 180px;
  padding: 22px;
}

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

.floorplan-backdrop {
  fill: #ffffff08;
}

.floorplan-image {
  opacity: .94;
  pointer-events: none;
}

.floorplan-room {
  fill: color-mix(in srgb, var(--room-color) 22%, transparent);
  stroke: color-mix(in srgb, var(--room-color) 70%, white 10%);
  stroke-width: 3;
}

.floorplan-room-label rect {
  fill: #131516d1;
  stroke: #ffffff1f;
  stroke-width: 1;
}

.floorplan-room-label text {
  font-family: IBM Plex Sans, Segoe UI, sans-serif;
}

.floorplan-room-label__title {
  fill: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.floorplan-room-label__meta {
  fill: var(--muted);
  font-size: 11px;
}

.floorplan-link {
  stroke: #ffffff38;
  stroke-width: 3;
  stroke-dasharray: 8 10;
}

.floorplan-point {
  fill: #f1ede4;
  stroke: #131516f2;
  stroke-width: 3.5;
  cursor: pointer;
  transition: fill .14s;
}

.floorplan-point:hover, .floorplan-point.is-active {
  fill: var(--accent);
}

.hotspot {
  position: relative;
  display: grid;
  color: var(--text);
  cursor: pointer;
  opacity: .52;
  transform-style: preserve-3d;
  background: none;
  border: 0;
  border-radius: 999px;
  place-items:  center;
  width: 72px;
  height: 72px;
  padding: 0;
  transition: opacity .14s, transform .14s;
}

.hotspot:before, .hotspot:after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  inset: 0;
}

.hotspot:before {
  background: #ffffff14;
  border: 2px solid #ffffffe6;
  inset: 12px;
  box-shadow: 0 12px 24px #00000038, inset 0 0 0 1px #ffffff38;
}

.hotspot:after {
  background: #ffffff0d;
  border: 2px solid #ffffff9e;
  inset: 21px;
}

.hotspot__index, .hotspot__debug {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s, transform .14s;
  transform: translateY(4px);
}

.hotspot__index {
  font-size: 14px;
  font-weight: 700;
}

.hotspot__debug {
  color: var(--text);
  letter-spacing: .03em;
  background: #121415e0;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  min-width: max-content;
  padding: 4px 8px;
  font-size: 11px;
  top: calc(100% + 8px);
}

.hotspot:hover {
  opacity: 1;
  outline: 0;
  transform: translateY(-1px);
}

.hotspot:focus-visible {
  opacity: 1;
  outline: 0;
  transform: translateY(-1px);
}

.hotspot:hover:before {
  background: #ffffff29;
  border-color: #fff;
}

.hotspot:focus-visible:before {
  background: #ffffff29;
  border-color: #fff;
}

.hotspot:hover:after {
  border-color: #ffffffd6;
}

.hotspot:focus-visible:after {
  border-color: #ffffffd6;
}

.hotspot:hover .hotspot__index, .hotspot:hover .hotspot__debug {
  opacity: 1;
  transform: translateY(0);
}

.hotspot:focus-visible .hotspot__index {
  opacity: 1;
  transform: translateY(0);
}

.hotspot:focus-visible .hotspot__debug {
  opacity: 1;
  transform: translateY(0);
}

.viewer-cursor-ring {
  position: relative;
  pointer-events: none;
  opacity: .98;
  background: none;
  border-radius: 999px;
  width: 88px;
  height: 88px;
}

.viewer-cursor-ring:before, .viewer-cursor-ring:after {
  content: "";
  position: absolute;
  border-radius: 999px;
  inset: 0;
}

.viewer-cursor-ring:before {
  background: #ffffff12;
  border: 3px solid #fffffffa;
  inset: 8px;
  box-shadow: 0 0 0 8px #ffffff14, 0 18px 32px #00000042;
}

.viewer-cursor-ring:after {
  background: #ffffff0a;
  border: 2px solid #ffffffb8;
  inset: 18px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .viewer-shell {
    min-height: 42vh;
  }

  .viewer-debug {
    width: calc(100% - 24px);
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 640px) {
  .sidebar, .main-panel {
    padding: 18px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .viewer-panel, .floorplan-panel {
    padding: 18px;
  }

  .viewer-panel__header, .floorplan-panel__header {
    flex-direction: column;
  }

  .viewer-debug__row, .viewer-debug__hotspot-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
