/* Theme Colors
   Primary: Cyan/Electric Blue (#00e5ff)
   Background: Semi-transparent Dark (#02080f)
   Font: Rajdhani (Tech/Futurism style)
*/

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  font-family: 'Rajdhani', sans-serif;
  color: #00e5ff;
}

/* Fullscreen overlays */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#camera-feed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

#ar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto; /* Allow clicking on 3D text */
}

#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none; /* Let clicks pass through to Three.js */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

/* HUD elements must enable pointer-events to be clickable */
.interactive {
  pointer-events: auto;
}

/* Sci-fi Glow and Borders */
.glow-text {
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 20px rgba(0, 229, 255, 0.4);
}

.glow-border {
  border: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* Top Stats Panel */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.hud-panel {
  background: rgba(2, 8, 15, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 12px 18px;
  border-radius: 4px;
  border-left: 3px solid #00e5ff;
}

.hud-panel h1 {
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.hud-panel p {
  font-size: 0.85rem;
  color: #fff;
  opacity: 0.9;
  font-family: monospace;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background-color: #ff3d00;
  box-shadow: 0 0 8px #ff3d00;
}

.status-active {
  background-color: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
}

/* Bottom Actions Panel */
.hud-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: env(safe-area-inset-bottom, 10px);
}

/* Sci-fi Buttons */
.sci-fi-btn {
  background: rgba(2, 8, 15, 0.8);
  border: 1.5px solid #00e5ff;
  color: #00e5ff;
  padding: 14px 28px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  position: relative;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.sci-fi-btn:hover {
  background: #00e5ff;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
  text-shadow: none;
}

/* Initialization Overlay Screen */
#init-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #020b14 0%, #000205 100%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  transition: opacity 0.5s ease;
}

.logo-container {
  position: relative;
  margin-bottom: 40px;
}

.logo-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-bottom: 2px solid #00e5ff;
  animation: scan 2.5s infinite ease-in-out;
  opacity: 0.5;
  pointer-events: none;
}

#init-screen h2 {
  font-size: 2.2rem;
  letter-spacing: 6px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
}

#init-screen p {
  color: #fff;
  opacity: 0.75;
  font-size: 1rem;
  max-width: 320px;
  line-height: 1.5;
  margin-bottom: 40px;
}

/* Loading Spinners */
.tech-spinner {
  width: 80px;
  height: 80px;
  border: 2px dashed rgba(0, 229, 255, 0.3);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  animation: spin-clockwise 10s infinite linear;
  margin-bottom: 20px;
}

.tech-spinner::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top-color: #00e5ff;
  border-bottom-color: #00e5ff;
  border-radius: 50%;
  animation: spin-counter-clockwise 3s infinite linear;
}

.tech-spinner::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px dotted #00e5ff;
  border-radius: 50%;
}

/* Info Banner for messages */
#info-banner {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(2, 8, 15, 0.85);
  border: 1px solid #ff3d00;
  color: #ff3d00;
  padding: 10px 20px;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  pointer-events: none;
  font-family: monospace;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
}

.banner-visible {
  opacity: 1 !important;
}

/* PWA Install Promo Prompt */
#install-prompt {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(2, 8, 15, 0.9);
  border: 1px solid #00e5ff;
  padding: 12px 20px;
  z-index: 8;
  display: none; /* Triggered dynamically */
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 40px);
  max-width: 380px;
  border-radius: 4px;
}

#install-prompt span {
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 1px;
}

#install-prompt button {
  background: #00e5ff;
  border: none;
  color: #000;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  margin-left: 15px;
  cursor: pointer;
  text-transform: uppercase;
}

/* Animations */
@keyframes scan {
  0% { top: 0%; opacity: 0.1; }
  50% { top: 100%; opacity: 0.7; }
  100% { top: 0%; opacity: 0.1; }
}

@keyframes spin-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spin-counter-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

/* POI Holographic Detail Card Overlay */
#poi-detail-card {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate(-50%, 120%); /* Hidden by default (slid down) */
  width: 95%;
  max-width: 460px;
  background: rgba(2, 12, 22, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #00e5ff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.35), inset 0 0 15px rgba(0, 229, 255, 0.1);
  z-index: 9; /* Placed above standard HUD and install prompt */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#poi-detail-card.active {
  transform: translate(-50%, 0); /* Slide up to center */
  opacity: 1;
  pointer-events: auto;
}

#detail-close-btn {
  position: absolute;
  top: 8px;
  right: 14px;
  background: none;
  border: none;
  color: #ff3d00;
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  text-shadow: 0 0 5px rgba(255, 61, 0, 0.6);
}

#detail-close-btn:hover {
  transform: scale(1.15);
  color: #ff6e40;
}

.detail-content {
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

#detail-title {
  font-size: 1.4rem;
  color: #00e5ff;
  margin: 0 0 4px 0;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#detail-subtitle {
  font-family: monospace;
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 12px;
}

.detail-divider {
  height: 1px;
  background: linear-gradient(90deg, #00e5ff 0%, rgba(0, 229, 255, 0.2) 70%, transparent 100%);
  margin-bottom: 14px;
  width: 100%;
}

.detail-description-container {
  max-height: 220px; /* Increased height to display richer content */
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #00e5ff rgba(2, 12, 22, 0.5);
}

.detail-description-container::-webkit-scrollbar {
  width: 4px;
}

.detail-description-container::-webkit-scrollbar-thumb {
  background: #00e5ff;
  border-radius: 2px;
}

#detail-description {
  font-family: monospace;
  font-size: 0.95rem; /* Increased font-size for better readability */
  line-height: 1.5;
  color: #f1f5f9;
  margin: 0;
}

#detail-link-btn {
  text-align: center;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 10px 20px;
  align-self: center;
  width: auto;
}

#install-close-btn {
  background: none;
  border: none;
  color: #ff3d00;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  margin-left: 15px;
  line-height: 1;
  padding: 0;
  transition: transform 0.2s ease;
  text-shadow: 0 0 5px rgba(255, 61, 0, 0.5);
}

#install-close-btn:hover {
  transform: scale(1.2);
}

