@tailwind base;
@tailwind components;
@tailwind utilities;

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: #090d16;
  color: #f8fafc;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.glass-panel {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-panel-glow {
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6), 0 0 25px 0 rgba(16, 185, 129, 0.2);
}

.dpad-btn {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dpad-btn:active {
  background: rgba(16, 185, 129, 0.6) !important;
  border-color: #34d399 !important;
  transform: scale(0.92);
}

.project-marker-3d {
  transform: translate(-50%, -100%);
  will-change: transform;
}

.landmark-marker-3d {
  transform: translate(-50%, -100%);
  will-change: transform;
}

#streetview-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.streetview-warp-forward,
.streetview-gta-thrust-forward {
  animation: gta-forward-thrust 0.36s cubic-bezier(0.12, 0.9, 0.28, 1) forwards;
  will-change: transform, filter;
}

.streetview-warp-backward,
.streetview-gta-thrust-backward {
  animation: gta-backward-thrust 0.36s cubic-bezier(0.12, 0.9, 0.28, 1) forwards;
  will-change: transform, filter;
}

.streetview-gta-sprint-forward {
  animation: gta-sprint-thrust 0.22s cubic-bezier(0.1, 0.95, 0.2, 1) forwards;
  will-change: transform, filter;
}

@keyframes gta-forward-thrust {
  0% {
    transform: scale(1) translateZ(0);
    filter: brightness(1) contrast(1) blur(0px);
  }
  35% {
    transform: scale(1.16) translateZ(50px) translateY(3px);
    filter: brightness(1.07) contrast(1.04) blur(1.8px);
  }
  70% {
    transform: scale(1.03) translateZ(10px) translateY(-1px);
    filter: brightness(1.02) contrast(1.01) blur(0.4px);
  }
  100% {
    transform: scale(1) translateZ(0);
    filter: brightness(1) contrast(1) blur(0px);
  }
}

@keyframes gta-backward-thrust {
  0% {
    transform: scale(1) translateZ(0);
    filter: brightness(1);
  }
  40% {
    transform: scale(0.91) translateZ(-35px) translateY(-2px);
    filter: brightness(0.96) blur(1.2px);
  }
  100% {
    transform: scale(1) translateZ(0);
    filter: brightness(1);
  }
}

@keyframes gta-sprint-thrust {
  0% {
    transform: scale(1);
    filter: blur(0px);
  }
  45% {
    transform: scale(1.22) translateZ(80px);
    filter: brightness(1.12) blur(2.5px);
  }
  100% {
    transform: scale(1);
    filter: blur(0px);
  }
}

/* Túnel de velocidad radial cinemático GTA V */
.streetview-speed-tunnel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(15, 23, 42, 0.35) 75%, rgba(2, 6, 23, 0.75) 100%);
  mix-blend-mode: multiply;
  transition: opacity 0.15s ease;
}

.streetview-speed-tunnel.is-active {
  opacity: 1;
  animation: gta-tunnel-pulse 0.34s ease forwards;
}

.streetview-speed-tunnel.is-sprint {
  opacity: 1;
  background: radial-gradient(circle at center, transparent 25%, rgba(16, 185, 129, 0.12) 65%, rgba(2, 6, 23, 0.85) 100%);
  animation: gta-tunnel-pulse 0.22s ease forwards;
}

@keyframes gta-tunnel-pulse {
  0% { opacity: 0; transform: scale(0.96); }
  40% { opacity: 0.85; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1); }
}

.pnlm-load-button, .pnlm-load-box, .pnlm-lbox {
  display: none !important;
}

.pnlm-panorama-info {
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  border-radius: 12px !important;
}

/* Flechas de Navegación 360 en Perspectiva 3D Estilo Google Street View */
.pnlm-hotspot-base {
  pointer-events: auto !important;
}

.streetview-ground-arrow, .streetview-ground-arrow-back, .streetview-ground-arrow-finish {
  width: 120px !important;
  height: 90px !important;
  margin-left: -60px !important;
  margin-top: -45px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
  pointer-events: auto !important;
}

.streetview-nav-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.streetview-nav-widget:hover {
  transform: scale(1.2);
  filter: brightness(1.25);
}

.streetview-nav-widget.is-forward .nav-arrow-disc {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #0ea5e9 0%, #0284c7 65%, #0369a1 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.95), 0 8px 22px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: perspective(220px) rotateX(48deg);
  animation: nav-bounce-forward 1.3s infinite ease-in-out;
}

