/* ===========================================================================
   Office satellite map — scoped styles.
   =========================================================================== */

.root {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background: #0b0b0b;
  isolation: isolate;
}

.map {
  width: 100%;
  height: 100%;
  background: #0b0b0b;
  font-family: var(--font-manrope), system-ui, -apple-system, sans-serif;
}

/* Visible keyboard focus ring on the map viewport */
.map:focus-visible {
  outline: 2px solid #c01227;
  outline-offset: -2px;
}

/* ---- Office navigation buttons (fly-to controls) ---- */
.controls {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  z-index: 600; /* above tiles + markers; popups open lower so they never collide */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  pointer-events: none; /* let the row be transparent to drags; buttons re-enable */
}

.controlBtn {
  pointer-events: auto;
  appearance: none;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 15, 17, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f5f5f5;
  font-family: var(--font-manrope), system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.controlBtn:hover {
  background: rgba(192, 18, 39, 0.9);
  border-color: #c01227;
  transform: translateY(-1px);
}

.controlBtn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.controlBtnActive,
.controlBtnActive:hover {
  background: #c01227;
  border-color: #c01227;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(192, 18, 39, 0.45);
}

/* Headquarters button — subtly elevated so it reads as the primary location. */
.controlBtnHq {
  border-color: rgba(192, 18, 39, 0.55);
  box-shadow: 0 0 0 1px rgba(192, 18, 39, 0.25), 0 4px 14px rgba(192, 18, 39, 0.2);
}

.controlBtnHq.controlBtnActive {
  box-shadow: 0 6px 20px rgba(192, 18, 39, 0.55);
}

@media (max-width: 480px) {
  .controls {
    top: 12px;
    gap: 5px;
    flex-wrap: nowrap;
  }
  .controlBtn {
    font-size: 11px;
    padding: 7px 9px;
  }
}

/* ---- Branded marker pin ---- */
.markerIcon {
  background: transparent;
  border: 0;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.markerIcon:hover,
.markerIcon:focus-visible {
  transform: translateY(-3px) scale(1.06);
}

/* ---- Headquarters pin — larger, glowing, pulsing, always on top ---- */
.markerIconHq {
  background: transparent;
  border: 0;
  filter: drop-shadow(0 0 9px rgba(192, 18, 39, 0.85))
    drop-shadow(0 5px 7px rgba(0, 0, 0, 0.55));
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.markerIconHq svg {
  position: relative;
  z-index: 2;
}

.markerIconHq:hover,
.markerIconHq:focus-visible {
  transform: translateY(-3px) scale(1.05);
}

/* Soft expanding ring radiating from the HQ pin head. */
.pinPulse {
  position: absolute;
  top: 19px;
  left: 20px;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: rgba(192, 18, 39, 0.5);
  z-index: 1;
  pointer-events: none;
  animation: hqPulse 2.2s ease-out infinite;
}

@keyframes hqPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.75;
  }
  70% {
    transform: scale(3);
    opacity: 0;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* ---- Leaflet Branded Elements ---- */
.root :global(.leaflet-container) {
  background: #0b0b0b;
}

.root :global(.leaflet-bar) {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.root :global(.leaflet-bar a) {
  background: rgba(15, 15, 17, 0.92);
  color: #f5f5f5;
  border-bottom-color: rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.root :global(.leaflet-bar a:hover) {
  background: #c01227;
  color: #ffffff;
}

.root :global(.leaflet-bar a:focus-visible) {
  outline: 2px solid #c01227;
  outline-offset: 2px;
}

.root :global(.leaflet-control-attribution) {
  background: rgba(10, 10, 10, 0.72);
  color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 11px;
  border-radius: 6px 0 0 0;
  padding: 2px 8px;
}

.root :global(.leaflet-control-attribution a) {
  color: rgba(255, 255, 255, 0.85);
}

/* ---- Floating Popup overlays ---- */
.root :global(.leaflet-popup) {
  animation: popupFade 0.2s ease-out forwards;
}

.root :global(.leaflet-popup-content-wrapper) {
  background: #0f0f11;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px; /* Clean business card rounded corners */
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  padding: 0;
  animation: popupScale 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: bottom center;
}

.root :global(.leaflet-popup-content) {
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
}

.root :global(.leaflet-popup-tip) {
  background: #0f0f11;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes popupFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popupScale {
  from { transform: scale(0.92); }
  to { transform: scale(1); }
}

/* Compact Details Card inside Popup */
.card {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  min-width: 230px;
  max-width: 280px;
  box-sizing: border-box;
  font-family: var(--font-manrope), system-ui, -apple-system, sans-serif;
  border-top: 2px solid #c01227; /* Thinner brand accent line */
  background: #0f0f11;
  height: auto;
}

.cardHeader {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.cardIcon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
}

.cardTitle {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #ffffff !important; /* Force white header text */
  margin: 0 !important;
  letter-spacing: -0.01em !important;
}

.cardBody {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.addressLine {
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.75) !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  font-weight: 500 !important;
}

.addressLine:last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 480px) {
  .card {
    padding: 9px 12px;
    min-width: 200px;
    max-width: 230px;
  }
  .cardTitle {
    font-size: 14px !important;
  }
  .addressLine {
    font-size: 12px !important;
    margin-bottom: 3px !important;
    line-height: 1.4 !important;
  }
}

/* ---- Invisible lazy mount reserve ---- */
.mapMountReserve {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .markerIcon,
  .markerIconHq { transition: none; }
  .pinPulse { animation: none; opacity: 0.45; }
}

/* ---- Graceful error fallback ---- */
.errorOverlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: #101012;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-manrope), system-ui, sans-serif;
}

.errorTitle {
  font-size: clamp(15px, 2.4vw, 18px);
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.errorText {
  font-size: 13px;
  max-width: 38ch;
  margin: 0;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
}

.errorList {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: center;
}

.errorList li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #f1f1f1;
}

.errorList li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c01227;
}

/* ---- Screen-reader-only office list ---- */
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
