/* app/src/styles.css */
:root {
  --bg: #090a0a;
  --text: #f4f1e8;
  --muted: #c4beb1;
  --line: #ffffff1f;
  --accent: #d7a86e;
}

* {
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  margin: 0;
  font-family: IBM Plex Sans, Segoe UI, sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
  min-height: 100dvh;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

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

.layout {
  min-height: 100vh;
  background: var(--bg);
  width: 100%;
  min-height: 100dvh;
}

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

.viewer-pano-stage, .viewer-dollhouse-stage {
  position: absolute;
  inset: 0;
}

.viewer-pano-stage.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.viewer-dollhouse-stage {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s;
}

.viewer-dollhouse-stage.is-active {
  opacity: 1;
  pointer-events: auto;
}

.viewer-dollhouse-stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-surface-overlay {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: 0;
}

.viewer-surface-overlay__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-transition-overlay {
  position: absolute;
  z-index: 3;
  display: block;
  pointer-events: none;
  width: 100%;
  height: 100%;
  inset: 0;
}

.transition-lab {
  position: absolute;
  z-index: 5;
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  background: #0e1011d1;
  border-radius: 8px;
  width: min(360px, 100% - 32px);
  padding: 12px;
  bottom: 16px;
  left: 16px;
  box-shadow: 0 20px 48px #00000057;
}

.transition-lab__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.transition-lab__header span, .transition-lab__meta {
  color: var(--muted);
}

.transition-lab__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.transition-lab__button {
  appearance: none;
  color: var(--text);
  cursor: pointer;
  background: #ffffff14;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  min-width: 38px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.2;
}

.transition-lab__button:hover {
  outline: 0;
  background: #d7a86e2e;
  border-color: #d7a86e80;
}

.transition-lab__button:focus-visible {
  outline: 0;
  background: #d7a86e2e;
  border-color: #d7a86e80;
}

.transition-lab__button.is-active {
  color: #f3c48f;
  background: #d7a86e38;
  border-color: #d7a86e8a;
}

.transition-lab__button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.transition-lab__meta {
  margin-top: 8px;
  font-size: 11px;
}

.viewer-shell.is-transitioning .viewer-pano-stage, .viewer-shell.is-transitioning .viewer-surface-overlay {
  pointer-events: none;
}

.viewer-fallback {
  min-height: 100vh;
  display: grid;
  text-align: center;
  place-items:  center;
  min-height: 100dvh;
  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;
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  background: #0e1011d1;
  border-radius: 8px;
  width: min(380px, 100% - 32px);
  padding: 14px;
  top: 16px;
  right: 16px;
  box-shadow: 0 20px 48px #00000057;
}

.viewer-fullscreen {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items:  center;
  width: 44px;
  min-width: 0;
  height: 44px;
  padding: 0;
  top: 16px;
  left: 16px;
}

.viewer-mode-toggle {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  gap: 8px;
  top: 16px;
  left: 72px;
}

.viewer-mode-toggle__button {
  min-width: 88px;
}

.viewer-fullscreen__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

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

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

.viewer-debug__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.viewer-debug__button {
  appearance: none;
  color: var(--text);
  cursor: pointer;
  background: #ffffff14;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  padding: 8px 12px;
  transition: background .14s, border-color .14s, opacity .14s;
  font-size: 12px;
  line-height: 1.2;
}

.viewer-debug__button:hover {
  outline: 0;
  background: #d7a86e2e;
  border-color: #d7a86e80;
}

.viewer-debug__button:focus-visible {
  outline: 0;
  background: #d7a86e2e;
  border-color: #d7a86e80;
}

.viewer-debug__button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.viewer-debug__button.is-active {
  color: #f3c48f;
  background: #d7a86e38;
  border-color: #d7a86e8a;
}

.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: 0;
  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: 8px;
  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;
}

.viewer-shell:-webkit-full-screen .viewer-fullscreen {
  top: 24px;
  left: 24px;
}

.viewer-shell:fullscreen .viewer-fullscreen {
  top: 24px;
  left: 24px;
}

.viewer-shell:-webkit-full-screen .viewer-debug {
  overflow: auto;
  max-height: calc(100vh - 48px);
  top: 24px;
  right: 24px;
}

.viewer-shell:fullscreen .viewer-debug {
  overflow: auto;
  max-height: calc(100vh - 48px);
  top: 24px;
  right: 24px;
}

.hotspot {
  color: #101010;
  cursor: pointer;
  background: #d7a86ec7;
  border: 0;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 8px 20px #00000038;
}

.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: 0;
  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 {
  outline: 0;
  background: #f5c98cf2;
}

.hotspot:focus-visible {
  outline: 0;
  background: #f5c98cf2;
}

.hotspot--surface-proxy {
  opacity: 0;
  box-shadow: none;
  pointer-events: none;
  background: none;
}

.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);
}

@media (max-width: 960px) {
  .viewer-debug {
    width: calc(100% - env(safe-area-inset-left)  - env(safe-area-inset-right)  - 24px);
    top: calc(env(safe-area-inset-top)  + 12px);
    right: calc(env(safe-area-inset-right)  + 12px);
  }

  .viewer-fullscreen {
    top: calc(env(safe-area-inset-top)  + 12px);
    left: calc(env(safe-area-inset-left)  + 12px);
  }

  .viewer-mode-toggle {
    top: calc(env(safe-area-inset-top)  + 12px);
    left: calc(env(safe-area-inset-left)  + 68px);
  }
}

@media (max-width: 640px) {
  .viewer-debug__row, .viewer-debug__hotspot-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
