/* ==========================================================
   Aplify – Map View
   Tokens defined in aplify-tokens.css (scoped to :root)
   ========================================================== */

/* -----------------------------
   MAIN CONTAINER
--------------------------------*/

[x-cloak] { display: none !important; }

.aplify-map-view {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--font-size);
  color: var(--fg);
  height: 100%;
}

/* Full-screen overlay: the plugin now owns this view itself (toggled via
   Alpine's viewMode store) rather than relying on an Elementor popup to
   provide the modal chrome/positioning. */
.aplify-map-view {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
}

/* -----------------------------
   LAYOUT
--------------------------------*/

.map-layout {
  position: relative;
  width: 100%;
  height: 100%;
}

/* -----------------------------
   JOB LIST PANEL
--------------------------------*/

.job-list-panel {
  position: absolute;
  left: 20px;
  top: 20px;
  bottom: 20px;
  width: 30%;
  max-width: 450px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background: var(--map-panel-bg, var(--input-bg));
  border: var(--panel-border-w) solid var(--panel-border);
  border-radius: min(var(--panel-radius), 20px);
  box-shadow: var(--panel-shadow);
  z-index: 10;
  opacity: 0.85;
  transition: opacity .3s ease;
}

.job-list-panel:hover {
  opacity: 1;
}

/* -----------------------------
   PANEL HEADER
--------------------------------*/

.panel-header {
  flex-shrink: 0;
  background: var(--map-panel-bg, var(--input-bg));
  padding: 20px;
  border-bottom: var(--panel-border-w) solid var(--panel-border);
  border-radius: min(var(--panel-radius), 20px) min(var(--panel-radius), 20px) 0 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 15px;
}

.map-job-count {
  margin: 0;
  font-size: var(--text-xs, 12px);
  font-weight: var(--weight-strong, 600);
  color: var(--fg);
  font-family: var(--font-family);
}

.search-area-btn {
  padding: 6px 14px !important;
  background: var(--view-details-bg, var(--primary)) !important;
  color: var(--view-details-text, #fff) !important;
  border: none !important;
  border-radius: var(--btn-radius) !important;
  font-size: var(--text-sm, 13px)!important;
  font-weight: var(--button-weight) !important;
  font-family: var(--font-family);
  box-shadow: var(--button-shadow);
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
  white-space: nowrap;
}

.search-area-btn:hover {
  background: var(--view-details-bg-hover, var(--primary-hover)) !important;
  color: var(--view-details-text-hover, var(--view-details-text, #fff)) !important;
  box-shadow: var(--button-shadow-hover);
}

.search-area-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.job-list-panel .load-more-btn {
  width: 100%;
  padding: 12px;
  /* Outline style, not filled — its "accent" colour (border + text) is what
     the View Details override drives here, rather than its background,
     since this button is deliberately unfilled at rest. */
  background: #fff !important;
  color: var(--view-details-bg, var(--highlight)) !important;
  border: 1.5px solid var(--view-details-bg, var(--highlight)) !important;
  border-radius: var(--btn-radius);
  font-size: var(--font-size);
  font-weight: var(--button-weight);
  font-family: var(--font-family);
  box-shadow: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
	margin-top: 20px;
}

.job-list-panel .load-more-btn:hover {
  background: var(--view-details-bg, var(--highlight)) !important;
  color: var(--view-details-text, #fff) !important;
  box-shadow: var(--button-shadow-hover);
}

.job-list-panel .load-more-btn:disabled {
  background: var(--muted) !important;
  cursor: not-allowed;
  box-shadow: none;
}

/* -----------------------------
   JOB LIST SCROLL AREA
--------------------------------*/

.job-list-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
}

.job-list-scroll.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* -----------------------------
   MAP JOB CARDS
--------------------------------*/

.map-job-card {
  background: var(--job-card-bg, var(--input-bg));
  border: var(--panel-border-w) solid var(--panel-border);
  border-radius: min(var(--panel-radius), 20px);
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow .2s, border-color .2s;
	cursor: pointer;
}

.map-job-card:hover {
  box-shadow: 0 4px 16px rgba(2, 6, 23, .08);
  border-color: var(--primary);
}

/* The job the candidate picked on the map: outlined in the route colour
   while it stays picked, across mode changes. The highlight flash below
   wins while it lasts. */
.map-job-card.is-route {
  border-color: var(--travel-mode-color, var(--brand-option-clr));
  box-shadow: 0 0 0 2px var(--travel-mode-color, var(--brand-option-clr));
}

.map-job-card.highlighted {
  background: color-mix(in srgb, var(--highlight) 8%, white);
  border-color: var(--highlight);
  box-shadow: 0 0 0 2px var(--highlight);
}

.job-header {
  margin-bottom: 10px;
}

.job-title {
  display: block;
  font-size: var(--text-md, 16px);
  font-weight: var(--display-weight, 550)!important;
  color: var(--job-title-color, var(--primary)) !important;
  font-family: var(--font-family) !important;
  text-decoration: none;
  margin-bottom: 6px;
  line-height: 1.4;
}

.job-title:hover {
  color: var(--job-title-color-hover, var(--job-title-color, var(--primary))) !important;
  text-decoration: underline;
}

.job-meta {
  font-size: var(--text-sm, 13px);
  color: var(--muted);
  line-height: 1.5;
  font-family: var(--font-family);
}

.job-meta .company {
  display: none;
}

.job-meta .location {
  font-weight: var(--weight-strong, 600);
  color: var(--fg);
}

.job-meta .separator {
  margin: 0 4px;
}

.job-meta .company + .separator {
  display: none;
}

.job-distance-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-option-clr);
  font-weight: var(--weight-strong, 600);
  font-size: var(--text-sm, 13px);
  white-space: nowrap;
}

.job-distance-inline i {
  font-size: var(--text-sm, 13px);
}

/* -----------------------------
   BADGES
--------------------------------*/

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius);
  font-size: var(--text-2xs, 11px);
  font-weight: var(--label-weight);
  font-family: var(--font-family);
}

