/* ===========================
   Locum Job Explorer (legacy-friendly)
   - No CSS variables
   - No CSS Grid / gap
   - Flexbox layout
   - Fits in viewport minus header (120px) + footer (30px)
   =========================== */

/* Root layout: full height minus site chrome */
.lje-root {
  height: calc(100vh - 150px); /* 120 (nav) + 30 (footer) */
  display: flex;
  flex-direction: column;
  margin: 0;
  border-bottom: 1px solid #fff;
}

/* Top bar */
.lje-topbar {
  height: 64px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e6e6e6;
  background: #fff;
}

.lje-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

/* Use margins instead of gap */
.lje-filters > * {
  margin-right: 12px;
  margin-bottom: 8px;
}
.lje-filters > *:last-child {
  margin-right: 0;
}

.lje-filters select,
.lje-filters input[type="date"] {
  padding: 6px 8px;
  min-width: 120px;
}

.lje-btn {
  padding: 6px 10px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
}

/* Body: sidebar + map (flex instead of CSS grid) */
.lje-body {
  position: relative;
  flex: 1;
  min-height: 0;            /* allow children to shrink */
  display: flex;
  flex-direction: row;      /* sidebar left, map right */
  overflow: hidden;         /* prevent page scrollbars */
  border-bottom: 1px solid #e6e6e6;
}

.lje-sidebar {
  width: 380px;
  flex: 0 0 380px;          /* fixed sidebar width */
  border-right: 1px solid #e6e6e6;
  overflow: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  /* Smooth scrolling inside the sidebar (falls back gracefully if unsupported) */
  scroll-behavior: smooth;
}

.lje-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.lje-heading {
  margin: 0;
  font-size: 12px;
}

