/* traffic_zone_filter.css
 * Styles UNIQUEMENT pour le drawer de filtre et le badge.
 * Le bouton ⚙ réutilise .traffic-board-widget__expand (déjà dans traffic_board.css).
 * AUCUN !important — aucun impact sur le design existant.
 */

/* ── Drawer ────────────────────────────────────────────────────────── */
.tzf-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 19000;
  width: 340px;
  max-height: 82vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.18);
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  color: #0f172a;
  /* display géré par JS (flex ou none) */
}

.tzf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  flex-shrink: 0;
}
.tzf-title { font-size: 13px; font-weight: 700; }

.tzf-close {
  width: 26px; height: 26px;
  border: none; background: rgba(15,23,42,0.06);
  border-radius: 7px; cursor: pointer;
  font-size: 12px; color: #64748b;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.tzf-close:hover { background: rgba(15,23,42,0.12); }

.tzf-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}

.tzf-intro {
  font-size: 11.5px; color: #64748b;
  line-height: 1.5; margin: 0 0 12px;
}

.tzf-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: #94a3b8; margin: 0 0 7px;
}
.tzf-sep { height: 1px; background: rgba(15,23,42,0.06); margin: 12px 0; }

/* ── Sélection active ──────────────────────────────────────────────── */
#tzf-summary {
  background: rgba(99,102,241,0.05);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}
.tzf-summary-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #6366f1; margin-bottom: 8px;
}
.tzf-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tzf-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 100px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: #4338ca;
  font-size: 11px; font-weight: 500;
}
.tzf-tag button {
  border: none; background: none;
  cursor: pointer; font-size: 10px;
  color: inherit; padding: 0; opacity: 0.7;
}

/* ── Catalogue ─────────────────────────────────────────────────────── */
#tzf-catalog { display: flex; flex-direction: column; gap: 4px; }

.tzf-territory-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  border-radius: 9px;
  border: 1.5px solid rgba(15,23,42,0.07);
  background: rgba(15,23,42,0.02);
  cursor: pointer; text-align: left;
  transition: all 0.12s;
}
.tzf-territory-btn:hover { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 8%, white); }
.tzf-territory-btn.is-selected {
  border-color: var(--ac);
  background: color-mix(in srgb, var(--ac) 10%, white);
  font-weight: 600;
}
.tzf-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ac, #94a3b8); flex-shrink: 0;
}
.tzf-tname { font-size: 12px; color: #1e293b; flex: 1; line-height: 1.3; }
.tzf-tshort { font-size: 10px; color: #94a3b8; font-family: monospace; white-space: nowrap; }
.tzf-status { font-size: 10px; color: #f59e0b; font-style: italic; }
.tzf-check { font-size: 11px; color: var(--ac, #334155); font-weight: 700; }

/* ── Recherche ─────────────────────────────────────────────────────── */
.tzf-search-input {
  width: 100%; padding: 8px 10px;
  border-radius: 9px; border: 1.5px solid rgba(15,23,42,0.12);
  font-size: 12.5px; outline: none;
  box-sizing: border-box; background: #fff;
}
.tzf-search-input:focus { border-color: #6366f1; }
.tzf-search-status { font-size: 11px; color: #f59e0b; margin-top: 4px; min-height: 16px; }
#tzf-search-results { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.tzf-search-loading, .tzf-search-empty { font-size: 11.5px; color: #94a3b8; padding: 6px 0; }

.tzf-search-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid rgba(15,23,42,0.08);
  background: transparent; cursor: pointer;
  text-align: left; width: 100%;
  transition: background 0.1s;
}
.tzf-search-item:hover { background: rgba(99,102,241,0.06); }
.tzf-search-item.is-selected { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.3); }
.tzf-search-type {
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #94a3b8;
  background: rgba(15,23,42,0.06); border-radius: 4px;
  padding: 1px 4px; white-space: nowrap;
}
.tzf-search-name { font-size: 12px; color: #1e293b; flex: 1; }

/* ── Dessin ────────────────────────────────────────────────────────── */
.tzf-draw-btn {
  width: 100%; padding: 8px 11px;
  border-radius: 9px; border: 1.5px dashed #f59e0b;
  background: transparent; color: #b45309;
  font-size: 12px; font-weight: 500;
  cursor: pointer; text-align: left;
}
.tzf-draw-btn:hover, .tzf-draw-btn.is-drawing { background: rgba(245,158,11,0.07); border-style: solid; }
.tzf-draw-helper { margin-top: 8px; padding: 9px; background: rgba(245,158,11,0.07); border-radius: 8px; }
.tzf-draw-helper p { font-size: 11px; color: #92400e; margin: 0 0 8px; }
.tzf-draw-btns { display: flex; gap: 7px; }
.tzf-finish-btn { flex: 1; padding: 5px; border-radius: 7px; font-size: 11px; font-weight: 600; border: none; background: #f59e0b; color: #fff; cursor: pointer; }
.tzf-finish-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tzf-cancel-btn { flex: 1; padding: 5px; border-radius: 7px; font-size: 11px; font-weight: 600; border: none; background: rgba(15,23,42,0.07); color: #64748b; cursor: pointer; }

/* ── Boutons bas ───────────────────────────────────────────────────── */
.tzf-clear-btn {
  width: 100%; padding: 7px 11px; border-radius: 9px;
  border: 1px solid rgba(239,68,68,0.25); background: rgba(239,68,68,0.05);
  color: #dc2626; font-size: 11.5px;
  cursor: pointer; text-align: left; margin-bottom: 6px;
}
.tzf-all-btn {
  width: 100%; padding: 7px 11px; border-radius: 9px;
  border: 1px solid rgba(15,23,42,0.10); background: transparent;
  color: #64748b; font-size: 11.5px; cursor: pointer; text-align: left;
}

/* ── Badge filtre actif ────────────────────────────────────────────── */
.tzf-badge {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 10.5px; font-weight: 600;
  color: #92400e;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 100px;
  padding: 2px 8px;
  margin-right: 4px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tzf-badge button {
  border: none; background: none;
  cursor: pointer; font-size: 10px;
  color: inherit; padding: 0 2px;
}
