@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --blue:       #0088cc;
  --blue-glow:  rgba(0, 136, 204, 0.35);
  --blue-dim:   rgba(0, 136, 204, 0.15);
  --blue-dark:  #006699;
  --bg:         #0d1117;
  --surface:    rgba(13, 17, 23, 0.72);
  --surface-solid: #111820;
  --border:     rgba(0, 136, 204, 0.18);
  --text:       #e6edf3;
  --muted:      rgba(230, 237, 243, 0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root { color-scheme: dark; }

html {
  height: 100%;
  background: var(--bg);
}

body {
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.data-credits {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.data-credit-sep {
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0.4;
}

#map {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(-1 * env(safe-area-inset-top));
  width: 100%;
  height: calc(100% + env(safe-area-inset-top));
  z-index: 0;
  background: #0d1117;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 2rem);
  max-width: 640px;
  margin-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.4rem 1rem;
  box-shadow: 0 0 0 1px rgba(0,136,204,0.08), 0 8px 32px rgba(0,0,0,0.55), 0 0 60px rgba(0,136,204,0.06);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 1.5rem; right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.6;
  border-radius: 1px;
}

.footer-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.footer h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.live-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  position: relative;
  top: -1px;
}

.live-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 4px;
  vertical-align: middle;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.footer h2 {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}


.drawer-description a {
  color: var(--blue); 
  text-decoration: none;
}

.drawer-description a:hover { 
text-decoration: underline;}

.drawer-description {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
  border-top: 1px solid rgba(0,136,204,0.1);
  padding-top: 0.75rem;
}

/* drawer-actions merged into footer-bottom-row */

.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 500;
  background: #FFDD00;
  color: #000;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  transition: opacity 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.bmc-btn:hover {
  opacity: 0.88;
  box-shadow: 0 0 14px rgba(255, 221, 0, 0.35);
}

.drawer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid rgba(0,136,204,0.3);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.drawer-link:hover {
  background: var(--blue-dim);
  box-shadow: 0 0 12px var(--blue-glow);
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.hint-text {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
  margin-bottom: 0.75rem;
}

.hint-text i {
  color: var(--blue);
  font-size: 0.75rem;
  margin-right: 0.4rem;
}

#github-copyright {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 300;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

#github-copyright a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s ease;
}

#github-copyright a:hover { color: var(--text); }

/* ── Camera markers ───────────────────────────────────────────────────────── */
.camera-marker { position: relative; width: 12px; height: 12px; }

.camera-marker-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 6px var(--blue-glow);
}

.camera-marker-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 136, 204, 0.5);
  animation: ring-pulse 2.5s ease-out infinite;
}

@keyframes ring-pulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2);   opacity: 0; }
}

/* ── Camera modal ─────────────────────────────────────────────────────────── */
.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.camera-modal.hidden { display: none; }
.camera-modal.visible { opacity: 1; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 136, 204, 0.1),
    0 24px 64px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(0, 136, 204, 0.08);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.camera-modal.visible .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem; right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0.7;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  z-index: 2;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.modal-location {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  padding: 1rem 1.2rem 0.65rem;
  padding-right: 2.5rem;
}

.modal-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #090d12;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-img.hidden { display: none; }

.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.modal-loading.hidden { display: none; }

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(0, 136, 204, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.modal-error i { color: #e05252; font-size: 1.2rem; }
.modal-error.hidden { display: none; }

.modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.2rem 0.85rem;
  border-top: 1px solid rgba(0,136,204,0.1);
  flex-wrap: wrap;
}

.modal-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
  border: 1px solid rgba(0,136,204,0.3);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.modal-map-btn:hover {
  background: var(--blue-dim);
  box-shadow: 0 0 12px var(--blue-glow);
}

.modal-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.modal-timestamp {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 300;
  white-space: nowrap;
}

.modal-temperature {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.modal-temperature.hidden { display: none; }

.data-credit {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 300;
  opacity: 0.5;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.data-credit:hover {
  color: var(--text);
  opacity: 1;
}

/* ── Leaflet overrides ────────────────────────────────────────────────────── */
.leaflet-tooltip {
  background: rgba(13, 17, 23, 0.92) !important;
  border: 1px solid rgba(0, 136, 204, 0.18) !important;
  border-radius: 6px !important;
  color: #e6edf3 !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  padding: 5px 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 12px rgba(0,136,204,0.15) !important;
  white-space: nowrap !important;
  backdrop-filter: blur(8px) !important;
}

.leaflet-tooltip::before { border-top-color: rgba(0, 136, 204, 0.18) !important; }

.leaflet-popup-content-wrapper {
  background: rgba(13, 17, 23, 0.95) !important;
  border: 1px solid rgba(0, 136, 204, 0.18) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(0,136,204,0.15) !important;
  backdrop-filter: blur(12px) !important;
  color: #e6edf3 !important;
  font-family: 'DM Sans', sans-serif !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 10px 14px !important;
  color: #e6edf3 !important;
  font-size: 0.8rem !important;
}

.leaflet-popup-tip { background: rgba(13, 17, 23, 0.95) !important; }

.leaflet-popup-close-button {
  color: rgba(230,237,243,0.5) !important;
  top: 4px !important;
  right: 6px !important;
}

.leaflet-popup-close-button:hover { color: #e6edf3 !important; }

.leaflet-control-attribution {
  background: rgba(13, 17, 23, 0.7) !important;
  color: rgba(230, 237, 243, 0.35) !important;
  font-size: 0.62rem !important;
  backdrop-filter: blur(4px) !important;
  border-radius: 4px 0 0 0 !important;
}

.leaflet-control-attribution a { color: rgba(0, 136, 204, 0.5) !important; }

.leaflet-control-zoom a {
  background: rgba(13, 17, 23, 0.85) !important;
  color: #e6edf3 !important;
  border-color: rgba(0, 136, 204, 0.18) !important;
  backdrop-filter: blur(8px) !important;
  transition: background 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(0, 136, 204, 0.15) !important;
  color: #0088cc !important;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .footer {
    width: calc(100% - 1.5rem);
    max-width: 100%;
    margin-bottom: 0.6rem;
    border-radius: 12px;
  }

  .footer-collapsed {
    padding: 0.9rem 1.1rem 0.85rem;
  }

  .footer h1 { font-size: 1.15rem; }
  .footer h2 { font-size: 0.75rem; }
  .hint-text { font-size: 0.73rem; }

  .footer-drawer {
    padding: 0 1.1rem;
  }

  .modal-card { border-radius: 12px; }
  .modal-location { font-size: 0.88rem; }
  .modal-meta { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .modal-meta-right { align-items: flex-start; }
  .modal-timestamp { font-size: 0.68rem; }
}

/* ── User location marker ─────────────────────────────────────────────────── */
.user-marker { position: relative; width: 16px; height: 16px; }

.user-marker-dot {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

.user-marker-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: ring-pulse 2.5s ease-out infinite;
}

/* ── SEO content block (crawlable, not visible to users) ─────────────────── */
.seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  pointer-events: none;
}