/* ============================================================
   JOB MAP VIEW
   ============================================================ */

/* ── View Tabs (inside hero, bottom edge) ── */
.ejb-view-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  z-index: 10;
  margin-top: 16px;
  margin-bottom: -36px;
  padding-bottom: 0;
}

.ejb-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.ejb-view-tab:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.ejb-view-tab.active {
  background: #F8F9FA;
  color: #333;
  z-index: 2;
}

.ejb-view-tab svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Legacy toggle support (pill style, used by shortcode) ── */
.ejb-view-toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ejb-view-toggle-btns {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  padding: 2px;
}

.ejb-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ejb-view-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.ejb-view-btn.active {
  background: #fff;
  color: #444;
}

.ejb-view-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Map Wrapper ── */
#ejb-map-wrapper {
  display: none;
  height: calc(100vh - 180px);
  min-height: 500px;
  max-height: 800px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e4e4e4;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

#ejb-map-wrapper.active {
  display: flex;
}

/* ── Side Panel ── */
#ejb-map-side-panel {
  width: 340px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e4e4e4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ejb-map-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  background: #fafafa;
  flex-shrink: 0;
}

.ejb-map-panel-header strong {
  color: #222;
}

.ejb-map-panel-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
}

.ejb-map-panel-cards::-webkit-scrollbar { width: 5px; }
.ejb-map-panel-cards::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.ejb-map-panel-cards::-webkit-scrollbar-thumb:hover { background: #999; }

/* ── Compact Job Card ── */
.ejb-map-card {
  padding: 12px 14px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.ejb-map-card:hover,
.ejb-map-card.highlighted {
  border-color: #007481;
  box-shadow: 0 2px 10px rgba(0, 116, 129, 0.12);
}

.ejb-map-card.highlighted {
  background: #f0fafa;
}

.ejb-map-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.ejb-map-card-cat {
  font-size: 10px;
  font-weight: 700;
  color: #007481;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.ejb-map-card-pay {
  font-size: 12px;
  font-weight: 700;
  color: #007481;
  white-space: nowrap;
  line-height: 1;
}

.ejb-map-card-title {
  font-size: 13px;
  font-weight: 500;
  color: #222;
  line-height: 1.3;
  margin-bottom: 6px;
}

.ejb-map-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #777;
  flex-wrap: wrap;
}

.ejb-map-card-meta svg {
  width: 12px;
  height: 12px;
  stroke: #999;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.ejb-map-card-sep {
  color: #ccc;
}

/* ── Map Canvas ── */
#ejb-map-canvas {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

/* Fix Leaflet images inside WordPress */
.leaflet-container img {
  max-width: none !important;
  max-height: none !important;
}

/* ── Cluster Icons ── */
.ejb-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.8);
}

.ejb-cluster-small {
  width: 34px;
  height: 34px;
  font-size: 12px;
  background: #1a9a9a;
}

.ejb-cluster-medium {
  width: 44px;
  height: 44px;
  font-size: 13px;
  background: #007481;
}

.ejb-cluster-large {
  width: 54px;
  height: 54px;
  font-size: 14px;
  background: #005a63;
}

/* ── Single Marker ── */
.ejb-marker {
  width: 12px;
  height: 12px;
  background: #007481;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.ejb-marker.pulse {
  animation: ejb-marker-pulse 0.6s ease-out;
}

@keyframes ejb-marker-pulse {
  0% { transform: scale(1); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
  50% { transform: scale(1.8); box-shadow: 0 0 12px rgba(0, 116, 129, 0.5); }
  100% { transform: scale(1); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
}

/* ── Marker Popup ── */
.ejb-popup {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  min-width: 200px;
  max-width: 260px;
}

.ejb-popup-cat {
  font-size: 10px;
  font-weight: 700;
  color: #007481;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.ejb-popup-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
  line-height: 1.3;
}

.ejb-popup-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.ejb-popup-pay {
  font-size: 14px;
  font-weight: 700;
  color: #007481;
  margin-bottom: 8px;
}

.ejb-popup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  background: #007481;
  color: #fff !important;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none !important;
  transition: background 0.2s;
  -webkit-font-smoothing: antialiased;
}

.ejb-popup-link:hover,
.ejb-popup-link:visited,
.ejb-popup-link:active {
  background: #006370;
  color: #fff !important;
  text-decoration: none !important;
}

/* ── Geocoding Gap Notice ── */
.ejb-map-gap-notice {
  padding: 10px 16px;
  background: #fff8e6;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #886;
  text-align: center;
  flex-shrink: 0;
}

/* ── Empty State ── */
.ejb-map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 32px;
  text-align: center;
  color: #888;
}