.streetview-nav-widget.is-forward .nav-arrow-icon {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.streetview-nav-widget.is-back .nav-arrow-disc {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #f43f5e 0%, #e11d48 65%, #be123c 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.95), 0 8px 22px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: perspective(220px) rotateX(48deg);
  animation: nav-bounce-back 1.3s infinite ease-in-out;
}

.streetview-nav-widget.is-back .nav-arrow-icon {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.streetview-nav-widget .nav-arrow-label {
  margin-top: 4px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  border: 1.5px solid #38bdf8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 12px rgba(14, 165, 233, 0.4);
  white-space: nowrap;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.streetview-nav-widget.is-back .nav-arrow-label {
  border-color: #fb7185;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 12px rgba(244, 63, 94, 0.4);
}

.streetview-nav-widget.is-finish .nav-arrow-disc {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, #f59e0b 0%, #d97706 65%, #b45309 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.95), 0 8px 22px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: perspective(220px) rotateX(48deg);
  animation: nav-bounce-forward 1.3s infinite ease-in-out;
}

.streetview-nav-widget.is-finish .nav-arrow-icon {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.streetview-nav-widget.is-finish .nav-arrow-label {
  border-color: #fbbf24;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 14px rgba(245, 158, 11, 0.6);
  color: #fef08a;
  background: rgba(15, 23, 42, 0.96);
}

.streetview-nav-widget.is-branch .nav-arrow-disc {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, #a855f7 0%, #8b5cf6 65%, #6d28d9 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.95), 0 8px 22px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: perspective(220px) rotateX(48deg);
  animation: nav-bounce-forward 1.2s infinite ease-in-out;
}

.streetview-nav-widget.is-branch .nav-arrow-icon {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.streetview-nav-widget.is-branch .nav-arrow-label {
  border-color: #c084fc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 14px rgba(168, 85, 247, 0.6);
  color: #f3e8ff;
  background: rgba(15, 23, 42, 0.96);
}

@keyframes nav-bounce-forward {
  0%, 100% { transform: perspective(220px) rotateX(48deg) translateY(0); }
  50% { transform: perspective(220px) rotateX(48deg) translateY(-8px); }
}

@keyframes nav-bounce-back {
  0%, 100% { transform: perspective(220px) rotateX(48deg) translateY(0); }
  50% { transform: perspective(220px) rotateX(48deg) translateY(8px); }
}

/* Fallback si no tiene createTooltipFunc */
.streetview-ground-arrow:not(:has(.streetview-nav-widget))::before {
  content: '▲';
  font-size: 40px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 14px #0ea5e9, 0 4px 12px rgba(0,0,0,0.9);
  transform: perspective(200px) rotateX(55deg);
  display: block;
  animation: streetview-bounce-forward 1.2s infinite ease-in-out;
  pointer-events: none;
}

.streetview-ground-arrow-back:not(:has(.streetview-nav-widget))::before {
  content: '▼';
  font-size: 40px;
  font-weight: 900;
  color: #fb7185;
  text-shadow: 0 0 14px #f43f5e, 0 4px 12px rgba(0,0,0,0.9);
  transform: perspective(200px) rotateX(55deg);
  display: block;
  animation: streetview-bounce-backward 1.2s infinite ease-in-out;
  pointer-events: none;
}

.streetview-click-ripple {
  position: fixed;
  width: 50px;
  height: 50px;
  margin-left: -25px;
  margin-top: -25px;
  border-radius: 50%;
  border: 3px solid #22d3ee;
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 25px #06b6d4;
  pointer-events: none;
  z-index: 9999;
  animation: ripple-grow 0.6s ease-out forwards;
}

@keyframes ripple-grow {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes streetview-bounce-forward {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-8px); opacity: 1; color: #38bdf8; }
}

@keyframes streetview-bounce-backward {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(8px); opacity: 1; color: #fda4af; }
}

/* Realidad Aumentada (AR Tags sobre lotes y servicios) */
.ar-tag-lot, .ar-tag-service, .ar-tag-panorama {
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(10px) !important;
  padding: 6px 14px !important;
  border-radius: 12px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  animation: ar-float 2.8s infinite ease-in-out !important;
}

.ar-tag-lot.available {
  border: 2px solid #10b981 !important;
  color: #a7f3d0 !important;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.6) !important;
}

.ar-tag-lot.reserved {
  border: 2px solid #f59e0b !important;
  color: #fde68a !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.6) !important;
}

.ar-tag-service {
  border: 2px solid #06b6d4 !important;
  color: #cffafe !important;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.6) !important;
}

.ar-tag-panorama {
  border: 2px solid #a855f7 !important;
  color: #f3e8ff !important;
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.6) !important;
}

.ar-tag-lot:hover, .ar-tag-service:hover, .ar-tag-panorama:hover {
  transform: scale(1.15) !important;
  z-index: 100 !important;
}

@keyframes ar-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.pnlm-tooltip span {
  background: rgba(15, 23, 42, 0.95) !important;
  color: #ffffff !important;
  border: 1px solid #06b6d4 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6) !important;
  white-space: nowrap !important;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.8);
}

/* =========================================================
   CINEMÁTICA Y MOVIMIENTO 3D ESPACIAL ESTILO GTA V
   Efecto de Impulso (Forward Thrust), Bobbing e Inercia de Cámara
   ========================================================= */

#streetview-container {
  perspective: 1100px;
  overflow: hidden;
}

#streetview-container .pnlm-render-container {
  transform-origin: center 58%;
  will-change: transform, filter;
  transition: filter 0.25s ease-out;
}

/* 1. Impulso Hacia Adelante (Forward Thrust estilo GTA V) */
.gta-thrust-forward {
  animation: gtaThrustForward 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gtaThrustForward {
  0% {
    transform: scale(1) translateZ(0);
    filter: blur(0px) brightness(1);
  }
  35% {
    transform: scale(1.10) translateZ(35px) translateY(-2px);
    filter: blur(1.5px) brightness(1.05);
  }
  100% {
    transform: scale(1) translateZ(0);
    filter: blur(0px) brightness(1);
  }
}

/* 2. Impulso Sprint Turbo (Shift + W) */
.gta-thrust-sprint {
  animation: gtaThrustSprint 220ms cubic-bezier(0.12, 1, 0.25, 1) forwards;
}

@keyframes gtaThrustSprint {
  0% {
    transform: scale(1) translateZ(0);
    filter: blur(0px) contrast(1);
  }
  40% {
    transform: scale(1.15) translateZ(55px) translateY(-4px);
    filter: blur(2.2px) contrast(1.08) brightness(1.06);
  }
  100% {
    transform: scale(1) translateZ(0);
    filter: blur(0px) contrast(1);
  }
}

/* 3. Impulso Retroceso (Backward Thrust) */
.gta-thrust-backward {
  animation: gtaThrustBackward 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gtaThrustBackward {
  0% {
    transform: scale(1) translateZ(0);
    filter: blur(0px);
  }
  40% {
    transform: scale(0.93) translateZ(-25px) translateY(3px);
    filter: blur(1.2px);
  }
  100% {
    transform: scale(1) translateZ(0);
    filter: blur(0px);
  }
}

/* 4. Head-Bobbing alternado de pisada humana (Pie Izquierdo / Derecho) */
.gta-bob-left {
  animation: gtaBobLeft 280ms ease-out forwards;
}
.gta-bob-right {
  animation: gtaBobRight 280ms ease-out forwards;
}

@keyframes gtaBobLeft {
  0% { transform: rotate(0deg) translateY(0); }
  35% { transform: rotate(-0.55deg) translateY(3.5px); }
  100% { transform: rotate(0deg) translateY(0); }
}

@keyframes gtaBobRight {
  0% { transform: rotate(0deg) translateY(0); }
  35% { transform: rotate(0.55deg) translateY(3.5px); }
  100% { transform: rotate(0deg) translateY(0); }
}

/* 5. Túnel de Velocidad Radial (Speed Tunnel Vignette GTA V) */
.streetview-speed-tunnel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  background: radial-gradient(circle at center, transparent 38%, rgba(6, 182, 212, 0.08) 75%, rgba(0, 0, 0, 0.72) 100%);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.15s ease-out, transform 0.25s ease-out;
  mix-blend-mode: overlay;
}

.streetview-speed-tunnel.active {
  opacity: 0.85;
  transform: scale(1);
}

.streetview-speed-tunnel.sprint {
  background: radial-gradient(circle at center, transparent 28%, rgba(16, 185, 129, 0.15) 65%, rgba(0, 0, 0, 0.88) 100%);
  opacity: 0.95;
  transform: scale(0.98);
}
