/* =========================================================
   style_multi_select.css  (COMPLET - version améliorée)
   - Look plus "menu de gauche"
   - Liste des lots très lisible
   - Animations (ajout / suppression / focus)
   - Scrollbar propre
   ========================================================= */

/* Panneau principal */
#multi-select.multi-panel {
  position: fixed;
  top: 0px;
  left: 0px;
  width: var(--menu-width);
  height: 100vh;
  background-color: var(--bgnd-color);
  color: var(--text-color);
  padding: 14px 18px 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 18px rgba(0,0,0,0.30);
  z-index: 1100;
  font-family: "Segoe UI", Roboto, sans-serif;
  font-size: 13px;

  /* petite entrée douce */
  animation: multiPanelIn 220ms ease-out;
}

@keyframes multiPanelIn {
  from { transform: translateX(-10px); opacity: 0.6; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* Titre */
#multi-select .multi-title {
  margin: 4px 0 10px 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-color);
}

/* Bouton fermer */
#multi-select .multi-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

#multi-select .multi-close:hover {
  color: var(--highlight);
  transform: rotate(10deg) scale(1.05);
}

/* Sections */
#multi-select .multi-section {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* Résumé (lots / surface / prix / pm2) */
.multi-metrics div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

/* Sliders */
.multi-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-block {
  background-color: var(--lot-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.slider-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.slider-header .slider-value {
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.9;
}

/* Slider natif stylé avec les variables de thème */
.slider-block input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: var(--lot-color2);
  outline: none;
}

/* Track (Chrome/Safari/Edge) */
.slider-block input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--highlight), var(--lot-color2));
  opacity: 0.9;
}

/* Thumb (Chrome/Safari/Edge) */
.slider-block input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--highlight);
  border: 2px solid var(--bgnd-color);
  margin-top: -5px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: transform 120ms ease;
}

.slider-block input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

/* Track (Firefox) */
.slider-block input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: var(--lot-color2);
}

/* Thumb (Firefox) */
.slider-block input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--highlight);
  border: 2px solid var(--bgnd-color);
  cursor: pointer;
}

/* Option "Sur le même plateau" */
.multi-options {
  display: flex;
  justify-content: flex-start;
}

.toggle-pill {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background-color: var(--lot-color);
  color: var(--text-color);
  padding: 7px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: background-color 0.2s ease,
              color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              transform 0.15s ease;
}

.toggle-pill:hover {
  background-color: var(--lot-color2);
  transform: translateY(-1px);
}

.toggle-pill.active {
  background-color: var(--highlight);
  border-color: var(--highlight);
  color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.30);
}

/* =========================================================
   LISTE DES LOTS (super visible)
   ========================================================= */
.multi-list {
  max-height: 450px;
  overflow-y: auto;
  padding: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--highlight) transparent;
}

.multi-list::-webkit-scrollbar { width: 6px; }
.multi-list::-webkit-scrollbar-track { background: transparent; }
.multi-list::-webkit-scrollbar-thumb {
  background: var(--highlight);
  border-radius: 8px;
}

/* Liste sans puces */
#multi-lot-list {
  list-style: none;
  padding: 10px 0 0 0;
  margin: 0;
}

/* Item = "pill card" façon menu */
#multi-lot-list li.multi-lot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  /* background: var(--lot-color); */
  background: #04D9FF;
  /* border: 1px solid #04D9FF; */
  border-color: rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 8px 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-family: "Segoe UI", sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

#multi-lot-list li.multi-lot-item:hover {
  /* transform: translateY(-1px); */
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Label */
.multi-lot-label {
  flex: 1;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 0.85rem;
}

/* Bouton remove */
.multi-lot-remove{
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.multi-lot-remove:hover{
  color: red;
  background: rgba(0,194,255,0.10);
  transform: scale(1.06);
}

/* =========================================================
   ANIMATIONS AJOUT / SUPPRESSION (à déclencher via JS)
   - ajoute la classe .flash-in sur le <li> à l'ajout
   - ajoute la classe .flash-out sur le <li> à la suppression
   ========================================================= */
#multi-lot-list li.multi-lot-item.flash-in {
  animation: msFlashIn 480ms ease-out;
  border-color: var(--highlight);
  box-shadow: 0 0 0 2px rgba(0,194,255,0.25), 0 8px 18px rgba(0,0,0,0.20);
}

@keyframes msFlashIn {
  0%   { transform: translateY(0) scale(1.00); filter: brightness(1); }
  35%  { transform: translateY(-2px) scale(1.03); filter: brightness(1.25); }
  100% { transform: translateY(0) scale(1.00); filter: brightness(1); }
}

#multi-lot-list li.multi-lot-item.flash-out {
  animation: msFlashOut 360ms ease-out forwards;
}

@keyframes msFlashOut {
  0%   { opacity: 1;   transform: scale(1.00); }
  60%  { opacity: 0.5; transform: scale(0.98); }
  100% { opacity: 0;   transform: scale(0.96); }
}

/* Optionnel : quand un élément est “focus” (tu peux lui ajouter .is-active) */
#multi-lot-list li.multi-lot-item.is-active {
  border-color: var(--highlight);
  box-shadow: 0 0 0 2px rgba(0,194,255,0.22), 0 8px 18px rgba(0,0,0,0.18);
}

/* Bouton "Tout effacer" */
.ms-clear {
  margin-top: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--lot-selected);
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;

  transition: background-color 0.2s ease,
              color 0.2s ease,
              transform 0.2s ease,
              box-shadow 0.2s ease;
}

.ms-clear:hover {
  background-color: var(--lot-color2);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

/* =========================================================
   METRICS (résumé) – look plus clean
   ========================================================= */
.multi-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;

  background: var(--lot-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.metric-label {
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.95;
}

.metric-value {
  justify-self: end;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-unit {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
  color: var(--text-color);
}

/* Petite pulsation possible sur le résumé (optionnel via JS: #multi-info.pulse) */
#multi-info.pulse {
  animation: metricsPulse 520ms ease-out;
}

@keyframes metricsPulse {
  0%   { transform: scale(1);   filter: brightness(1); }
  35%  { transform: scale(1.01); filter: brightness(1.12); }
  100% { transform: scale(1);   filter: brightness(1); }
}

/* Apparition "douce" des lots dans la multi-list */
#multi-lot-list li.multi-lot-item {
  animation: msItemIn 220ms ease-out both;
}

@keyframes msItemIn {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
