/* Full-bleed map under the Vril One–style fixed nav.
   Flex-fill the remaining viewport so Leaflet's bottom attribution
   is never clipped below the fold (BeforeBody share strip used to push it off-screen). */

body.vril-map-active {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}

body.vril-map-active .footer.premium-footer {
  display: none;
}

body.vril-map-active .page-wrapper {
  padding-top: var(--nav-height, 80px);
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.vril-map-active .page-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Inline share strips steal vertical space on the map page; floating bars stay. */
body.vril-map-active .page-wrapper > .vrl-social-share:not(.vrl-social-share--float-left):not(.vrl-social-share--float-right) {
  display: none;
}

.vril-map-page {
  --vril-map-nav-h: var(--nav-height, 80px);
  --vril-map-accent: #667eea;
  --vril-map-accent-dark: #5568d3;
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #e8eaed;
}

.vril-map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.vril-map-overlay {
  position: absolute;
  z-index: 1000;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  pointer-events: none;
  max-width: min(420px, calc(100% - 1.5rem));
}

.vril-map-card {
  pointer-events: auto;
  width: 100%;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.vril-map-search-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.vril-map-search-input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  padding: 0.85rem 0.35rem 0.85rem 0.9rem;
  font-size: 0.95rem;
  color: #202124;
  background: transparent;
  min-width: 0;
}

.vril-map-search-input::placeholder {
  color: #80868b;
}

/* Hide native search clear so our X is the only clear control */
.vril-map-search-input::-webkit-search-cancel-button,
.vril-map-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.vril-map-search-clear {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #5f6368;
  width: 2rem;
  height: 2rem;
  margin-right: 0.1rem;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.vril-map-search-clear[hidden] {
  display: none !important;
}

.vril-map-search-clear:hover,
.vril-map-search-clear:focus {
  background: #f1f3f4;
  color: #202124;
  outline: none;
}

.vril-map-icon-btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #5f6368;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.vril-map-icon-btn:hover,
.vril-map-icon-btn:focus {
  color: var(--vril-map-accent);
  outline: none;
}

.vril-map-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  border-top: 1px solid #e8eaed;
}

.vril-map-results li button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f3f4;
  background: #fff;
  color: #202124;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.vril-map-results li button:hover,
.vril-map-results li button:focus,
.vril-map-results li button.is-active {
  background: #f8f9fa;
  outline: none;
}

.vril-map-results li button.is-active {
  background: #eef1ff;
  color: #30336b;
}

.vril-map-card--route {
  padding: 0;
}

.vril-map-panel-toggle {
  pointer-events: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 0;
  border-bottom: 1px solid #e8eaed;
  background: #fff;
  color: #3c4043;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: left;
}

.vril-map-panel-toggle:hover,
.vril-map-panel-toggle:focus {
  background: #f8f9fa;
  color: var(--vril-map-accent-dark);
  outline: none;
}

.vril-map-panel-toggle__chevron {
  flex: 0 0 auto;
  font-size: 0.85rem;
  line-height: 1;
  color: #5f6368;
  transition: transform 0.18s ease;
}

.vril-map-card--route.is-collapsed .vril-map-panel-toggle {
  border-bottom: 0;
}

.vril-map-card--route.is-collapsed .vril-map-panel-toggle__chevron {
  transform: rotate(-90deg);
}

.vril-map-panel-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.vril-map-card--route.is-collapsed .vril-map-panel-body {
  display: none;
}

.vril-map-route-fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vril-map-travel-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.55rem 0 0.15rem;
  padding: 0.2rem 0;
}

.vril-map-mode-btn {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid #e8eaed;
  border-radius: 0.45rem;
  background: #f8f9fa;
  color: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.vril-map-mode-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

.vril-map-mode-btn:hover,
.vril-map-mode-btn:focus {
  color: var(--vril-map-accent-dark);
  border-color: #c5cae9;
  background: #eef0ff;
  outline: none;
}

.vril-map-mode-btn.is-active {
  color: #fff;
  background: var(--vril-map-accent);
  border-color: var(--vril-map-accent);
  box-shadow: 0 1px 4px rgba(102, 126, 234, 0.35);
}

.vril-map-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  background: #f1f3f4;
  border-radius: 0.35rem;
  padding: 0.35rem 0.55rem;
}

.vril-map-chip > span {
  flex: 0 0 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--vril-map-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vril-map-chip:nth-child(2) > span {
  background: #764ba2;
}

.vril-map-directions {
  margin-top: 0.55rem;
  max-height: min(38vh, 280px);
  overflow: auto;
  border: 1px solid #e8eaed;
  border-radius: 0.4rem;
  background: #fafbfc;
}

.vril-map-directions__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #e8eaed;
  font-size: 0.78rem;
  color: #3c4043;
  position: sticky;
  top: 0;
  background: #fafbfc;
  z-index: 1;
}

.vril-map-directions__hint {
  font-size: 0.7rem;
  color: #5f6368;
  font-weight: 500;
}

.vril-map-voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.vril-map-voice-btn {
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}

.vril-map-voice-btn.is-active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.vril-map-voice-btn:hover,
.vril-map-voice-btn:focus {
  outline: none;
  border-color: #667eea;
}

.vril-map-directions__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.vril-map-directions__list li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #202124;
  border-left: 3px solid transparent;
}

.vril-map-directions__list li.is-active {
  background: rgba(102, 126, 234, 0.12);
  border-left-color: #667eea;
  font-weight: 600;
}

