/* =============================================================================
   EarthMap flood info card — self-contained CSS copied from the map (feat/flood-embed @7164225).
   Values are taken from src/ui.css (#infoBox), src/floods.js (injectStyles),
   src/agency-fires.js (.np-close), and src/build-stamp.js (.ddb-build-stamp).

   Public imagery name is "Sat". Do not use GeoColor, Himawari, or Protomaps
   in any UI text.

   Class / id map
   --------------
   #infoBox                         Shared map info box shell (positioned card, not a bottom sheet).
   #infoBox.active                  Shown (display:block). floods.js also sets style.display = 'block'.
   #infoBox .em-flood-card          Root of the flood card body.
   #infoBox .em-flood-title         Event title (h3).
   #infoBox .em-flood-place         Place line (omitted when it matches the title).
   #infoBox .em-flood-country       Country line (omitted when the title/place already ends with it).
   #infoBox .em-flood-chips         Wrapper for likelihood chips.
   #infoBox .em-flood-chip          Likelihood chip base.
   #infoBox .em-flood-chip--likely  likelihood = likely. Background #ffb703.
   #infoBox .em-flood-chip--highly  likelihood = highly_likely, or hasHighlyLikely.
   #infoBox .em-flood-chip--significant  eventType = significant_event.
   #infoBox .em-flood-seen          First-seen row (local time) + optional New badge.
   #infoBox .em-flood-seen-label    "First seen" label (opacity .7).
   #infoBox .em-flood-new-badge     "New" badge when is_new_24h is true (rendered as NEW via text-transform).
   #infoBox .em-flood-link          Generic text link (unused by the primary button).
   #infoBox .em-flood-link-primary  Primary "View flood page" button (same tab). Hover uses teal.
   #infoBox .em-flood-note          Attribution + disclaimer line.
   #infoBox .ddb-build-stamp        Shared info-box footer ("EarthMap v… · build …"), not flood-specific.
   .np-close-rail / .np-close       Shared info-box close control (sticky rail, ×).
   ============================================================================= */

/* --- Shared #infoBox shell (src/ui.css) --- */
#infoBox {
  position: fixed;
  top: 80px;
  right: 80px;
  width: 300px;
  max-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background-color: rgba(43, 43, 43, 0.9);
  color: #FFFFFF;
  padding: 10px;
  border-radius: 8px;
  z-index: 1000;
  display: none;
  font-family: 'Lexend', sans-serif;
}

#infoBox.active {
  display: block;
}

#infoBox h2,
#infoBox h3 {
  margin-top: 0;
  font-size: 14px;
  margin-bottom: 8px;
  padding-right: 26px; /* room for .np-close (src/agency-fires.js) */
}

#infoBox p {
  font-size: 10px;
  line-height: 1.2;
  margin-bottom: 4px;
}

#infoBox a {
  color: #FF6347;
  text-decoration: none;
  font-size: 10px;
}

#infoBox a:hover {
  text-decoration: underline;
}

#infoBox::-webkit-scrollbar { width: 6px; }
#infoBox::-webkit-scrollbar-track { background: #2b2b2b; border-radius: 4px; }
#infoBox::-webkit-scrollbar-thumb { background-color: #555; border-radius: 4px; }

#infoBox .ddb-build-stamp {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 9px;
  line-height: 1.3;
  color: #888888;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 400;
}

/* Shared close control (src/agency-fires.js injectStyles) */
.np-close-rail { position: sticky; top: 0; height: 0; z-index: 6; }
.np-close {
  position: absolute;
  right: -2px;
  top: -4px;
  background: rgba(43, 43, 43, 0.94);
  border: 0;
  color: #C9C9C9;
  font-size: 18px;
  line-height: 1;
  padding: 3px 7px;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
}
.np-close:hover { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
.np-close:focus-visible { outline: 2px solid #FF6347; outline-offset: 1px; }

/* --- Flood card (src/floods.js injectStyles). These override generic #infoBox p/a/h3 sizes. --- */
#infoBox .em-flood-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#infoBox .em-flood-title {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.25;
  color: #fff;
}

#infoBox .em-flood-place,
#infoBox .em-flood-country {
  margin: 0;
  font-size: 12px;
  color: #d0d6de;
}

#infoBox .em-flood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0;
}

#infoBox .em-flood-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

#infoBox .em-flood-chip--likely { background: #ffb703; color: #1a1400; }
#infoBox .em-flood-chip--highly { background: #e63946; color: #fff; }
#infoBox .em-flood-chip--significant { background: #c44; color: #fff; }

#infoBox .em-flood-seen {
  margin: 2px 0 0;
  font-size: 12px;
  color: #e8edf2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

#infoBox .em-flood-seen-label { opacity: .7; margin-right: 2px; }

#infoBox .em-flood-new-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #2f7bc6; /* --sky / COLOR_NEW */
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#infoBox .em-flood-link { display: inline-block; margin-top: 6px; }

#infoBox .em-flood-link-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 4px;
  padding: 8px 12px;
  background: #2f7bc6; /* --sky */
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
  font-size: inherit;
}

#infoBox .em-flood-link-primary:hover {
  background: #35bcb8; /* --teal */
  color: #0a1628 !important; /* --navy-deep */
  text-decoration: none;
}

#infoBox .em-flood-note {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: .85;
  color: #c5ced8;
}

/* Legend pulse (same 1.6s duration as the map canvas pulse). Optional. */
@keyframes em-flood-pulse {
  0% { transform: scale(.55); opacity: .9; }
  100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .legend-flood-pulse::before { animation: none; opacity: 0; }
}

/* Toast / #fl-banner (src/flood-banner.js). Optional; not part of the card. */
#fl-banner-slot {
  position: fixed;
  left: 10px;
  top: 58px;
  width: min(380px, calc(100vw - 24px));
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
}
#fl-banner {
  pointer-events: none;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform .35s ease, opacity .25s ease;
  background: rgba(10, 22, 40, .94);
  border: 1px solid #2f7bc6;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  color: #e8eef6;
  font-family: Lexend, system-ui, sans-serif;
  padding: 10px 38px 10px 12px;
  cursor: pointer;
  position: relative;
}
#fl-banner.is-open {
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
}
#fl-banner .fl-banner-kicker {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0;
}
#fl-banner .fl-banner-sub {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: #7eb6e8; /* --sky-soft */
  margin: 4px 0 0;
  opacity: .95;
}
#fl-banner .fl-banner-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7eb6e8;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}
#fl-banner .fl-banner-close:hover,
#fl-banner .fl-banner-close:focus {
  background: rgba(255, 115, 106, .18);
  color: #ff736a; /* --coral */
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  #fl-banner { transition: none; }
}