.badge i {
  font-size: var(--text-2xs, 11px);
}

.category-badge {
  background: rgb(from var(--primary) r g b / 0.08);
  color: var(--primary);
}

.hours-badge {
  background: #e6e9f0;
  color: var(--fg);
}

.salary-badge {
  background: rgb(from var(--highlight) r g b / 0.10);
  color: var(--highlight);
  font-weight: var(--weight-strong, 600);
}

/* -----------------------------
   JOB DESCRIPTION
--------------------------------*/

.job-description {
  font-size: var(--text-sm, 13px);
  color: var(--fg);
  line-height: 1.6;
  margin-bottom: 12px;
  font-family: var(--font-family);
	font-weight: var(--weight-body, 400);
}

/* -----------------------------
   JOB FOOTER / APPLY BUTTON
--------------------------------*/

.job-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.job-footer .apply-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--view-details-bg, var(--primary)) !important;
  color: var(--view-details-text, var(--button-text-color)) !important;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: var(--text-base, 14px);
  font-weight: var(--button-weight);
  font-family: var(--font-family);
  box-shadow: var(--button-shadow);
  transition: background .2s, box-shadow .2s;
}

.job-footer .apply-btn:hover {
  background: var(--view-details-bg-hover, var(--primary-hover)) !important;
  box-shadow: var(--button-shadow-hover);
  color: var(--view-details-text-hover, var(--view-details-text, var(--button-text-color))) !important;
}

/* With the public transport link, the footer spreads it and View
   Details to opposite ends; without one, View Details stays right. */
.job-footer .map-directions-link {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--travel-mode-color, var(--brand-option-clr));
  font-size: var(--text-sm, 13px);
  font-weight: var(--weight-strong, 600);
  text-decoration: none;
}

.job-footer .map-directions-link:hover {
  text-decoration: underline;
}

.job-footer .map-directions-link i {
  font-size: 1.15em;
}

/* The outward arrow: smaller and a little apart, so it reads as "this
   leaves the page" rather than part of the label. */
.job-footer .map-directions-link .map-directions-link__out {
  margin-left: 2px;
  font-size: .95em;
  opacity: .8;
}

.apply-btn-small {
  padding: 6px 12px;
  font-size: var(--text-xs, 12px);
}

/* -----------------------------
   MAP CONTAINER
--------------------------------*/

.map-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

#aplify-map {
  width: 100%;
  height: 100%;
}

