body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    touch-action: none;
    background-color:black;
}

html, body, canvas {
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

#glcanvas {
    display: block;
    width: 100%;
    height: 100%;
}
  
#current-time-text {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: lightgray;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    z-index: 10;  /* Ensure text stays on top */
    pointer-events: auto;
}

#date-picker {
    position: fixed; 
    left: 20px;
    right: 20px;
    bottom: 20px; 
    width: 100vw; 
    opacity: 0; 
    z-index: 20; 
    cursor: pointer;
    pointer-events: auto;
}

#cameraButton {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;   /* no background so the SVG shape is visible */
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 10;
  pointer-events: auto;
}

.camera-white {
  color: white;     /* makes SVG white */
}

#loading-text {
    position: absolute;
    top: 20px;
    left: 20px;
    color: darkorange;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    text-align: left;
    z-index: 10;  /* Ensure text stays on top */
}

#btLogo {
    position: fixed;
    bottom: 10px;
    left: 10px;
    width: 10vmin;
    height: auto;
    z-index: 10;
    opacity: 0.3;
    transition: opacity 0.2s;
    pointer-events: auto;
}

#btLogo:hover {
    opacity: 1;
}

#nasaLogo {
    position: fixed;
    bottom: 10px;
    left: 10px;
    width: 10vmin;
    height: auto;
    z-index: 10;
    opacity: 0.3;
    transition: opacity 0.2s;
}

#nasaLogo:hover {
    opacity: 1;
}

.share-button {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 5vmin;
    height: auto;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

.share-button:hover {
  opacity: 1;
}

.share-button img {
    width: 32px;
    height: 32px;
}

#topUI {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 10vmin;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    z-index: 10; /* Ensure it’s on top */
}

#topUI.hidden {
    opacity: 0;
}

/* Modal styling */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #111; /* dark background */
  color: #fff;
  padding: 20px;
  width: 50%;
  max-width: 600px;
  height: 50%;
  max-height: 600px;
  border-radius: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.modal-content img {
  max-width: 100%;
  max-height: 60%;
  margin-bottom: 10px;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}
.close:hover {
  color: #bbb;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none; /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* Circle spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #fff;
  border-top: 6px solid #444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.save-btn {
  margin-top: 12px;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 20px;
  border: none;
  background: #1e88e5;
  color: white;
  cursor: pointer;
}

.save-btn:active {
  transform: scale(0.97);
}

.progress {
  width: 80%;
  max-width: 360px;
  margin: 16px auto;
  text-align: center;
}

.progress .bar {
  height: 6px;
  width: 0%;
  background: #4ea1ff;
  border-radius: 3px;
  transition: width 0.15s ease;
}

.progress .label {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
}

.hidden {
  display: none;
}

.profile-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.profile-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

#uiLayer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overscroll-behavior: auto;
}

#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 12px;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 60px;
  overflow-y: auto;
  align-items: start;
  touch-action: pan-y;
}

.card {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}

.card:hover .actions {
  opacity: 1;
}

.thumb {
  position: relative;
  width: 100%;
  height: 100%;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 🔑 overlay */
.actions {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s;
}

.actions button {
  flex: 1;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.actions button.danger {
  background: rgba(160, 50, 50, 0.8);
}