.ejb-map-empty svg {
  width: 48px;
  height: 48px;
  stroke: #ccc;
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 12px;
}

.ejb-map-empty strong {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

.ejb-map-empty span {
  font-size: 12px;
}

/* ── Mobile Floating Button ── */
.ejb-map-float-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 12px 28px;
  background: #007481;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.ejb-map-float-btn:hover {
  background: #006370;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

/* ── Page Layout: Full-width when map active ── */
.ejb-map-active .col-md-4 {
  display: none;
}

.ejb-map-active .col-md-8 {
  width: 100%;
  flex: 0 0 100%;
  max-width: 100%;
}

/* ── Panel on Right ── */
#ejb-map-wrapper[data-panel="right"] {
  flex-direction: row-reverse;
}

#ejb-map-wrapper[data-panel="right"] #ejb-map-side-panel {
  border-right: none;
  border-left: 1px solid #e4e4e4;
}

/* ── Responsive: Tablet ── */
@media (min-width: 768px) and (max-width: 1023px) {
  #ejb-map-side-panel {
    width: 280px;
  }
}

/* ── Responsive: Mobile ── */
@media (max-width: 767px) {
  .ejb-view-tabs {
    padding: 0;
    margin-bottom: -24px;
  }

  .ejb-view-tabs + .dd-mask + #ejb-map-wrapper,
  .ejb-view-tabs ~ #job-listings-container,
  .ejb-view-tabs ~ #job-listings {
    padding-top: 8px;
  }

  .ejb-view-tab {
    padding: 8px 18px;
    font-size: 12px;
  }

  .ejb-view-btn {
    padding: 4px 12px;
    font-size: 11px;
  }

  #ejb-map-wrapper {
    height: calc(100vh - 160px);
    min-height: 400px;
    border-radius: 8px;
  }

  #ejb-map-wrapper.active {
    display: block;
    position: relative;
  }

  #ejb-map-side-panel {
    display: none;
  }

  #ejb-map-canvas {
    width: 100%;
    height: 100%;
  }

  .ejb-map-float-btn {
    display: block;
  }

  /* Hide float btn when in list view */
  .ejb-map-float-btn.hidden {
    display: none;
  }
}

/* ── Loading State ── */
.ejb-map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: #f8f9fa;
}

.ejb-map-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e4e4e4;
  border-top-color: #007481;
  border-radius: 50%;
  animation: ejb-v2-spin 0.6s linear infinite;
}

@keyframes ejb-v2-spin {
  to { transform: rotate(360deg); }
}

/* ── Sign-up CTA Banner ── */
.ejb-map-cta {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #444;
  max-width: 340px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ejb-map-cta-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #edf8f8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ejb-map-cta-icon svg {
  width: 22px;
  height: 22px;
  stroke: #007481;
  fill: none;
  stroke-width: 2;
}

.ejb-map-cta-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ejb-map-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  line-height: 1.2;
}

.ejb-map-cta-text {
  font-size: 12.5px;
  color: #666;
  line-height: 1.4;
}

.ejb-map-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  background: #007481;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
  align-self: flex-start;
}

.ejb-map-cta-btn:hover {
  background: #006370;
}

@media (max-width: 767px) {
  .ejb-map-cta {
    padding: 14px 16px;
    gap: 10px;
    max-width: 280px;
    margin-bottom: 60px;
  }
  .ejb-map-cta-title { font-size: 13px; }
  .ejb-map-cta-text { font-size: 11.5px; }
  .ejb-map-cta-btn { font-size: 12px; padding: 7px 18px; }
}

/* ── Leaflet popup overrides ── */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 14px 16px;
  line-height: 1.4;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content a.ejb-popup-link {
  color: #fff !important;
  text-decoration: none !important;
}
