@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-dark: #07070c;
  --panel-bg: rgba(14, 14, 28, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --neon-cyan: #00f0ff;
  --neon-pink: #ff007f;
  --neon-cyan-glow: rgba(0, 240, 255, 0.35);
  --neon-pink-glow: rgba(255, 0, 127, 0.35);
  --text-primary: #ffffff;
  --text-secondary: #8f92a3;
  --text-muted: #555768;
  --success: #00ff66;
  --error: #ff3366;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

/* Screen Overlay Layouts */
.overlay-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  background: radial-gradient(circle at center, rgba(14, 15, 30, 0.95) 0%, var(--bg-dark) 100%);
}

.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Card Containers */
.card-content {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Heading Typography */
h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 30%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Custom Icons / Visuals */
.icon-container {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.icon-warning {
  border-color: rgba(255, 170, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.15);
  color: #ffaa00;
}

.icon-location {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 20px var(--neon-cyan-glow);
  color: var(--neon-cyan);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 16px 28px;
  border-radius: 12px;
  border: 1px solid var(--neon-cyan);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1) 0%, rgba(0, 240, 255, 0.25) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(0, 240, 255, 0.1);
  text-transform: uppercase;
}

.btn-primary:hover, .btn-primary:focus {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--neon-cyan-glow), inset 0 0 15px rgba(0, 240, 255, 0.2);
  border-color: #fff;
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Radar Animation Screen */
.radar-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 32px;
}

.radar-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-circle::before, .radar-circle::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.1);
}

.radar-circle::before {
  width: 66%;
  height: 66%;
}

.radar-circle::after {
  width: 33%;
  height: 33%;
}

.radar-sweep {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 0;
  left: 50%;
  background: linear-gradient(45deg, var(--neon-cyan-glow) 0%, transparent 80%);
  transform-origin: 0% 100%;
  animation: radarScan 4s linear infinite;
  border-radius: 0 100% 0 0;
}

.radar-blip {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--neon-pink);
  box-shadow: 0 0 15px var(--neon-pink);
  transform: translate(-50%, -50%);
  animation: blipPulse 2s ease-out infinite;
}

.radar-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 24px solid var(--neon-cyan);
  filter: drop-shadow(0 0 8px var(--neon-cyan));
  transform-origin: center 70%;
  transform: translate(-50%, -70%) rotate(0deg);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.radar-arrow-shadow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

/* Cheat / Simulation Toggle on Radar Dashboard */
.simulation-panel {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.simulation-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.simulation-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.simulation-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Switch Toggle Styling */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-muted);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input:checked + .slider {
  background-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Distance Indicator Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.stat-item {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
}

.stat-val {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neon-cyan);
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* AR Mode HUD (Heads-Up Display) */
#ar-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through to A-Frame scene */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

/* HUD Top Bar */
.hud-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto; /* Enable clicks on HUD elements */
}

.hud-pill {
  padding: 10px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
}

.hud-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: blipPulse 1.5s infinite;
}

.hud-title {
  color: #fff;
  letter-spacing: 0.5px;
}

.hud-pill-distance {
  border-color: rgba(255, 0, 127, 0.25);
}

.hud-distance-val {
  color: var(--neon-pink);
  font-weight: 700;
}

/* Floating Actions HUD Bottom */
.hud-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  margin-bottom: 10px;
}

.hud-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(14, 14, 28, 0.85);
  border: 1px solid var(--panel-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  padding: 14px 22px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  line-height: 1.5;
  letter-spacing: 0.3px;
  max-width: 90vw;
}

/* Animation Keyframes */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes radarScan {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes blipPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 0, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0);
  }
}

/* WebGL canvas container */
#ar-scene-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* Hide default A-Frame VR buttons which mess up the layout on mobile */
.a-enter-vr-button, .a-enter-ar-button {
  display: none !important;
}
