/* Tour 360 — Búfalo Country Club / Redata */

:root {
  --bg: #10141a;
  --panel: #1a212b;
  --accent: #4caf50;
  --accent-dark: #38803c;
  --text: #f2f5f7;
  --muted: #9aa7b2;
  --danger: #d32f2f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Visor ---------- */

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px;
  background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
}

#topbar-left { display: flex; align-items: center; gap: 12px; }

#brand {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 6px 10px;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#brand img { height: 38px; width: auto; }

#topbar-text { display: flex; flex-direction: column; gap: 2px; }

#tour-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#scene-name {
  font-size: 13px;
  color: #e8edf1;
  background: rgba(16, 20, 26, 0.55);
  border-radius: 999px;
  padding: 3px 10px;
  align-self: flex-start;
  text-shadow: none;
}

#preview-badge {
  pointer-events: none;
  background: rgba(255, 176, 32, 0.95);
  color: #231a00;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 14px;
}

#topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#btn-back {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(16, 20, 26, 0.75);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
}

#btn-back:hover { border-color: #38bdf8; }

#credit {
  position: absolute;
  right: 14px;
  bottom: 72px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  color: #333;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  opacity: 0.9;
  transition: opacity 0.15s;
}

#credit:hover { opacity: 1; }

#credit img { height: 14px; width: auto; }

#scene-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  pointer-events: auto;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.scene-chip {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(16, 20, 26, 0.75);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.scene-chip:hover { border-color: var(--accent); }

.scene-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b120c;
  font-weight: 600;
}

#load-error {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 20px 26px;
  max-width: 480px;
  font-size: 15px;
}

/* ---------- Editor ---------- */

body.editor { overflow: hidden; }

#editor-wrap {
  display: flex;
  height: 100vh;
}

#editor-scene {
  position: relative;
  flex: 1;
  min-width: 0;
}

#editor-scene a-scene {
  height: 100%;
  width: 100%;
}

#editor-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 20, 26, 0.8);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

#editor-status {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(76, 175, 80, 0.9);
  color: #0b120c;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#editor-status.show { opacity: 1; }

#editor-panel {
  width: 400px;
  flex-shrink: 0;
  background: var(--panel);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  overflow-y: auto;
}

#editor-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

#editor-panel h3 {
  margin: 18px 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

#editor-panel h4 {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

button:hover { border-color: var(--accent); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b120c;
  font-weight: 600;
}

button.primary:hover { background: var(--accent-dark); }

button.danger { border-color: var(--danger); color: #ff8a80; }
button.danger:hover { background: rgba(211, 47, 47, 0.15); }

button.small { padding: 4px 10px; font-size: 12px; }

#ed-scenes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#ed-scenes li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  border: 1px solid transparent;
}

#ed-scenes li:hover { border-color: rgba(255, 255, 255, 0.2); }
#ed-scenes li.active { border-color: var(--accent); background: rgba(76, 175, 80, 0.12); }

#ed-scenes .scene-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ed-scenes .badge-start {
  font-size: 11px;
  background: var(--accent);
  color: #0b120c;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
}

#ed-scene-detail label {
  display: block;
  margin: 8px 0;
  font-size: 13px;
  color: var(--muted);
}

#ed-scene-detail input[type="text"],
#ed-scene-detail select {
  width: 100%;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
}

#ed-scene-detail .row-buttons {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

#ed-hotspot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hotspot-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.hotspot-item.selected { border-color: var(--accent); }

.hotspot-item .hotspot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.hotspot-item label {
  display: block;
  margin: 6px 0;
  font-size: 12px;
  color: var(--muted);
}

.hotspot-item input[type="text"],
.hotspot-item select {
  width: 100%;
  margin-top: 3px;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 13px;
}

.editor-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