.vril-map-directions__list li.is-done {
  color: #80868b;
}

.vril-map-directions__idx {
  flex: 0 0 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #667eea;
  padding-top: 0.1rem;
}

.vril-map-directions__text {
  flex: 1 1 auto;
  min-width: 0;
}

.vril-map-directions__meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #80868b;
}

/* Tabler/Bootstrap toasts sit above the full-bleed map */
.vril-map-toast-host {
  z-index: 20000;
  pointer-events: none;
}

.vril-map-toast-host .toast {
  pointer-events: auto;
  min-width: min(92vw, 320px);
}

.vril-map-gps-wrap {
  background: transparent !important;
  border: none !important;
}

.vril-map-gps-blip {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4285f4;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.35), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.vril-map-gps-blip::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.18);
  animation: vril-map-gps-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes vril-map-gps-pulse {
  0% { transform: scale(0.55); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}

.vril-map-addr-popup .leaflet-popup-content {
  margin: 0.55rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #202124;
}

.vril-map-addr-popup__body strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6368;
  margin-bottom: 0.2rem;
}

/* Colored letter pins (A blue, B purple, extras cycle) */
.vril-map-pin-wrap {
  background: transparent !important;
  border: none !important;
}

.vril-map-pin {
  --pin-color: #3388ff;
  position: relative;
  display: block;
  width: 28px;
  height: 40px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.vril-map-pin::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50% 50% 50% 0;
  background: var(--pin-color);
  transform: rotate(-45deg);
}

.vril-map-pin__glyph {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin-left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.vril-map-extra-stops {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vril-map-chip--extra > span {
  background: #5f6368;
}

.vril-map-chip input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: #202124;
  min-width: 0;
}

.vril-map-chip-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
  border-radius: 0.25rem;
}

.vril-map-chip-remove:hover,
.vril-map-chip-remove:focus {
  background: #e8eaed;
  color: #202124;
  outline: none;
}

.vril-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.vril-map-share-wrap {
  position: relative;
  display: inline-flex;
}

.vril-map-share-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1200;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.vril-map-share-menu__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: #202124;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}

.vril-map-share-menu__item:hover,
.vril-map-share-menu__item:focus {
  background: #f1f3f4;
  color: #202124;
  outline: none;
  text-decoration: none;
}

.vril-map-share-menu__icon {
  flex: 0 0 1.1rem;
  width: 1.1rem;
  height: 1.1rem;
  color: #5f6368;
  display: inline-flex;
}

.vril-map-share-menu__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.vril-map-pill {
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
}

.vril-map-pill:hover,
.vril-map-pill:focus {
  background: #f8f9fa;
  outline: none;
}

.vril-map-pill.active,
.vril-map-pill:disabled {
  opacity: 0.55;
}

.vril-map-pill.active {
  opacity: 1;
  border-color: var(--vril-map-accent);
  color: var(--vril-map-accent);
  background: rgba(102, 126, 234, 0.12);
}

.vril-map-pill--primary {
  border-color: var(--vril-map-accent);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.vril-map-pill--primary:hover:not(:disabled),
.vril-map-pill--primary:focus:not(:disabled) {
  background: linear-gradient(135deg, #5568d3 0%, #6a4191 100%);
  color: #fff;
}

.vril-map-pill--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vril-map-pill--ghost {
  border-color: transparent;
  background: transparent;
  color: #5f6368;
}

.vril-map-summary {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #188038;
}

.vril-map-status {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #5f6368;
  min-height: 1.1rem;
}

.leaflet-container {
  font: inherit;
  width: 100%;
  height: 100%;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
  margin-right: 0.85rem !important;
  margin-bottom: 1rem !important;
}

.leaflet-control-zoom a {
  width: 2rem !important;
  height: 2rem !important;
  line-height: 2rem !important;
  color: #3c4043 !important;
}

/* Legal Leaflet / OSM credit — compact but always readable, ends with by Vrilsoft */
.leaflet-bottom {
  z-index: 1100 !important;
}

.leaflet-control-attribution {
  font-size: 10px !important;
  line-height: 1.35 !important;
  padding: 2px 6px !important;
  margin: 0 6px 6px 0 !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: #3c4043 !important;
  max-width: min(92vw, 380px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.leaflet-control-attribution a {
  color: #3c4043 !important;
}

.leaflet-control-attribution:hover {
  opacity: 1;
  max-width: min(96vw, 480px);
  white-space: normal;
}

.vril-map-layer-bar {
  position: absolute;
  z-index: 1000;
  top: 0.85rem;
  right: 0.85rem;
  pointer-events: none;
}

.vril-map-layer-btn {
  pointer-events: auto;
  border: 0;
  background: #fff;
  color: #3c4043;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.vril-map-layer-btn:hover,
.vril-map-layer-btn:focus {
  outline: none;
  color: var(--vril-map-accent);
}

.vril-map-layer-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.vril-map-ctx {
  position: fixed;
  z-index: 2000;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: #fff;
  border-radius: 0.65rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.18);
}

.vril-map-ctx__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #1e293b;
  border-radius: 0.45rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.vril-map-ctx__item:hover,
.vril-map-ctx__item:focus {
  background: rgba(102, 126, 234, 0.12);
  color: #4338ca;
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 576px) {
  .vril-map-overlay {
    max-width: calc(100% - 1rem);
    padding: 0.65rem 0.5rem;
  }
}
