/* MeetNav — Vanilla CSS */
/* Fonts loaded in index.html: Outfit + DM Mono */

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

:root {
  --bg: #111;
  --bg-card: #1a1a1a;
  --bg-elevated: #222;
  --accent: #ff6b2b;
  --accent-glow: rgba(255, 107, 43, 0.4);
  --accent-soft: rgba(255, 107, 43, 0.12);
  --success: #4ade80;
  --success-glow: rgba(74, 222, 128, 0.3);
  --warning: #fbbf24;
  --text: #f5f5f5;
  --text-dim: #888;
  --text-muted: #555;
  --border: #2a2a2a;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 50px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ─── App Shell ─── */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Typography ─── */
.mono { font-family: 'DM Mono', monospace; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-center { text-align: center; }

/* ─── Buttons ─── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  font-weight: 400;
  font-size: 14px;
  padding: 12px;
}

/* ─── Shared Components ─── */

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* GPS badge */
.gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius-pill);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--success);
}
.gps-badge.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Status dot */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-live {
  background: var(--success);
  box-shadow: 0 0 10px var(--success-glow);
  animation: blink 1.2s ease-in-out infinite;
}
.dot-accent {
  background: var(--accent);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.dot-warning {
  background: var(--warning);
  animation: blink 0.8s ease-in-out infinite;
}

/* Card */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card-glow::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ═══════════════════════════════════
   SCREEN: HOME
═══════════════════════════════════ */
.home-screen {
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.home-bg-glow {
  position: absolute;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,107,43,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.home-logo-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.home-logo-icon::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(255,107,43,0.15);
  animation: pulseSlow 3s ease-in-out infinite;
}
.home-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #fff 30%, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.home-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 300;
  margin-bottom: 32px;
}
.home-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Join input */
.join-input-wrap {
  display: flex;
  gap: 8px;
}
.join-input {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}
.join-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 2px;
  font-size: 14px;
}
.join-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ═══════════════════════════════════
   SCREEN: LINK / SHARE
═══════════════════════════════════ */
.link-screen {
  justify-content: center;
  gap: 8px;
}
.session-code {
  font-family: 'DM Mono', monospace;
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 10px;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
  text-align: center;
}
.session-url {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}
.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.share-btn:active { opacity: 0.7; }
.share-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.link-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════
   SCREEN: WAITING
═══════════════════════════════════ */
.waiting-screen {
  justify-content: center;
  align-items: center;
}
.pulse-container {
  position: relative;
  width: 160px; height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.pulse-ring {
  position: absolute;
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: pulseExpand 2.4s ease-out infinite;
}
.pulse-ring:nth-child(2) { animation-delay: 0.8s; }
.pulse-ring:nth-child(3) { animation-delay: 1.6s; }
.waiting-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff9a5c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 30px var(--accent-glow);
}
.waiting-text {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

/* ═══════════════════════════════════
   SCREEN: NAVIGATE (CORE)
═══════════════════════════════════ */
.nav-screen {
  align-items: center;
  padding-bottom: 0;
  gap: 0;
}
.nav-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--success);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.map-toggle {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
}
.map-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.map-toggle svg { width: 16px; height: 16px; }

/* Context bar */
.nav-context-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 6px;
}
.nav-context-bar svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.ctx-label { font-size: 10px; color: var(--text-muted); }

/* Instruction */
.nav-instruction {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
}
.nav-sub {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
}

/* Arrow */
.nav-arrow-wrap {
  position: relative;
  width: 200px; height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 12px;
}
.nav-arrow-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,43,0.06) 0%, transparent 70%);
}
.nav-arrow-ring {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 2px solid #1e1e1e;
}
.nav-sonar {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: pulseExpand 2.8s ease-out infinite;
}
.nav-sonar:nth-child(3) { animation-delay: 0.9s; }
.nav-sonar:nth-child(4) { animation-delay: 1.8s; }
.nav-arrow-svg {
  position: relative;
  z-index: 3;
  width: 110px; height: 110px;
  filter: drop-shadow(0 0 18px var(--accent-glow)) drop-shadow(0 0 40px rgba(255,107,43,0.15));
  transition: transform 0.4s ease;
}

