/* ==========================================================================
   GeoScout AI — map + chrome styling that lives outside Tailwind's utility
   scope (Leaflet internals, generated markers, keyframes).
   Loaded after tailwind.css.
   ========================================================================== */

/* --- Leaflet reskin ------------------------------------------------------ */
.leaflet-container {
  background: #071a2b;
  font-family: inherit;
  outline: none;
}

.leaflet-container a {
  color: #9fd3f2;
}

.leaflet-control-container .leaflet-control-attribution {
  background: rgba(6, 18, 28, 0.72);
  color: #7d92a6;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px 0 0 0;
  backdrop-filter: blur(2px);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaflet-control-attribution a {
  color: #8fb6d4;
}

.leaflet-tile-pane {
  filter: saturate(1.04) contrast(1.02);
}

/* Risk raster: keep the mosaic crisp the way the reference renders it. */
.gs-risk-overlay {
  image-rendering: pixelated;
  mix-blend-mode: normal;
}

/* Native date pickers render a locale format we do not want on screen; the
   real control sits transparently over an ISO label. */
.date-proxy::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

/* --- Map labels ---------------------------------------------------------- */
.gs-label {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.gs-label--city {
  font-size: 14px;
}

.gs-label--city::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
}

.gs-label--town {
  font-size: 11.5px;
  font-weight: 500;
  color: #e6eef6;
}

.gs-label--town::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #e8eef4;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.55);
}

.gs-label--country {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #f1f5f9;
}

.gs-label--sea {
  font-size: 19px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #7fc4ea;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* On a phone-sized map the sea and country labels collide with the scale bar
   and the overlay cards, so they step aside. */
.gs-compact .gs-label--sea,
.gs-compact .gs-label--country {
  display: none;
}

/* --- Location pin -------------------------------------------------------- */
.gs-pin {
  position: relative;
  width: 30px;
  height: 40px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.gs-pin:hover {
  transform: translateY(-2px) scale(1.04);
}

.gs-pin--sm {
  width: 22px;
  height: 30px;
}

.gs-pin-halo {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.45);
  animation: gs-ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes gs-ping {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* --- Reference style popup ----------------------------------------------- */
.gs-popup .leaflet-popup-content-wrapper {
  background: rgba(10, 13, 18, 0.95);
  color: #e9eff5;
  border-radius: 16px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.85);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gs-popup .leaflet-popup-content {
  margin: 0;
  padding: 15px 20px 16px;
  width: auto !important;
  min-width: 168px;
  line-height: 1.45;
}

.gs-popup .leaflet-popup-tip-container {
  width: 22px;
  height: 22px;
  left: -11px;
  top: 50%;
  margin: -11px 0 0 0;
  transform: none;
  overflow: visible;
}

.gs-popup .leaflet-popup-tip {
  width: 16px;
  height: 16px;
  margin: 3px 0 0 3px;
  background: rgba(10, 13, 18, 0.95);
  box-shadow: none;
  border: 0;
  transform: rotate(45deg);
}

.gs-popup .leaflet-popup-close-button {
  display: none;
}

/* Fullscreen map: drop the card treatment so it is edge to edge. */
#map-panel:fullscreen {
  border-radius: 0;
  border: 0;
}

/* --- Panels / drawers ---------------------------------------------------- */
.drawer {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in {
  animation: gs-fade 0.22s ease-out both;
}

@keyframes gs-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Charts redraw on resize; stop the flash of a stretched SVG. */
.chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Native select reset — the chevron is supplied by markup. */
.select-reset {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}

.select-reset option {
  background: #0c1e2d;
  color: #e9eff5;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
