:root {
  --primary-color: rgba(0, 255, 255, 0.9);
  --primary-glow: rgba(0, 255, 255, 0.6);
  --animation-duration: 1.6s;
  --shadow-intensity: 0 0 8px;
  --arrow-count: 5;
  --arrow-spacing: 35px;
  --arrow-height: 32px;
  --arrow-width: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #000000 100%);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.container {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

/* PHOTO - Enhanced with performance optimizations */
.photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(135deg, #0a0a0a 0%, #000000 100%);
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

/* ARROW LAYER – Optimized positioning */
#arrow-layer {
  position: absolute;
  left: 50%;
  bottom: 15%; /* Raised from 10% to keep arrows on floor */
  transform: translateX(-50%) translateZ(0);
  pointer-events: none;
  z-index: 10;
  will-change: transform, opacity;
  max-height: 35vh; /* Limit total height of arrows */
  overflow: visible;
}

/* Arrow Container */
.arrow-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ARROW SHAPE - Shorter design */
.arrow {
  position: relative;
  width: 0;
  height: 0;
  
  border-left: var(--arrow-width) solid transparent;
  border-right: var(--arrow-width) solid transparent;
  border-bottom: var(--arrow-height) solid var(--primary-color);
  
  /* Enhanced glow effect */
  filter: 
    drop-shadow(var(--shadow-intensity) var(--primary-glow))
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
  
  /* Optimized animation */
  animation: 
    pulse var(--animation-duration) infinite ease-in-out,
    float 2.5s infinite ease-in-out;
  
  /* Performance optimizations */
  transform: translateZ(0);
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}

/* Arrow reflection/glow effect - smaller */
.arrow::before {
  content: '';
  position: absolute;
  top: 3px;
  left: calc(var(--arrow-width) * -0.9);
  width: calc(var(--arrow-width) * 1.8);
  height: calc(var(--arrow-height) * 0.8);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 100%
  );
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  pointer-events: none;
}

/* Arrow tail - shorter */
.arrow::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px; /* Reduced from 30px */
  background: linear-gradient(
    to bottom,
    var(--primary-color),
    transparent
  );
  border-radius: 1px;
  filter: blur(0.5px);
}

/* Direction label */
.direction-label {
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  animation: fadeInOut 3s infinite ease-in-out;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* Enhanced animations */
@keyframes pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: translateZ(0) scale(1);
  }
  50% { 
    opacity: 1;
    transform: translateZ(0) scale(1.03); /* Reduced from 1.05 */
  }
}

@keyframes float {
  0%, 100% { 
    transform: translateZ(0) translateY(0);
  }
  50% { 
    transform: translateZ(0) translateY(-5px); /* Reduced from -8px */
  }
}

@keyframes fadeInOut {
  0%, 100% { 
    opacity: 0.5;
    transform: translateX(-50%) translateY(0);
  }
  50% { 
    opacity: 0.9;
    transform: translateX(-50%) translateY(-1px);
  }
}

/* Floor boundary indicator */
.floor-boundary {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 10%,
    rgba(0, 255, 255, 0.3) 20%,
    rgba(0, 255, 255, 0.3) 80%,
    transparent 90%
  );
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

/* Navigation progress */
.navigation-progress {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 400px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  padding: 10px 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #00ffaa);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.step-counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

/* Navigation controls */
.navigation-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 100;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(0, 255, 255, 0.2);
  transform: scale(1.05);
}

.nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Error message styling */
.error-message {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translate(-50%, -40%); 
  }
  to { 
    opacity: 1; 
    transform: translate(-50%, -50%); 
  }
}

/* Loading state for photo */
.photo.loading {
  background: 
    linear-gradient(
      90deg,
      rgba(20, 20, 20, 0.8) 25%,
      rgba(40, 40, 40, 0.8) 50%,
      rgba(20, 20, 20, 0.8) 75%
    );
  background-size: 200% 100%;
  animation: loadingShimmer 2s infinite linear;
}

@keyframes loadingShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .arrow,
  .direction-label,
  .nav-btn {
    animation: none !important;
  }
  
  .arrow {
    opacity: 0.9;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .arrow {
    border-bottom-color: rgb(0, 255, 255);
    filter: drop-shadow(0 0 3px rgb(0, 255, 255));
  }
  
  .progress-fill {
    background: #00ffff;
  }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
  .arrow {
    border-bottom-color: rgba(0, 230, 230, 0.95);
  }
}