/* Distance */
.nav-distance {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  text-align: center;
}
.nav-distance .unit {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 2px;
}

/* Waypoints */
.nav-waypoints {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 4px;
  margin-top: 10px;
}
.wp {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.wp-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
}
.wp-dot.filled { background: var(--accent); }
.wp-dot.small { width: 7px; height: 7px; border-color: var(--text-muted); }
.wp-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.wp-label.active { color: var(--accent); font-weight: 500; }
.wp-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 14px;
  position: relative;
  top: -8px;
}
.wp-line.done { background: var(--accent); }

/* ETA */
.nav-eta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
}

/* Partner bar */
.partner-bar {
  width: calc(100% + 40px);
  margin: auto -20px 0;
  padding: 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.partner-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.partner-info { flex: 1; min-width: 0; }
.partner-name { font-size: 14px; font-weight: 600; }
.partner-status {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.floor-badge {
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

/* Static map image */
.static-map-wrap {
  width: calc(100% + 40px);
  margin: 0 -20px;
  height: 180px;
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: #0d1117;
}
.static-map-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}
.static-map-wrap .map-close {
  position: absolute;
  top: 8px; right: 8px;
  padding: 4px 10px;
  background: rgba(17,17,17,0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════
   SCREEN: PROXIMITY
═══════════════════════════════════ */
.prox-screen {
  gap: 12px;
}
.prox-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--warning);
}
.prox-warning svg { width: 18px; height: 18px; flex-shrink: 0; }
.prox-building {
  text-align: center;
  padding: 16px 0 8px;
}
.prox-building-icon { font-size: 48px; margin-bottom: 8px; }
.prox-building-text { font-size: 18px; font-weight: 700; color: var(--success); }
.prox-building-dist {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.section-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}
.floor-selector {
  display: flex;
  gap: 8px;
}
.floor-btn {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.floor-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.floor-btn.partner {
  border-color: rgba(99, 102, 241, 0.4);
  color: #a78bfa;
}
.hint-row {
  display: flex;
  gap: 8px;
}
.hint-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  outline: none;
}
.hint-input::placeholder { color: var(--text-muted); }
.hint-input:focus { border-color: var(--accent); }
.hint-send {
  width: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.hint-send svg { width: 20px; height: 20px; fill: #fff; }
.partner-hint {
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #c4b5fd;
}
.partner-hint .hint-from {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: #8b7ec8;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ═══════════════════════════════════
   SCREEN: ARRIVED
═══════════════════════════════════ */
.arrived-screen {
  justify-content: center;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti {
  position: absolute;
  width: 6px;
  border-radius: 2px;
  animation: confettiFall linear infinite;
  opacity: 0.7;
}
.arrived-emoji {
  font-size: 64px;
  position: relative;
  z-index: 2;
  animation: celebrateBounce 0.8s ease infinite alternate;
}
.arrived-title {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  position: relative;
  z-index: 2;
}
.arrived-sub {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  position: relative;
  z-index: 2;
  margin-bottom: 20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.arrived-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
}

/* ═══════════════════════════════════
   ERROR / PERMISSION SCREEN
═══════════════════════════════════ */
.error-screen {
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.error-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════
   ANIMATIONS
═══════════════════════════════════ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
@keyframes pulseExpand {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes pulseSlow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.2; }
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@keyframes celebrateBounce {
  from { transform: scale(1) rotate(-3deg); }
  to   { transform: scale(1.08) rotate(3deg); }
}

/* ═══════════════════════════════════
   UTILITIES
═══════════════════════════════════ */
.hidden { display: none !important; }
.spacer { flex: 1; }
.mt-auto { margin-top: auto; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.w-full { width: 100%; }
