/**
 * templates/style.css
 * Version: 1.1 - 2026-05-03
 * Added permanent centered marker tooltips ("Captured on" + time + compact date)
 * + subtle pulse on first marker
 */

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  background: #e8eaed; /* Google Maps background colour */
}

/* ── Top bar ─────────────────────────────────────────────────── */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  padding: 0 16px;
}

#topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  color: #5f6368;
  user-select: none;
}

/* ── Map ─────────────────────────────────────────────────────── */
#map {
  position: fixed !important;
  top: 56px; /* below topbar */
  left: 8px; right: 8px; bottom: 8px;
  border: 2px solid #000;
  border-radius: 4px;
}

/* ── Panorama modal ──────────────────────────────────────────── */
#pano-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  transition: opacity .2s ease;
}

#pano-modal.hidden {
  display: none;
}

#pano-modal-inner {
  width: min(96vw, 1100px);
  height: min(90vh, 680px);
  background: #202124;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

#pano-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #303134;
  color: #e8eaed;
  font-size: 15px;
  font-weight: 500;
  flex-shrink: 0;
}

#pano-close {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
#pano-close:hover { background: #5f6368; color: #fff; }

#pano-viewer {
  flex: 1;
  width: 100%;
}

/* ── Custom map marker tooltip ───────────────────────────────── */
.gm-style .pano-label {
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 500;
  color: #202124;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  white-space: nowrap;
}

/* ── Responsive: tighten modal on small screens ──────────────── */
@media (max-width: 600px) {
  #pano-modal-inner {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

/* ====================== COMPACT MARKER TOOLTIPS (v1.3) ====================== */
.marker-label-wrapper {
    position: relative;
    display: inline-block;
    text-align: center;
}

.marker-label {
    position: absolute;
    top: -65px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid #64748b !important;
    color: #f1f5f9 !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 2px !important;
    line-height: 1 !important;
    padding: 4px 4px !important;
    border-radius: 4px !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4) !important;
    white-space: pre-line !important;
    pointer-events: none !important;
    z-index: 1000 !important;
    min-width: 80px;
}

.marker-label .captured-label {
    display: block;
    font-size: 8px;
    opacity: 0.85;
    margin-bottom: 1px;
}

.marker-label .datetime {
    display: block;
    font-weight: 500;
    font-size: 11px;
}

/* Gentle pulse for first marker */
.marker-pulse {
    animation: markerPulse 2.8s infinite ease-in-out;
}

@keyframes markerPulse {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 4px #10b981); }
    50%      { filter: brightness(1.35) drop-shadow(0 0 9px #10b981); }
}
