/* ==========================================================================
   WORK & TRAVEL CLUB — HARTA JOBURILOR (/job)
   Fisier: wtcx-harta.css
   DEPENDENTA: se incarca DUPA wtcx-sections.css (tokens --wtcx-*).
   Leaflet CSS este incarcat automat de wtcx-harta.js, nu trebuie adaugat manual.
   ========================================================================== */

.wtcx-map { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }

/* ---------- Bara de filtre ---------- */
.wtcx-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--wtcx-line, #DCE3EC);
  border-radius: var(--wtcx-radius, 14px);
}

.wtcx-filters__search { position: relative; flex: 1 1 220px; min-width: 190px; }
.wtcx-filters__search input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--wtcx-line, #DCE3EC);
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--wtcx-ink, #1D2430);
  background: #fff;
}
.wtcx-filters__search input:focus { border-color: var(--wtcx-navy, #10233F); outline: none; }
.wtcx-filters__search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--wtcx-ink-soft, #5A6577); pointer-events: none;
}

.wtcx-filters select {
  padding: 11px 14px;
  border: 1.5px solid var(--wtcx-line, #DCE3EC);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--wtcx-ink, #1D2430);
  background: #fff;
  cursor: pointer;
  max-width: 200px;
}
.wtcx-filters select:focus { border-color: var(--wtcx-navy, #10233F); outline: none; }

.wtcx-filters__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--wtcx-ink, #1D2430);
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  border: 1.5px solid var(--wtcx-line, #DCE3EC);
  border-radius: 999px;
}
.wtcx-filters__check input { accent-color: var(--wtcx-red, #E2231A); width: 16px; height: 16px; }

.wtcx-filters__reset {
  background: none; border: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 700; color: var(--wtcx-ink-soft, #5A6577);
  text-decoration: underline; padding: 8px;
}
.wtcx-filters__reset:hover { color: var(--wtcx-red, #E2231A); }

.wtcx-filters__count {
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--wtcx-navy, #10233F);
  white-space: nowrap;
}
.wtcx-filters__count b { color: var(--wtcx-red, #E2231A); }

/* ---------- Harta ---------- */
.wtcx-map__canvas {
  height: 620px;
  border-radius: var(--wtcx-radius, 14px);
  border: 1px solid var(--wtcx-line, #DCE3EC);
  overflow: hidden;
  background: var(--wtcx-mist, #F2F5F9);
  z-index: 1; /* sub headerul fix al temei */
}

.wtcx-map__status {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 30px;
  text-align: center;
  color: var(--wtcx-ink-soft, #5A6577);
  font-size: 15px;
}
.wtcx-map__status b { display: block; color: var(--wtcx-navy, #10233F); margin-bottom: 6px; font-size: 16px; }

/* Marker propriu: pin cu salariul */
.wtcx-pin {
  background: none !important;
  border: 0 !important;
}
.wtcx-pin__body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--wtcx-navy, #10233F);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  font-family: var(--wtcx-font-display, inherit);
  box-shadow: 0 3px 10px rgba(16, 35, 63, .35);
  border: 2px solid #fff;
  white-space: nowrap;
  transition: transform .15s ease;
}
.wtcx-pin__body::after {
  content: "";
  position: absolute;
  bottom: -7px; left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #fff;
}
.wtcx-pin:hover .wtcx-pin__body { transform: translateY(-2px) scale(1.06); }

.wtcx-pin--restaurant .wtcx-pin__body { background: var(--wtcx-red, #E2231A); }
.wtcx-pin--hotel      .wtcx-pin__body { background: var(--wtcx-navy, #10233F); }
.wtcx-pin--parc       .wtcx-pin__body { background: #17A673; }
.wtcx-pin--magazin    .wtcx-pin__body { background: var(--wtcx-blue, #2E6BE6); }
.wtcx-pin--altele     .wtcx-pin__body { background: #7A6A55; }
.wtcx-pin.is-active .wtcx-pin__body { background: var(--wtcx-gold, #FFB703); color: #3A2600; }

/* Popup */
.leaflet-popup-content-wrapper {
  border-radius: var(--wtcx-radius, 14px) !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: var(--wtcx-shadow-lg, 0 22px 55px rgba(16,35,63,.16)) !important;
}
.leaflet-popup-content { margin: 0 !important; width: 288px !important; }
.leaflet-popup-tip { box-shadow: none !important; }

.wtcx-pop { font-family: var(--wtcx-font-body, inherit); color: var(--wtcx-ink, #1D2430); }
.wtcx-pop__img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
  background: var(--wtcx-mist, #F2F5F9);
}
.wtcx-pop__body { padding: 16px 18px 18px; }
.wtcx-pop__pay {
  display: inline-block;
  font-family: var(--wtcx-font-display, inherit);
  font-size: 18px;
  font-weight: 800;
  color: var(--wtcx-red, #E2231A);
  margin-bottom: 6px;
}
.wtcx-pop__pay span { font-size: 12px; color: var(--wtcx-ink-soft, #5A6577); font-weight: 700; }
.wtcx-pop__name {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--wtcx-navy, #10233F);
  line-height: 1.3;
  margin: 0 0 4px;
}
.wtcx-pop__pos { font-size: 14px; color: var(--wtcx-ink-soft, #5A6577); margin: 0 0 14px; }

.wtcx-pop__meta { border-top: 1px solid var(--wtcx-line, #DCE3EC); padding-top: 12px; }
.wtcx-pop__row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--wtcx-ink-soft, #5A6577);
  padding: 4px 0;
}
.wtcx-pop__row svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--wtcx-red, #E2231A); margin-top: 2px; }
.wtcx-pop__row b { color: var(--wtcx-navy, #10233F); font-weight: 700; }

.wtcx-pop__note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--wtcx-ink-soft, #5A6577);
  background: var(--wtcx-mist, #F2F5F9);
  border-radius: 6px;
  padding: 8px 10px;
}
.wtcx-pop__cta {
  display: block;
  margin-top: 14px;
  text-align: center;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--wtcx-red, #E2231A);
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none !important;
}
.wtcx-pop__cta:hover { background: var(--wtcx-red-dark, #B21610); }

/* Clustere */
.wtcx-cluster {
  background: none;
  display: grid;
  place-items: center;
}
.wtcx-cluster div {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wtcx-red, #E2231A);
  color: #fff;
  font-family: var(--wtcx-font-display, inherit);
  font-weight: 800;
  font-size: 14px;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(226, 35, 26, .4);
}

/* ---------- Lista laterala ---------- */
.wtcx-list {
  border: 1px solid var(--wtcx-line, #DCE3EC);
  border-radius: var(--wtcx-radius, 14px);
  background: #fff;
  height: 620px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wtcx-list__head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--wtcx-line, #DCE3EC);
  background: var(--wtcx-mist, #F2F5F9);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--wtcx-ink-soft, #5A6577);
}
.wtcx-list__scroll { overflow-y: auto; flex: 1 1 auto; }

.wtcx-list__item {
  display: flex;
  gap: 13px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--wtcx-line, #DCE3EC);
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background .18s;
}
.wtcx-list__item:hover { background: var(--wtcx-mist, #F2F5F9); }
.wtcx-list__item.is-active { background: rgba(226, 35, 26, .07); }

.wtcx-list__thumb {
  flex: 0 0 auto;
  width: 58px; height: 58px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--wtcx-mist, #F2F5F9);
}
.wtcx-list__info { min-width: 0; }
.wtcx-list__name {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--wtcx-navy, #10233F);
  line-height: 1.3;
  margin-bottom: 3px;
}
.wtcx-list__pos {
  display: block;
  font-size: 12.5px;
  color: var(--wtcx-ink-soft, #5A6577);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wtcx-list__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wtcx-list__tags span {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--wtcx-mist, #F2F5F9);
  color: var(--wtcx-ink-soft, #5A6577);
}
.wtcx-list__tags .is-pay { background: rgba(226, 35, 26, .1); color: var(--wtcx-red, #E2231A); }

.wtcx-list__empty { padding: 40px 24px; text-align: center; color: var(--wtcx-ink-soft, #5A6577); font-size: 15px; }

/* ---------- Legenda + nota ---------- */
.wtcx-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--wtcx-ink-soft, #5A6577);
}
.wtcx-map__legend span { display: inline-flex; align-items: center; gap: 7px; }
.wtcx-map__legend i {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block;
}
.wtcx-map__note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--wtcx-ink-soft, #5A6577);
  line-height: 1.55;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .wtcx-map { grid-template-columns: 1fr; }
  .wtcx-list { height: 420px; }
  .wtcx-map__canvas { height: 480px; }
}

@media (max-width: 767px) {
  .wtcx-filters { padding: 14px; gap: 8px; }
  .wtcx-filters select,
  .wtcx-filters__check { flex: 1 1 100%; max-width: none; }
  .wtcx-filters__count { margin-left: 0; flex: 1 1 100%; }
  .wtcx-map__canvas { height: 380px; }
}


/* ==========================================================================
   PROTECTIE OPACITATE
   Leaflet si plugin-ul de clustering seteaza opacity direct pe elementul
   iconitei in timpul animatiilor. Daca o animatie e intrerupta (se intampla
   la filtrare, cand stratul e reconstruit), markerul ramane invizibil.
   Animatiile sunt oricum dezactivate din JS, deci fortam opacitatea aici.
   ========================================================================== */
.wtcx-pin,
.wtcx-cluster,
.leaflet-marker-icon.wtcx-pin,
.leaflet-marker-icon.wtcx-cluster { opacity: 1 !important; }

.leaflet-cluster-anim .leaflet-marker-icon,
.leaflet-cluster-anim .leaflet-marker-shadow { transition: none !important; }


/* ==========================================================================
   INDICIU PENTRU SCROLL
   Apare cand utilizatorul roteste rotita fara Ctrl apasat.
   ========================================================================== */
.wtcx-map__hint {
  position: absolute;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 35, 63, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  pointer-events: none;
}
.wtcx-map__hint.is-visible { opacity: 1; visibility: visible; }
.wtcx-map__hint span {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 1.45;
  max-width: 320px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.wtcx-map__canvas { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .wtcx-map__hint { transition: none; }
}
