#lazy-load-poster {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-image: url("assets/poster-damagedhelmet.webp");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#button-load {
  background-image: url("assets/ic_get_app_white_24dp.svg");
  background-repeat: no-repeat;
  background-size: 24px 24px;
  background-position: 6% 50%;
  background-color: #000;
  color: white;
  cursor: pointer;
  border-radius: 6px;
  display: inline-block;
  padding: 10px 18px 9px 40px;
  font-weight: 500;
  box-shadow: 0 0 8px rgba(0, 0, 0, .2), 0 0 4px rgba(0, 0, 0, .25);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  z-index: 100;
}

#logo {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 70px;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Clean minimalist dark gradient background */
  background: radial-gradient(circle at center, #2a2a2d 0%, #0d0d0e 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

html {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Info Toggle Button */
.info-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  transition: all 0.2s ease;
  color: #ffffff;
}

.info-toggle svg {
  transition: transform 0.2s ease;
}

.info-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.info-toggle:active {
  transform: scale(0.95);
}

.info-toggle:focus {
  outline: none;
}

.info-toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Info Panel */
.info-panel {
  position: absolute;
  top: 80px;
  right: 20px;
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  max-width: 320px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.info-panel.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  visibility: hidden;
}

.info-panel h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  color: #ffffff;
  font-weight: 600;
  padding-right: 30px;
}

.info-panel > p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #a0a0a5;
  line-height: 1.5;
}

.info-details {
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  font-size: 13px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 8px;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  font-weight: 500;
  color: #808085;
  min-width: 90px;
  flex-shrink: 0;
}

.info-row span:last-child {
  color: #e0e0e0;
  line-height: 1.4;
}

.fun-fact {
  margin: 24px 0 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.fun-fact-label {
  font-weight: 600;
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.fun-fact #satellite-fact, 
#satellite-fact {
  font-size: 13px;
  color: #b0b0b5;
  line-height: 1.5;
}

.learn-more {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 16px;
  background: #ffffff;
  color: #000000;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.learn-more:hover {
  background: #e0e0e0;
}

/* Close button in panel */
.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0a0a5;
  transition: all 0.2s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.close-button:focus {
  outline: none;
}

/* Loading Indicator */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 150;
  background: rgba(20, 20, 22, 0.9);
  padding: 32px 40px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 260px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.loading-indicator p {
  margin: 20px 0 8px 0;
  font-size: 15px;
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.loading-details {
  font-size: 12px;
  color: #a0a0a5;
  margin: 4px 0;
  text-align: center;
}

.loading-file {
  font-size: 11px;
  color: #606065;
  margin: 4px 0;
  font-family: monospace;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 20px;
}

.progress-bar {
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Error Modal */
.error-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity 0.3s ease;
}

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

.error-content {
  background: #1c1c1e;
  border-radius: 16px;
  padding: 32px;
  max-width: 360px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s ease;
}

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

.error-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.error-content h3 {
  margin: 0 0 8px 0;
  color: #ff453a;
  font-size: 18px;
  font-weight: 600;
}

.error-content p {
  margin: 0 0 24px 0;
  color: #a0a0a5;
  font-size: 14px;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
}

.btn-primary:hover {
  background: #e0e0e0;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* This keeps child nodes hidden while the element loads */
:not(:defined) > * {
  display: none;
}

model-viewer {
  width: 100%;
  height: 100%;
  background-color: transparent;
  overflow-x: hidden;
  --poster-color: transparent;
  --ar-distance: 5m;
}

/* AR mode - ensure model appears at correct distance and rotates */
model-viewer[ar-status="session-started"] {
  --ar-distance: 5m;
}

model-viewer[ar-status="object-placed"] {
  animation: arRotate 24s linear infinite;
}

@keyframes arRotate {
  from { --model-rotation: 0deg; }
  to { --model-rotation: 360deg; }
}

#ar-button {
  background-image: url(assets/ic_view_in_ar_new_googblue_48dp.png);
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: 12px 50%;
  background-color: rgba(20, 20, 22, 0.85);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  padding: 0px 20px 0px 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  height: 44px;
  line-height: 44px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ar-button-icon {
  display: none;
}

#ar-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

#ar-button:active {
  transform: translateX(-50%) scale(0.98);
}

#ar-button:focus {
  outline: none;
}

/* AR Instructions */
.ar-instructions {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  transition: opacity 0.3s ease;
}

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

.ar-instructions-content {
  background: #1c1c1e;
  border-radius: 16px;
  padding: 32px;
  max-width: 320px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s ease;
}

.ar-instructions-content h3 {
  margin: 0 0 24px 0;
  color: #ffffff;
  font-size: 18px;
  text-align: center;
  font-weight: 600;
}

.ar-instructions-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.ar-instructions-content li {
  padding: 12px 0;
  font-size: 14px;
  color: #d0d0d5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ar-instructions-content li:last-child {
  border-bottom: none;
}

#ar-instructions-close {
  width: 100%;
}

