/* =============================================
   TECHMEET — Pages: Techniciens + Immobilier + Map
   ============================================= */

/* ─── SEARCH BAR ─────────────────────────── */
.search-bar {
  padding: 10px 14px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-bar .input-wrap { width: 100%; }

/* ─── HORIZONTAL FILTER TABS ─────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  overflow-x: auto; scrollbar-width: none;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  /* évite que les chips débordent verticalement */
  min-height: 0;
}
.filter-bar::-webkit-scrollbar { display: none; }

/* ─── TECHNICIEN LIST ────────────────────── */
.tech-list {
  display: flex; flex-direction: column;
  padding: 10px 14px 80px;
  gap: 10px;
}

/* ─── TECHNICIEN CARD ────────────────────── */
.tech-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--ease-fast);
}
.tech-card:active { transform: scale(0.99); }

.tech-card-top {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 10px;
  overflow: hidden;
}
.tech-info { flex: 1; min-width: 0; }
.tech-name {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 2px;
  overflow: hidden;
}
.tech-name span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tech-specialty {
  font-size: 13px; font-weight: 600; color: var(--cyan);
  margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tech-rating {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.tech-rating .stars { font-size: 12px; flex-shrink: 0; }
.tech-score  { font-size: 13px; font-weight: 700; flex-shrink: 0; }
.tech-missions { font-size: 12px; color: var(--text-2); }

.tech-card-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 0 14px 10px;
}
.tech-tag {
  font-size: 11px; font-weight: 500;
  padding: 3px 10px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--r-full); color: var(--text-2);
  white-space: nowrap;
}

.tech-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  gap: 8px;
  overflow: hidden;
}
.tech-location {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2);
  min-width: 0; flex: 1;
  overflow: hidden;
}
.tech-location span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tech-footer-btns {
  display: flex; gap: 7px;
  flex-shrink: 0;
}

/* Tech card — Featured */
.tech-card.featured {
  border-color: rgba(245,158,11,0.3);
  background: linear-gradient(145deg, var(--bg-dark), rgba(245,158,11,0.04));
}
.tech-card.featured .tech-card-footer {
  background: rgba(245,158,11,0.06);
  border-top-color: rgba(245,158,11,0.2);
}

/* Availability badge */
.avail-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--green);
  white-space: nowrap; flex-shrink: 0;
}
.avail-dot {
  width: 6px; height: 6px;
  background: var(--green); border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* ─── IMMOBILIER ─────────────────────────── */
.immo-grid {
  display: flex; flex-direction: column;
  padding: 10px 14px 80px;
  gap: 14px;
}

.prop-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--ease-fast);
}
.prop-card:active { transform: scale(0.99); }

.prop-images {
  position: relative; height: 200px; overflow: hidden;
}
.prop-images img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.prop-card:active .prop-images img { transform: scale(1.03); }

.prop-type-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 12px;
  background: var(--blue); color: white;
  font-size: 11px; font-weight: 800;
  border-radius: var(--r-full);
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}
.prop-type-badge.rent    { background: var(--purple); }
.prop-type-badge.terrain { background: var(--green); }

.prop-fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--ease-fast);
  border: none;
  flex-shrink: 0;
}
.prop-fav-btn:active { transform: scale(0.88); }
.prop-fav-btn.saved svg { fill: var(--red); stroke: var(--red); }

.prop-img-count {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  color: white; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-full);
  white-space: nowrap;
}

