/* ============================================================
   Mapa Ilustrado UnB — estilos
   ============================================================ */
:root {
  /* Paleta em tons de #423056 (roxo) + destaque dourado #FDD06A */
  --bg:        #241a30;   /* roxo mais escuro   */
  --panel:     #322443;   /* variação média     */
  --panel-2:   #423056;   /* a cor base         */
  --line:      #57426f;   /* variação mais clara */
  --text:      #efe9f5;
  --muted:     #b0a2c4;
  --accent:    #fdd06a;   /* dourado */
  --accent-2:  #ffe08c;   /* dourado mais claro */
  --gold:      #fdd06a;
  --shadow:    0 10px 30px rgba(0,0,0,.45);
  --radius:    12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
body { display: flex; flex-direction: column; overflow: hidden; }

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  height: 56px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.topbar__center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
/* .btn:active (transform: translateY(1px)) tem mais especificidade e
   sobrescreveria o translate(-50%,-50%) inteiro, fazendo o botão "pular"
   pra fora do centro ao clicar. Reaplica os dois efeitos juntos aqui. */
.topbar__center.btn:active { transform: translate(-50%, calc(-50% + 1px)); }
.topbar__title { font-size: 16px; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.topbar__title strong { color: var(--accent); }
.topbar__title .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 0 4px rgba(67,197,158,.2);
}
.topbar__actions { display: flex; gap: 8px; }

.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #4d3a64; }
.btn:active { transform: translateY(1px); }
.btn--ghost { width: 38px; padding: 8px 0; text-align: center; }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--icon { display: inline-flex; align-items: center; gap: 8px; }
.btn--icon img { display: block; flex: 0 0 auto; }
/* Ícone preto original com pouco contraste sobre o fundo escuro do topbar:
   inverte pra branco. */
.icon-invert { filter: invert(1) brightness(2); }

/* ---------- Conteúdo (mapa) ---------- */
.content {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* ---------- Mapa ---------- */
.map {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2b4e 0%, var(--bg) 60%);
}

/* ---------- Rota pontilhada até o CEAD ---------- */
.route-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 2 12;
  vector-effect: non-scaling-stroke;   /* espessura fixa no zoom */
  animation: routeDash 1s linear infinite;
}
@keyframes routeDash { to { stroke-dashoffset: -14; } }
.route-end {
  fill: var(--accent);
  stroke: #2a1f38;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.route-label {
  fill: var(--text);
  font: 700 12px system-ui;
  paint-order: stroke;
  stroke: #241a30;
  stroke-width: 4;
  stroke-linejoin: round;
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.overlay:active { cursor: grabbing; }
.placeholder text { user-select: none; }

/* ---------- Prédios ---------- */
.building { cursor: pointer; outline: none; }
.building .hoverbox,
.tour .hoverbox {
  transition: transform .18s cubic-bezier(.2,.7,.3,1.3);
  transform-box: fill-box;
  transform-origin: center;
}
.building .shape {
  stroke: rgba(255,255,255,.45);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;   /* borda fina, não engrossa no zoom */
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.18));
  transition: filter .18s;
}
.building:hover .hoverbox,
.building:focus-visible .hoverbox { transform: scale(1.14); }
.building:hover .shape { filter: drop-shadow(0 4px 9px rgba(0,0,0,.28)); }
.building:focus-visible .shape { stroke: var(--accent-2); stroke-width: 2; }

