* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0f1115;
  color: #e7e9ee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#album { position: fixed; inset: 0; }
#album-map { position: absolute; inset: 0; }
.hidden { display: none !important; }

/* Leaflet attribution/zoom kept legible on the dark map */
.leaflet-container { background: #0f1115; }
.album-marker-pulse { animation: markerPulse 1.2s ease-out 2; }
@keyframes markerPulse {
  0%   { stroke-width: 2; }
  50%  { stroke-width: 10; }
  100% { stroke-width: 2; }
}

#timeline {
  position: absolute; left: 0; right: 0; bottom: 0; height: 96px;
  background: linear-gradient(to top, rgba(15,17,21,0.96), rgba(15,17,21,0.6));
  border-top: 1px solid #2a2f3a; z-index: 1000;
}
#timeline-track { position: relative; height: 100%; margin: 0 32px; }
.tl-axis {
  position: absolute; left: 0; right: 0; top: 56px; height: 2px; background: #2a2f3a;
}
.tl-tick {
  position: absolute; top: 62px; transform: translateX(-50%);
  font-size: 11px; color: #7b8394;
}
.tl-tick::before {
  content: ""; position: absolute; left: 50%; top: -8px; width: 1px; height: 6px;
  background: #3a4150;
}
.tl-dot {
  position: absolute; top: 57px; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #aeb6c7; border: 2px solid #0f1115; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.tl-dot:hover { transform: translate(-50%, -50%) scale(1.25); background: #fff; }
.tl-dot.active { background: #5b8cff; transform: translate(-50%, -50%) scale(1.3); }
.tl-thumb {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: none; width: 96px; padding: 4px;
  background: #1a1e27; border: 1px solid #2a2f3a; border-radius: 8px;
  text-align: center; pointer-events: none; white-space: nowrap;
}
.tl-dot:hover .tl-thumb, .tl-dot.active .tl-thumb { display: block; }
.tl-thumb img, .tl-thumb .tl-ph {
  width: 88px; height: 56px; object-fit: cover; border-radius: 4px; display: block;
}
.tl-thumb .tl-ph { display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #0f1115; }
.tl-thumb .tl-date { font-size: 10px; color: #c7cdd9; margin-top: 3px; }

#preview-card {
  position: absolute; z-index: 1200; width: 200px;
  background: #1a1e27; border: 1px solid #2a2f3a; border-radius: 10px;
  overflow: hidden; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  transform: translate(-50%, calc(-100% - 16px)); /* anchored above the marker point */
}
#preview-card .pc-media, #preview-card .pc-ph {
  width: 100%; height: 120px; object-fit: cover; display: block;
}
#preview-card .pc-ph { display: flex; align-items: center; justify-content: center; color: #0f1115; }
#preview-card .pc-body { padding: 8px 10px; }
#preview-card .pc-loc { font-size: 13px; font-weight: 600; }
#preview-card .pc-date { font-size: 11px; color: #9aa2b1; margin-top: 2px; }
#preview-card .pc-hint { font-size: 11px; color: #5b8cff; margin-top: 6px; }

#viewer {
  position: absolute; inset: 0; z-index: 2000; background: #000;
  display: flex; flex-direction: column;
}
#viewer-media { position: relative; flex: 1; min-height: 0; background: #000; }
#viewer-media .v-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
#viewer-media .v-ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #0f1115; font-size: 22px;
}
#viewer-media #pano-container { width: 100%; height: 100%; }
#viewer-desc {
  padding: 14px 20px; background: #14171e; border-top: 1px solid #2a2f3a;
}
#viewer-desc .v-loc { font-size: 18px; font-weight: 700; }
#viewer-desc .v-date { font-size: 13px; color: #9aa2b1; margin: 2px 0 8px; }
#viewer-desc .v-cap { font-size: 14px; color: #d4d8e0; line-height: 1.45; }
#viewer-close {
  position: absolute; top: 14px; right: 18px; z-index: 2100;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(20,23,30,0.8); color: #fff; font-size: 24px; cursor: pointer;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2100;
  width: 48px; height: 64px; border: none; cursor: pointer;
  background: rgba(20,23,30,0.6); color: #fff; font-size: 32px;
}
#viewer-prev { left: 12px; border-radius: 0 8px 8px 0; }
#viewer-next { right: 12px; border-radius: 8px 0 0 8px; }
.viewer-nav:disabled { opacity: 0.3; cursor: default; }