@keyframes elongate {
  from { transform: translateX(100px); }
  to   { transform: translateX(-100px); }
}

model-viewer > #ar-prompt {
  position: absolute;
  left: 50%;
  bottom: calc(175px + env(safe-area-inset-bottom, 0px));
  animation: elongate 2s infinite ease-in-out alternate;
  display: none;
}

model-viewer[ar-status="session-started"] > #ar-prompt {
  display: block;
}

model-viewer > #ar-failure {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(175px + env(safe-area-inset-bottom, 0px));
  display: none;
  background: rgba(255, 69, 58, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

model-viewer[ar-tracking="not-tracking"] > #ar-failure {
  display: block;
}

.slider {
  width: 100%;
  text-align: center;
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  pointer-events: none;
}

.slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 10px 24px;
  gap: 16px;
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
  box-sizing: border-box;
  pointer-events: auto;
}

.slides::-webkit-scrollbar {
  display: none;
}

.slide {
  scroll-snap-align: center;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  padding: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #1a1a1c;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.slide::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease;
}

.slide:hover::after {
  background: rgba(0, 0, 0, 0.2);
}

.slide.selected {
  border: 2px solid #ffffff;
  transform: translateY(-4px);
}

.slide.selected::after {
  background: transparent;
}

.slide-label {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: white;
  font-size: 10px;
  line-height: 1.2;
  padding: 6px 4px;
  width: 100%;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.2px;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

/* Tour Mode */
.take-tour-btn {
  position: fixed;
  top: 80px;
  left: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 150;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.take-tour-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.take-tour-btn.hidden {
  display: none;
}

.tour-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 40vh;
  background: rgba(20, 20, 22, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 250;
  transition: transform 0.3s ease;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  overflow-y: auto;
}

.tour-container.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.tour-content {
  max-width: 600px;
  margin: 0 auto;
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tour-progress {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.tour-close-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  color: #a0a0a5;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.tour-content h3 {
  margin: 0 0 8px 0;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
}

.tour-content p {
  margin: 0 0 24px 0;
  color: #a0a0a5;
  font-size: 14px;
  line-height: 1.5;
}

.tour-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tour-actions button {
  flex: 1;
}

.tour-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #logo {
    width: 60px;
    top: 16px;
    left: 16px;
  }
  
  .info-toggle {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .info-panel {
    top: 64px;
    right: 16px;
    left: 16px;
    max-width: none;
    padding: 20px;
  }
  
  .info-panel h2 { font-size: 18px; }
  .info-panel p { font-size: 13px; }
  
  .slide {
    width: 70px;
    height: 70px;
  }
  
  .slide-label {
    font-size: 9px;
    padding: 4px;
  }
  
  .take-tour-btn {
    top: 72px;
    left: 16px;
    font-size: 12px;
    padding: 8px 14px;
  }
  
  .tour-container {
    padding: 20px;
  }
  
  .tour-content h3 { font-size: 18px; }
  .tour-content p { font-size: 13px; }
}