/* ---------- Pontos de tour 360 ---------- */
.tour { cursor: pointer; outline: none; }
.tour__dot   { fill: var(--accent-2); stroke: #2a1f38; stroke-width: 2; }
.tour__icon  { pointer-events: none; }
.tour__pulse { fill: var(--accent-2); opacity: .35; transform-box: fill-box; transform-origin: center;
  animation: pulse 2s ease-out infinite; }
.tour:hover .hoverbox,
.tour:focus-visible .hoverbox { transform: scale(1.18); }
@keyframes pulse {
  0%   { transform: scale(.6); opacity: .5; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- Destaque do prédio de destino (CEAD) ---------- */
/* Contorno branco + brilho dourado constante na forma do prédio. */
.building--dest .shape {
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 0 5px var(--accent))
          drop-shadow(0 0 12px var(--accent))
          drop-shadow(0 3px 8px rgba(0,0,0,.35));
}
.building--dest:hover .shape {
  filter: drop-shadow(0 0 6px var(--accent))
          drop-shadow(0 0 16px var(--accent))
          drop-shadow(0 5px 11px rgba(0,0,0,.4));
}

/* Marcador (pin + anéis) — não intercepta cliques. */
.dest-marker { pointer-events: none; }

/* Anéis pulsantes ("radar") saindo do prédio. */
.dest-halo {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: destHalo 2.4s ease-out infinite;
}
.dest-halo--2 { animation-delay: 1.2s; }
@keyframes destHalo {
  0%   { transform: scale(.5); opacity: .85; }
  100% { transform: scale(3.4); opacity: 0; }
}

/* Pin dourado flutuante com leve balanço. */
.dest-pin {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: destBob 1.7s ease-in-out infinite;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.4));
}
.dest-pin__body { fill: var(--accent); stroke: #2a1f38; stroke-width: 1.5; }
.dest-pin__star { fill: #2a1f38; font: 700 18px system-ui; user-select: none; }
@keyframes destBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ---------- Toolbar de zoom ---------- */
.toolbar {
  position: absolute;
  left: 14px; bottom: 14px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 15;
}
.tool {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.tool:hover { background: var(--panel-2); }

/* ---------- Busca de local (flutuante, embaixo, centralizada) ---------- */
.place-search {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  z-index: 30;
}

/* Tema escuro do Tom Select, pra combinar com o resto da UI. */
.place-search .ts-wrapper.single .ts-control,
.place-search .ts-wrapper .ts-control {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 11px 18px;
  color: var(--text);
}
.place-search .ts-control input {
  color: var(--text);
  font-size: 14px;
}
.place-search .ts-control input::placeholder { color: var(--muted); }
.place-search .ts-wrapper.single .ts-control::after { display: none; }
.place-search .ts-wrapper.focus .ts-control {
  border-color: var(--accent-2);
  box-shadow: var(--shadow), 0 0 0 3px rgba(255,224,140,.18);
}
.place-search .ts-dropdown {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Abre pra CIMA do campo (não embaixo): o campo fica colado no rodapé
     da tela, então um dropdown pra baixo ficaria cortado/escondido. */
  top: auto;
  bottom: 100%;
  margin: 0 0 8px;
}
.place-search .ts-dropdown .ts-dropdown-content { padding: 6px; max-height: 260px; }
.place-search .ts-dropdown [data-selectable],
.place-search .ts-dropdown .option {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}
.place-search .ts-dropdown .active { background: var(--panel-2); }
.place-search .ts-dropdown .ts-dropdown-content .highlight {
  background: rgba(253,208,106,.35);
  border-radius: 3px;
}
.place-search .ts-wrapper.single.input-active .ts-control,
.place-search .ts-wrapper .ts-control.focus { background: var(--panel); }

/* ---------- Botão flutuante de Localização ---------- */
.fab {
  position: fixed;
  right: 18px; bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px 11px 14px;
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow);
  z-index: 30;
  transition: background .15s, border-color .15s;
}
.fab:hover { background: var(--panel-2); border-color: var(--accent-2); }
.fab svg { color: var(--accent); flex: 0 0 auto; }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 40;
  max-width: 280px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  pointer-events: none;
  display: flex; flex-direction: column; gap: 4px;
}
.tooltip[hidden] { display: none; }
.tooltip strong { font-size: 14px; }
.tooltip span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---------- Modal (tour / ajuda) ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(20,12,28,.86);
  z-index: 60;
  display: flex; flex-direction: column;
}
.modal[hidden] { display: none; }
.modal--center { align-items: center; justify-content: center; }
.modal__bar {
  position: relative;
  height: 52px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.modal__bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.modal__title { font-weight: 600; }
/* Botão "Ver interior do laboratório" centralizado na barra, igual ao
   botão do topbar (mesmo truque de position:absolute + translate). */
.modal__bar-center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.modal__bar-center.btn:active { transform: translate(-50%, calc(-50% + 1px)); }
.modal__close {
  background: transparent; border: none; color: var(--text);
  font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.modal__close:hover { background: rgba(255,255,255,.08); }
.modal__pano { flex: 1 1 auto; }
.pano-fallback {
  height: 100%; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--muted); padding: 24px;
}

/* ---------- Setas de navegação entre cenas 360 (estilo Street View) ---------- */
.pano-arrow { cursor: pointer; }
/* Anel pulsante atrás do ícone — mesma animação do marcador de tour no mapa. */
.pano-arrow__pulse {
  position: absolute;
  left: 0; top: 0;   /* mesma origem (0,0) que o ícone usa antes do translate */
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--panel-2);
  opacity: .35;
  pointer-events: none;
  animation: panoArrowPulse 2s ease-out infinite;
}
@keyframes panoArrowPulse {
  0%   { transform: translate(-50%, -50%) scale(.6); opacity: .5; }
  70%  { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}
.pano-arrow__icon {
  color: var(--panel-2);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 7px rgba(0,0,0,.75));
  opacity: .92;
  transition: transform .12s ease, opacity .12s;
}
.pano-arrow:hover .pano-arrow__icon {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 1;
}
.pano-arrow__label {
  position: absolute;
  left: 50%; top: 16px;
  transform: translateX(-50%);
  background: rgba(20,12,28,.88);
  color: #fff;
  font: 600 12px system-ui;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
.pano-arrow:hover .pano-arrow__label { opacity: 1; }

.help {
  width: min(520px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.help__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.help ul { margin: 0; padding: 14px 22px 20px; line-height: 1.7; color: var(--muted); }
.help li b { color: var(--text); }
.help code { color: var(--accent-2); }

