/* ===== AR Experience Styles ===== */
/* Standalone — does not affect index.html / style.css */

:root {
  --bg: #08090b;
  --volt: #0879f6;
  --volt-light: #5aa9ff;
  --volt-bright: #7cc0ff;
  --flame: #ec1429;
  --flame-glow: rgba(236, 20, 41, 0.3);
  --text-primary: #cfe2ff;
  --text-secondary: #a9c8f2;
  --glass: rgba(13, 15, 19, 0.85);
  --glass-border: rgba(8, 121, 246, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.hidden {
  display: none !important;
}

/* ===== Start Screen ===== */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.start-content {
  padding: 2rem;
}

.ar-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(8, 121, 246, 0.15), rgba(236, 20, 41, 0.15));
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--volt);
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.start-content h1 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--volt);
  margin-bottom: 0.25rem;
}

.start-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--flame);
  margin-bottom: 1.5rem;
}

.start-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 280px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

#start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--bg);
  background: linear-gradient(135deg, var(--volt), var(--volt-bright));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(8, 121, 246, 0.3);
}

#start-btn:active {
  transform: scale(0.96);
}

.start-hint {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  opacity: 0.6;
}

/* ===== Camera Feed ===== */
#camera-feed {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
}

/* ===== Three.js Canvas ===== */
#ar-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
}

/* ===== Loading Overlay ===== */
#ar-loading {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 6, 14, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(8, 121, 246, 0.15);
  border-top-color: var(--volt);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== AR UI Overlay ===== */
#ar-ui {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

#ar-ui * {
  pointer-events: auto;
}

/* Top Bar */
.ar-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: max(env(safe-area-inset-top, 12px), 12px) 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(to bottom, rgba(6, 6, 14, 0.7), transparent);
}

.ar-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--volt);
  animation: statusPulse 2s ease-in-out infinite;
}

.ar-status.found .status-dot {
  background: #22c55e;
  animation: none;
}

.ar-status.found .status-text {
  color: #22c55e;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hotspot-btn.gyro-btn {
  position: relative;
  cursor: pointer;
}

.hotspot-btn.gyro-btn i { color: var(--text-secondary); transition: color 0.3s; }

.hotspot-btn.gyro-btn.active {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
}
.hotspot-btn.gyro-btn.active i { color: #22c55e; }

/* Tooltip hint with arrow pointing down to the button */
.gyro-hint {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 7px 14px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  color: #22c55e;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 10;
}
.gyro-hint.show { opacity: 1; }

.gyro-hint-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(0, 0, 0, 0.8);
  border-right: 1px solid rgba(34, 197, 94, 0.35);
  border-bottom: 1px solid rgba(34, 197, 94, 0.35);
}

/* Scan Hint */
.ar-scan-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.scan-frame {
  width: 200px;
  height: 280px;
  margin: 0 auto 1rem;
  border: 2px solid rgba(8, 121, 246, 0.3);
  border-radius: 16px;
  position: relative;
  animation: scanPulse 2.5s ease-in-out infinite;
}

.scan-frame::before,
.scan-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--volt);
  border-style: solid;
}

.scan-frame::before {
  top: -1px;
  left: -1px;
  border-width: 3px 0 0 3px;
  border-radius: 12px 0 0 0;
}

.scan-frame::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 12px 0;
}

@keyframes scanPulse {
  0%, 100% { border-color: rgba(8, 121, 246, 0.3); }
  50% { border-color: rgba(8, 121, 246, 0.6); }
}

.ar-scan-hint p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Bottom Hotspot Bar */
.ar-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 16px max(env(safe-area-inset-bottom, 16px), 16px);
  display: flex;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(to top, rgba(6, 6, 14, 0.8), transparent);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hotspot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s;
}

.hotspot-btn:active {
  transform: scale(0.94);
}

.hotspot-btn i {
  font-size: 1.25rem;
}

.hotspot-btn.whatsapp i { color: #25d366; }
.hotspot-btn.contact-card i { color: var(--volt); }
.hotspot-btn.snap-link i { color: var(--flame); }

.hotspot-btn.whatsapp:active { border-color: rgba(37, 211, 102, 0.4); }
.hotspot-btn.contact-card:active { border-color: rgba(8, 121, 246, 0.4); }
.hotspot-btn.snap-link:active { border-color: var(--flame-glow); }