.map-container .map-close-btn {
  position: absolute;
  top: 20px;
  right: 27px;
  z-index: 20;
  width: 36px !important;
  height: 36px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  border-radius: 50% !important;
  background: var(--view-details-bg, var(--primary)) !important;
  color: var(--view-details-text, #ffffff) !important;
  box-shadow: var(--button-shadow) !important;
  cursor: pointer;
  font-size: var(--text-lg, 18px)!important;
  font-weight: var(--weight-body, 400)!important;
}

.map-container .map-close-btn:hover {
  background: var(--view-details-bg-hover, var(--primary-hover)) !important;
  color: var(--view-details-text-hover, var(--view-details-text, #ffffff)) !important;
}

/* -----------------------------
   USER LOCATION PIN
   A real DOM marker (not a map layer) so it can be an actual pin shape via
   CSS rather than a plain dot — classic teardrop trick: a square with three
   square corners and one rounded corner set, rotated 45°.
--------------------------------*/

.aplify-user-location-pin {
  width: 26px;
  height: 26px;
  position: relative;
}

.aplify-user-location-pin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--highlight);
  border: 3px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

/* -----------------------------
   MAP MARKERS
--------------------------------*/

.job-marker {
  transition: transform .2s;
}

.job-marker:hover {
  transform: scale(1.2);
}

/* -----------------------------
   MESSAGES
--------------------------------*/

.loading-message,
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: var(--font-size);
  font-family: var(--font-family);
}

.error-message {
  text-align: center;
  padding: 20px;
  color: var(--highlight);
  background: color-mix(in srgb, var(--highlight) 10%, white);
  border-radius: min(var(--panel-radius), 20px);
  font-size: var(--font-size);
  font-family: var(--font-family);
}

/* -----------------------------
   CLUSTER FILTER NOTICE
--------------------------------*/

.cluster-filter-notice {
  background: color-mix(in srgb, var(--primary) 10%, white);
  border: 1px solid var(--primary);
  border-radius: min(var(--panel-radius), 20px);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm, 13px);
  color: var(--primary);
  font-weight: var(--label-weight);
  font-family: var(--font-family);
}

.clear-filter-btn {
  padding: 6px 14px;
  background: var(--view-details-bg, var(--primary)) !important;
  color: var(--view-details-text, #fff) !important;
  border: none;
  border-radius: var(--btn-radius);
  font-size: var(--text-xs, 12px);
  font-weight: var(--button-weight);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background .2s;
}

.clear-filter-btn:hover {
  background: var(--view-details-bg-hover, var(--primary-hover)) !important;
  color: var(--view-details-text-hover, var(--view-details-text, #fff)) !important;
}

/* -----------------------------
   MAPBOX OVERRIDES
--------------------------------*/

.mapboxgl-map {
  width: 100% !important;
  height: 100% !important;
}

.mapboxgl-canvas {
  width: 100% !important;
  height: 100% !important;
}

.mapboxgl-ctrl-top-right {
  /* Sits below the 36px close button (top:20px) rather than sharing its
     row — top-right is the one corner the job-list-panel never claims in
     either the desktop (left sidebar) or mobile (bottom sheet) layout. */
  top: 66px;
  right: 20px;
}

/* Mapbox's zoom in/out/compass buttons are Mapbox's own generated DOM, not
   ours — but Elementor's site-wide global button kit styles every single
   <button> on the page regardless of who created it, which was inflating
   these to the same oversized padding/radius as any other button and
   pushing their +/- icon backgrounds out of view (the "empty box" look).
   Restoring Mapbox's own small, square, unpadded button dimensions. */
.mapboxgl-ctrl button,
.mapboxgl-ctrl-group button {
  width: 29px !important;
  height: 29px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0 !important;
  font-weight: var(--weight-body, 400)!important;
  box-sizing: border-box !important;
}

/* Same problem, other states: the Hello Elementor theme's reset paints
   every <button>:hover and :focus in its pink (#c36), and Mapbox leaves
   the button's own background to the page. So the zoom and compass
   buttons went pink on hover and stayed pink after a click (focus).
   Background colour only: the +/- and compass icons are background
   images on the inner span, which this doesn't touch. */
.aplify-map-view .mapboxgl-ctrl button,
.aplify-map-view .mapboxgl-ctrl button:focus,
.aplify-map-view .mapboxgl-ctrl button:active {
  background-color: transparent !important;
  color: inherit !important;
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.aplify-map-view .mapboxgl-ctrl button:not(:disabled):hover {
  background-color: rgba(0, 0, 0, .05) !important;
}

/* Keyboard focus still shows, in the plugin's focus ring colour. */
.aplify-map-view .mapboxgl-ctrl button:focus-visible {
  box-shadow: inset 0 0 0 2px var(--ring, var(--primary)) !important;
}

/* -----------------------------
   RESPONSIVE
--------------------------------*/

@media (max-width: 768px) {
  .job-list-panel {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    width: auto;
    max-width: none;
    max-height: 50%;
    min-width: 0;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-area-btn {
    width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .job-list-panel {
    width: 35%;
  }
}