/* ==========================================================================
   WAYFINDING MALL NAVIGATOR - ESTILOS PRINCIPAIS
   ========================================================================== */

:root {
  --bg-dark: #0d1117;
  --bg-card: #161b22;
  --accent-blue: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.4);
  --store-selected-fill: #2563eb;
  --store-selected-stroke: #60a5fa;
  --kiosk-panel-width: 420px;
}

body.kiosk-mode, body.editor-mode, body.mobile-mode {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
}

/* ==========================================================================
   CONTAINER DO MAPA & VIEWPORT SVG (PAN & ZOOM)
   ========================================================================== */
.map-viewport-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #171d2b 0%, #0c1017 100%);
  overflow: hidden;
  cursor: grab;
}

.map-viewport-container.grabbing {
  cursor: grabbing;
}

#map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

#map-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   ESTILIZAÇÃO INTERATIVA DO SVG DAS LOJAS
   ========================================================================== */
.store-polygon {
  cursor: pointer;
  transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

.store-polygon:hover {
  fill: #334155 !important;
  stroke: #60a5fa !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.5));
}

.store-polygon.store-selected {
  fill: var(--store-selected-fill) !important;
  stroke: var(--store-selected-stroke) !important;
  stroke-width: 3.5px !important;
  filter: drop-shadow(0 0 16px rgba(37, 99, 235, 0.9));
  animation: pulseStore 2s infinite alternate ease-in-out;
}

@keyframes pulseStore {
  0% {
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 1));
  }
}

.store-label {
  pointer-events: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: 0.5px;
}

.store-sublabel {
  pointer-events: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ==========================================================================
   ANIMAÇÃO DO CAMINHO DE NAVEGAÇÃO (STROKE-DASHARRAY / STROKE-DASHOFFSET)
   ========================================================================== */
.nav-route-line-bg {
  fill: none;
  stroke: rgba(2, 132, 199, 0.25);
  stroke-width: 10px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-route-line {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14 10;
  animation: routeFlow 1s linear infinite;
  filter: drop-shadow(0 0 8px #38bdf8);
}

@keyframes routeFlow {
  from {
    stroke-dashoffset: 48;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Marcador do Totem "Você está aqui" */
.totem-pin-pulse {
  animation: pulseRing 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  transform-origin: center;
}

@keyframes pulseRing {
  0% {
    r: 12;
    opacity: 0.9;
  }
  100% {
    r: 35;
    opacity: 0;
  }
}

/* ==========================================================================
   PAINÉIS FLUTUANTES DO TOTEM
   ========================================================================== */
.kiosk-floating-sidebar {
  position: absolute;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: var(--kiosk-panel-width);
  max-width: calc(100vw - 40px);
  background: rgba(22, 27, 34, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kiosk-floating-sidebar.collapsed {
  transform: translateX(calc(-100% - 30px));
}

.kiosk-store-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.kiosk-store-item {
  cursor: pointer;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.kiosk-store-item:hover, .kiosk-store-item.active {
  background-color: rgba(56, 189, 248, 0.12);
}

/* Card Destino e QR Code Flutuante */
.route-info-card {
  position: absolute;
  bottom: 25px;
  right: 25px;
  width: 360px;
  max-width: calc(100vw - 50px);
  background: rgba(22, 27, 34, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
  z-index: 105;
  transition: all 0.35s ease;
}

/* Teclado Virtual Touchscreen na Tela */
.virtual-keyboard {
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 18px 18px;
  padding: 10px;
}

.vk-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 5px;
}

.vk-key {
  height: 44px;
  min-width: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
}

.vk-key:active {
  background: var(--accent-blue);
  color: #000;
  transform: scale(0.95);
}

.vk-key.special {
  min-width: 55px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.95rem;
}

/* Controles de Zoom Flutuantes */
.map-controls-floating {
  position: absolute;
  top: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}

.map-control-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.map-control-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* Barra de Inatividade */
.inactivity-progress-bar {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
}

.inactivity-fill {
  height: 100%;
  width: 100%;
  background: #38bdf8;
  transition: width 1s linear;
}

/* ==========================================================================
   MODO EDITOR CARTOGRÁFICO
   ========================================================================== */
.editor-node-circle {
  cursor: pointer;
  transition: transform 0.2s;
}

.editor-node-circle:hover {
  transform: scale(1.3);
}

.editor-edge-line {
  stroke: #475569;
  stroke-width: 2.5px;
  stroke-dasharray: 4, 4;
}

.editor-edge-line.active {
  stroke: #10b981;
  stroke-width: 3px;
}