/* Job list */
.lje-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lje-card {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  background: #074a23;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

/* Use anchors for clickable cards; avoid 'all: unset' for broader support */
.lje-card a {
  display: block;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 10px;
  color: inherit; /* keep white text */
}

.lje-card:hover {
  background: #006400;
}

/* Focus styles: support :focus-visible where available, fall back to :focus */
.lje-card a:focus-visible,
.lje-card a:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Title + meta */
.lje-card-title {
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #fff;
}

/* No CSS grid here; just stacked lines with small spacing */
.lje-card-meta {
  font-size: 12px;
  color: #e6f3ec;
  line-height: 1.4;
}
.lje-card-meta > div {
  margin-top: 2px;
}

/* Map container */
.lje-map-wrap {
  position: relative;
  flex: 1 1 auto;   /* fill remaining space */
  min-width: 0;     /* allow shrinking */
}

/* Fill the wrap without using 'inset' shorthand */
.lje-map {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
}

/* Responsive: collapse to column on smaller widths */
@media (max-width: 980px) {
  .lje-body {
    flex-direction: column;
    margin-top: 70px;
  }
  .lje-sidebar {
    width: auto;           /* full width */
    flex: 0 0 auto;
    order: 2;
    height: calc((100vh - 150px) * 0.40);  /* 40% of plugin height */
  }
  .lje-map-wrap {
    order: 1;
    height: calc((100vh - 150px) * 0.60);  /* 60% of plugin height */
  }
}

@keyframes lje-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  30%  { box-shadow: 0 0 0 4px rgba(255,255,255,0.75); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.lje-card--flash {
  animation: lje-pulse 1.6s ease;
}

/* Respect reduced motion if supported */
@media (prefers-reduced-motion: reduce) {
  .lje-sidebar { scroll-behavior: auto; }
  .lje-card--flash { animation: none; }
}

/* Location filter pill in sidebar header */
.lje-locfilter {
  margin-top: 8px;
  padding: 6px 8px;
  background: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lje-locfilter-text {
  font-size: 13px;
  color: #333;
}

.lje-btn-small {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.2;
  width: 70px;
}

/* Favicon-based circular markers */
.lje-logo-icon {
  background: transparent;
  border: none;
  z-index: 401; /* above tiles */
}

.lje-logo-pin {
position: relative;
  border-radius: 9999px;       /* circle mask */
  overflow: hidden;
  border: 2px solid #fff;      /* crisp white ring */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  /* Stronger multi-layer shadow for legibility on any map tile */
  /* inner subtle, medium spread, and wide soft halo */
  box-shadow:
    0 1px 2px rgba(0,0,0,0.35),
    0 4px 10px rgba(0,0,0,0.35),
    0 10px 20px rgba(0,0,0,0.25);
}

/* Make hover scale smooth and anchored at bottom-center */
.leaflet-marker-icon.lje-logo-icon { transform-origin: 50% 100%; }
.lje-logo-pin { transform-origin: 50% 100%; transition: transform 120ms ease; }

/* If base is 30px -> 35px (35/30 ≈ 1.1667) */
.leaflet-marker-icon.lje-logo-icon:hover .lje-logo-pin[data-size="30"] {
  transform: scale(1.1667);
}

/* If base is 20px -> 35px (35/20 = 1.75) */
.leaflet-marker-icon.lje-logo-icon:hover .lje-logo-pin[data-size="20"] {
  transform: scale(1.75);
}

/* If a marker is already 35px (e.g., selected), don't grow further */
.leaflet-marker-icon.lje-logo-icon:hover .lje-logo-pin[data-size="35"] {
  transform: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lje-logo-pin { transition: none; }
}


@media (prefers-reduced-motion: reduce) {
  .leaflet-marker-icon.lje-logo-icon:hover { transform: none; }
}

@media (max-width: 640px) {
  /* Two controls per row */
  .lje-filters > label {
    width: calc(50% - 8px);
    min-width: 0;
    margin-right: 8px;
  }
  /* Put the Reset button on its own row full-width */
  .lje-filters #filter-reset {
    width: 100%;
    font-size: 14px;
    margin-right: 0;
  }

  /* Smaller, more compact controls */
  .lje-filters select,
  .lje-filters input[type="date"],
  .lje-filters input[type="text"],
  .lje-filters .flatpickr-input,
  .lje-filters .flatpickr-alt-input {
    font-size: 12px !important;
    line-height: 1.2;
    padding: 6px 8px;
    width: 100%;     /* ensure controls fill their half row */
    min-width: 0;
    box-sizing: border-box;
  }

  /* Flatpickr alt input sometimes gets a fixed width; force full width */
  .lje-filters .flatpickr-input,
  .lje-filters .flatpickr-alt-input {
    width: 100% !important;
  }
}

/* Full-screen loading overlay */
.lje-spinner-overlay {
  position: fixed;
  inset: 0; /* top:0;right:0;bottom:0;left:0 */
  background: rgba(0,0,0,0.38);
  z-index: 99999;             /* above Leaflet + site UI */
  display: none;              /* toggled via .is-visible */
  align-items: center;
  justify-content: center;
}

.lje-spinner-overlay.is-visible { display: flex; }

/* Spinner circle */
.lje-spinner {
  width: 56px;
  height: 56px;
  border: 6px solid rgba(255,255,255,0.6);
  border-top-color: #074a23;  /* brand green */
  border-radius: 50%;
  animation: lje-spin 1s linear infinite;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.25),
    0 8px 20px rgba(0,0,0,0.25);
}

@keyframes lje-spin {
  to { transform: rotate(360deg); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lje-spinner { animation: none; }
}

/* STAT cards: red highlight */
.lje-card--stat {
  background: #8e1b1b;                  /* deep red */
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.lje-card--stat:hover {
  background: #a52121;
}
.lje-card--stat .lje-card-title { color: #fff; }

/* Small STAT badge beside title */
.lje-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  vertical-align: middle;
}
.lje-badge--stat {
  background: #ffffff;
  color: #8e1b1b;
  font-weight: 700;
}

/* STAT pay line emphasis */
.lje-statline {
  font-weight: 700;
  color: #fff;
}

/* Default marker ring */
.lje-logo-pin {
  border: 2px solid #fff;
}

/* STAT locations: red ring for higher visibility */
.lje-logo-pin--stat {
  border-color: #d62828;              /* vivid red */
  /* optional: slightly stronger glow */
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    0 8px 20px rgba(0,0,0,0.25),
    0 0 0 2px rgba(214,40,40,0.25);
}

/* Make Leaflet tooltips a tad clearer */
.leaflet-tooltip {
  font-weight: 600;
  padding: 4px 8px;
}




