/* --------------------------------------------------------
   Global reset and typography
   -------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Gotham Light", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body,
#viewer {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------
   Viewer container
   -------------------------------------------------------- */
#viewer {
  position: fixed;
  inset: 0;
  background: #0b0b0b;
  overflow: hidden;
}

/* --------------------------------------------------------
   Launch overlay
   -------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.84));
  z-index: 60;
}

.launch-card {
  width: 360px;
  padding: 28px;
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.title {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 300;
}

.subtitle {
  margin-bottom: 18px;
  color: #cfcfcf;
}

/* --------------------------------------------------------
   Loading overlay
   -------------------------------------------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 70;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: #ffffff;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: #ffffff;
  font-weight: 500;
}

/* --------------------------------------------------------
   Button system (shared styles)
   -------------------------------------------------------- */
/* Base visual for all interactive buttons */
.btn,
.mode-btn,
.floating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  background: #ffffff;
  color: #000000;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

/* Hover feedback */
.btn:hover,
.mode-btn:hover,
.floating-btn:hover {
  background: #d6d6d6;
  transform: translateY(-6px);
}

/* --------------------------------------------------------
   Active / selected state
   -------------------------------------------------------- */
/* Uses an outer ring so the outline is clearly visible
   against dark backgrounds without affecting layout. */
.btn.is-active,
.mode-btn.is-active,
.floating-btn.is-active,
#modeActionBtn.is-rotating {
  background: #ffffff;
  box-shadow:
    0 0 0 2px #000000,   /* gap to background */
    0 0 0 4px #ffffff;  /* outer white outline */
}

/* Primary launch button on the overlay */
.btn.primary {
  padding: 12px 26px;
  border-radius: 18px;
  font-weight: 500;
}

.btn.primary:hover {
  transform: translateY(-2px);
  filter: brightness(0.94);
}

/* Ensure JS inline styles do not override the consistent scheme */
.mode-btn,
#modeActionBtn {
  background: #ffffff !important;
  color: #000000 !important;
}

/* --------------------------------------------------------
   Bottom bar and mode switcher
   -------------------------------------------------------- */
/* The bottom bar is treated as a single scalable unit; JS applies uniform scale. */
.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) scale(1);
  transform-origin: center bottom;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
  will-change: transform;
}

.modes-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mode buttons: keep label on one line and maintain proportions */
.mode-btn {
  min-width: 100px;
  padding: 10px 14px;
  white-space: nowrap;
}

/* Visual separator between info panel and mode controls */
.separator {
  width: 1px;
  height: 36px;
  margin: 0 12px;
  align-self: center;
  background: rgba(255, 255, 255, 0.15);
}

/* --------------------------------------------------------
   Info panel
   -------------------------------------------------------- */
.info-panel {
  margin-right: 10px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.info-text {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.95;
}

/* --------------------------------------------------------
   Close button
   -------------------------------------------------------- */
.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
  z-index: 55;
}

.close-btn {
  position: fixed;
  top: 18px;
  right: 18px;
}

.circle-btn:hover {
  transform: translateY(-2px);
  filter: brightness(0.92);
}

/* --------------------------------------------------------
   Floating 3D view buttons
   -------------------------------------------------------- */
#floatingButtons {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 52;
}

/* Circular view buttons projected over the scene */
.floating-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  font-weight: 500;
}

.floating-btn:hover {
  transform: translate(-50%, -50%) scale(1.02);
}

/* --------------------------------------------------------
   Visibility helpers
   -------------------------------------------------------- */
.hidden {
  display: none !important;
}

/* --------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------- */
/* These values keep text legible on small screens; JS scaling handles overflow. */
@media (max-width: 720px) {
  .mode-btn {
    min-width: 72px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .floating-btn {
    width: 60px;
    height: 60px;
    font-size: 12px;
  }

  .info-panel {
    font-size: 11px;
  }
}