.prop-body { padding: 14px; }
.prop-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 4px; line-height: 1.3;
  word-break: break-word;
}
.prop-price {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  color: var(--blue-glow); margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prop-price span {
  font-size: 13px; color: var(--text-2);
  font-weight: 400; font-family: var(--font-body);
}
.prop-features {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.prop-feat {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-2);
  white-space: nowrap;
}
.prop-feat svg { color: var(--text-3); flex-shrink: 0; }

.prop-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border);
  gap: 8px; overflow: hidden;
}
.prop-agent { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.prop-agent-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-agent-role { font-size: 11px; color: var(--text-2); white-space: nowrap; }

/* ─── Property search hero ───────────────── */
.immo-hero {
  background: linear-gradient(135deg, #0d1f4a, #091832);
  border-bottom: 1px solid var(--border);
  padding: 16px 14px 14px;
  flex-shrink: 0;
}
/* Fond fixe en dur — sans ceci le bandeau restait bleu marine même en thème
   clair, illisible avec le reste de la page redevenue claire autour de lui. */
body[data-theme='light'] .immo-hero {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
}
.immo-hero-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800;
  margin-bottom: 10px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.immo-stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.immo-stat { display: flex; flex-direction: column; gap: 2px; }
.immo-stat-val {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800; color: var(--text-1);
}
.immo-stat-lbl {
  font-size: 11px; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ─── MAP PAGE ───────────────────────────── */
#page-map { background: var(--bg-root); }
.map-search-overlay {
  padding: 10px 14px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.map-container {
  flex: 1; position: relative; overflow: hidden; background: #0a1424;
}
.map-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at 60% 40%, rgba(37,99,235,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 30% 70%, rgba(6,182,212,0.08) 0%, transparent 60%),
              linear-gradient(180deg, #0a1424, #060d1a);
  padding: 20px;
  text-align: center;
}
.map-placeholder-icon { font-size: 52px; opacity: 0.7; }
.map-placeholder-text {
  font-size: 15px; color: var(--text-2);
  text-align: center; max-width: 260px; line-height: 1.5;
}

/* ─── TECH MAP SECTION ───────────────────── */
.tech-map-section {
  min-height: 300px;
  height: 310px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.tech-map-container {
  height: 100%; width: 100%;
  z-index: 1;
}
.tech-map-controls {
  position: absolute;
  top: 12px; right: 12px;
  display: flex; flex-direction: column;
  gap: 8px; z-index: 20;
}
.tech-map-btn {
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 12px; border: none;
  background: rgba(0,0,0,0.78);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.tech-map-btn:hover  { background: rgba(0,0,0,0.92); }
.tech-map-btn:active { transform: scale(0.94); }

.tech-map-filter-bar {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.72);
  color: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 20;
}
.tech-map-filter-bar::-webkit-scrollbar { display: none; }
/* Fond fixe (indépendant du thème clair/sombre) — sans ça, en thème clair
   --bg-card2 (hérité de .chip) devient presque blanc et le texte "color:white"
   forcé devient illisible dessus. */
.tech-map-filter-bar .chip {
  color: white;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}
.tech-map-filter-bar .chip.active {
  background: rgba(59,130,246,0.45);
  border-color: rgba(96,165,250,0.7);
  color: white;
}

/* mini-cards horizontales sur la carte */
.map-service-cards {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px;
  display: flex; gap: 10px;
  overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(0deg, rgba(10,20,36,0.95) 60%, transparent);
}
.map-service-cards::-webkit-scrollbar { display: none; }
.map-mini-card {
  width: 170px; flex-shrink: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
}
.map-mini-name   { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-mini-cat    { font-size: 12px; color: var(--cyan); font-weight: 600; white-space: nowrap; }
.map-mini-dist   { font-size: 11px; color: var(--text-2); }
.map-mini-rating { display: flex; align-items: center; gap: 4px; font-size: 12px; }

.map-location-btn {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); cursor: pointer;
  transition: var(--ease-fast);
}
.map-location-btn:active { transform: scale(0.91); }

/* Leaflet markers */
#map-container { min-height: 300px; }
#map-container .leaflet-control-attribution { display: none; }
#map-container .leaflet-marker-shadow { display: none; }

.tm-marker-wrap {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}
.tm-marker-wrap:active { transform: scale(0.94); }
.tm-marker-wrap.tm-marker-me .tm-marker-bubble {
  box-shadow: 0 0 0 3px #3b82f6, 0 0 0 5px rgba(59,130,246,0.3);
}
.tm-marker-bubble {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
  position: relative;
}
.tm-marker-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}
.tm-marker-label {
  margin-top: 13px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; color: white;
  white-space: nowrap;
}

/* Couleurs markers */
.tm-cat-electricien   { background: #f59e0b; }
.tm-cat-electricien::after   { border-top: 10px solid #f59e0b; }
.tm-cat-plombier      { background: #06b6d4; }
.tm-cat-plombier::after      { border-top: 10px solid #06b6d4; }
.tm-cat-informaticien { background: #7c3aed; }
.tm-cat-informaticien::after { border-top: 10px solid #7c3aed; }
.tm-cat-mecanicien    { background: #10b981; }
.tm-cat-mecanicien::after    { border-top: 10px solid #10b981; }
.tm-cat-climaticien   { background: #60a5fa; }
.tm-cat-climaticien::after   { border-top: 10px solid #60a5fa; }
.tm-cat-immo          { background: #ec4899; }
.tm-cat-immo::after          { border-top: 10px solid #ec4899; }
.tm-cat-default       { background: #6366f1; }
.tm-cat-default::after       { border-top: 10px solid #6366f1; }

.locate-btn.locating svg { animation: spin 1s linear infinite; }
.custom-stickman-marker { border: none !important; background: none !important; }

/* ─── Responsive Services ────────────────── */

@media (max-width: 480px) {
  .tech-list  { padding: 8px 10px 80px; gap: 8px; }
  .immo-grid  { padding: 8px 10px 80px; gap: 10px; }

  .tech-card-top { padding: 12px 12px 8px; gap: 10px; }
  .tech-name    { font-size: 14px; }
  .tech-specialty { font-size: 12px; }
  .tech-card-footer { padding: 8px 12px; }
  .tech-tag     { font-size: 10px; padding: 2px 8px; }
  .tech-card-tags { padding: 0 12px 8px; gap: 4px; }

  .prop-images  { height: 180px; }
  .prop-body    { padding: 12px; }
  .prop-title   { font-size: 14px; }
  .prop-price   { font-size: 16px; }
  .prop-feat    { font-size: 12px; gap: 4px; }
  .prop-features { gap: 8px; }

  .immo-hero        { padding: 12px 12px 10px; }
  .immo-hero-title  { font-size: 18px; }
  .immo-stat-val    { font-size: 18px; }
  .immo-stats-row   { gap: 12px; }

  .tech-map-section  { height: 280px; min-height: 280px; }
  .tech-map-btn      { width: 38px; height: 38px; }
  .tech-map-filter-bar { padding: 7px 10px; gap: 6px; }

  .search-bar { padding: 8px 12px; }
  .filter-bar { padding: 7px 12px; gap: 6px; }
}

@media (max-width: 360px) {
  .tech-list  { padding: 6px 8px 80px; }
  .immo-grid  { padding: 6px 8px 80px; }

  .tech-card-top { padding: 10px 10px 6px; gap: 8px; }
  .tech-name    { font-size: 13px; }
  .tech-specialty { font-size: 11px; }
  /* Avatar réduit sur très petit écran */
  .tech-card-top .av-lg { width: 50px; height: 50px; font-size: 16px; }
  .tech-card-footer { padding: 7px 10px; gap: 6px; }
  .tech-footer-btns .btn { padding: 6px 10px; font-size: 11px; }
  /* Masque les tags secondaires si trop nombreux */
  .tech-card-tags { max-height: 52px; overflow: hidden; }

  .prop-images  { height: 160px; }
  .prop-body    { padding: 10px; }
  .prop-title   { font-size: 13px; }
  .prop-price   { font-size: 15px; }
  .prop-feat    { font-size: 11px; }
  /* N'affiche que 2 features sur très petit écran */
  .prop-features .prop-feat:nth-child(n+3) { display: none; }

  .immo-hero-title { font-size: 16px; }
  .immo-stat-val   { font-size: 16px; }
  .immo-stat-lbl   { font-size: 10px; }

  .tech-map-section  { height: 240px; min-height: 240px; }
  .tech-map-btn      { width: 36px; height: 36px; border-radius: 10px; }
  .tech-map-controls { gap: 6px; top: 8px; right: 8px; }
  .tech-map-filter-bar { left: 8px; right: 8px; bottom: 8px; padding: 6px 10px; }

  .map-mini-card { width: 150px; padding: 10px; }
  .map-mini-name { font-size: 13px; }
}