/* Mobile optimization */
@media (max-width: 768px) {
  :root {
    --arrow-spacing: 30px;
    --arrow-height: 28px;
    --arrow-width: 14px;
  }
  
  #arrow-layer {
    bottom: 18%;
    max-height: 30vh;
  }
  
  .arrow::before {
    display: none; /* Reduce compositor layers on mobile */
  }
  
  .arrow::after {
    height: 16px;
    filter: blur(0.3px);
  }
  
  .direction-label {
    font-size: 12px;
    padding: 3px 10px;
    bottom: -40px;
  }
  
  .floor-boundary {
    width: 150px;
    bottom: -20px;
  }
  
  .navigation-progress {
    top: 15px;
    padding: 8px 16px;
    width: 90%;
  }
  
  .navigation-controls {
    bottom: 25px;
  }
  
  .nav-btn {
    width: 44px;
    height: 44px;
  }
}

/* Small screens */
@media (max-width: 480px) {
  :root {
    --arrow-spacing: 25px;
    --arrow-height: 24px;
    --arrow-width: 12px;
  }
  
  #arrow-layer {
    bottom: 20%;
  }
  
  .arrow::after {
    height: 12px;
  }
  
  .direction-label {
    font-size: 11px;
    bottom: -35px;
  }
  
  .navigation-progress {
    top: 10px;
    padding: 6px 12px;
  }
  
  .step-counter {
    font-size: 12px;
  }
}
/* Add to existing style.css */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #00ffff;
  padding: 8px;
  z-index: 10000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.photo-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.step-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 20;
}

.tap-instruction {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: rgba(255, 255, 255, 0.9);
  padding: 12px 20px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 255, 0.2);
  animation: fadeInUp 0.5s ease;
  z-index: 20;
}

.instruction-icon {
  font-size: 20px;
}

.instruction-text {
  font-size: 14px;
  font-weight: 500;
}

.offline-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.offline-content {
  text-align: center;
  color: white;
  padding: 30px;
  max-width: 80%;
}

.offline-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.retry-button {
  background: #00ffff;
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  margin-top: 20px;
  cursor: pointer;
  transition: transform 0.2s;
}

.retry-button:hover {
  transform: scale(1.05);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Remove after first interaction */
.tap-instruction.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  /* Add this at the end of your existing style.css */

/* Debug mode - visible only during development */
.debug-info {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #00ff00;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  z-index: 10000;
  border: 1px solid #00ff00;
  max-width: 300px;
  display: none;
}

.debug-info.visible {
  display: block;
}

/* Better error states */
.photo.error {
  background: linear-gradient(45deg, #ff0000, #990000);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo.error::after {
  content: "⚠️ Image Error";
  color: white;
  font-size: 18px;
  font-weight: bold;
}
/* Add these styles to the END of your existing style.css file */

/* Direction label styling */
.direction-label {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    z-index: 11;
    animation: fadeInUp 0.5s ease;
}

/* Error message styling */
.error-message {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translate(-50%, -40%); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%); 
    }
}

/* Loading animation for arrows */
@keyframes arrowPulse {
    0%, 100% { 
        opacity: 0.6;
        transform: translateZ(0) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateZ(0) scale(1.05);
    }
}

.arrow {
    animation: 
        arrowPulse 1.5s infinite ease-in-out,
        float 2s infinite ease-in-out;
}

/* Progress bar enhancements */
.progress-fill {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .direction-label {
        font-size: 12px;
        padding: 5px 12px;
        bottom: -40px;
    }
}

@media (max-width: 480px) {
    .direction-label {
        font-size: 11px;
        padding: 4px 10px;
        bottom: -35px;
    }
}

/* Accessibility improvements */
.nav-btn:focus {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

.photo:focus {
    outline: 2px solid #00ffff;
    outline-offset: -2px;
}

/* Debug mode (remove in production) */
.debug-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 10000;
    border: 1px solid #00ff00;
    max-width: 300px;
    display: none;
}

.debug-panel.visible {
    display: block;
}
}