/* ===== Classeur Zebradex CSS ===== */

/* ---------- Chip container (inspired by GitHub/Linear) ---------- */
.zbd-chip {
  background: #0e0f11;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  padding: .5rem .6rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.zbd-chip:hover {
  border-color: rgba(255, 255, 255, .18);
}

.chip-label {
  font-size: .75rem;
  letter-spacing: .02em;
  color: #a8b0b7;
}

/* Keep consistent control height inside chips */
#classeur-topbar .classeur-control {
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
}

/* Select style inside chip */
.chip-select {
  background: #0b0c0e;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding-right: 1.8rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right .5rem center;
  background-size: 12px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 16 10'%3E%3Cpath fill='%23ffffff' d='M1.646 1.646a.5.5 0 0 1 .708 0L8 7.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

.chip-select:focus {
  border-color: rgba(255, 255, 255, .20);
  box-shadow: 0 0 0 .15rem rgba(255, 255, 255, .10);
}

.chip-select option {
  background: #0b0c0e;
  color: #fff;
}

/* Dropdown button styled as chip input */
.btn-chip {
  --btn-border: rgba(255, 255, 255, .12);
  background: #0b0c0e;
  color: #fff;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .6rem;
}

.btn-chip:hover,
.btn-chip:focus {
  border-color: rgba(255, 255, 255, .20);
  box-shadow: 0 0 0 .15rem rgba(255, 255, 255, .10);
  color: #fff;
  background: #0b0c0e;
}

/* White caret on dark */
.btn-chip.dropdown-toggle {
  --bs-btn-dropdown-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath fill='%23ffffff' d='M1.646 1.646a.5.5 0 0 1 .708 0L8 7.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

/* Dropdown panel look */
#classeur-topbar .dropdown-menu {
  background: #0b0c0e !important;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
}

/* KPI badges inside the chip */
.kpi-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 .4rem;
  border-radius: 6px;
  background: #f5f7fa;
  color: #0b0c0e;
  font-weight: 700;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.kpi-pct {
  color: #9ed36a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Progress bars inside dropdowns (warning color kept) */
#classeur-topbar .progress-bar.bg-warning {
  background-color: var(--bs-warning) !important;
}

/* ---------- Segmented control (UI-only, responsive) ---------- */
#classeur-toolbar .segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .5rem;
}

#classeur-toolbar .btn-segment {
  --seg-bg: transparent;
  --seg-border: rgba(255, 255, 255, .35);
  --seg-active-bg: rgba(255, 255, 255, .12);
  --seg-active-border: rgba(255, 255, 255, .9);
  --seg-hover-bg: rgba(255, 255, 255, .08);
  --seg-focus-shadow: 0 0 0 .15rem rgba(255, 255, 255, .15);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 0;
  /* allow shrink */
  padding: .45rem .7rem;
  border: 1px solid var(--seg-border);
  border-radius: .5rem;
  background: var(--seg-bg);
  color: #fff;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
  outline: none;
}

#classeur-toolbar .btn-segment:hover {
  background: var(--seg-hover-bg);
}

#classeur-toolbar .btn-segment:focus-visible {
  box-shadow: var(--seg-focus-shadow);
}

#classeur-toolbar .btn-segment.active {
  background: var(--seg-active-bg);
  border-color: var(--seg-active-border);
}

#classeur-toolbar .btn-segment .bi {
  font-size: 1rem;
  opacity: .9;
}

#classeur-toolbar .btn-segment span {
  white-space: nowrap;
}

/* Toggle focus */
#toggle-visibility-wrapper .form-check-input:focus {
  box-shadow: 0 0 0 .15rem rgba(255, 255, 255, .12);
}

/* Grid spacing post-header */
.classeur-grid {
  margin-top: 1rem;
}

/* Responsive tweaks for very narrow screens */
@media (max-width: 400px) {
  #classeur-toolbar .segmented {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/*
CHANGES SUMMARY (UX/UI ONLY)
- Segmented control passe en auto-fit (minmax) → wrap propre, labels non cassés.
- Suppression des styles inutiles liés aux compteurs d’onglets.
- Aucun impact sur les chips “Affichage / Progression / Variantes / Prix”.
*/

/* 🛠️ Fix Layout Shift on Image Load */
.img-border-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 63 / 88;
  /* Standard Pokemon card ratio */
  background: #11151c;
  /* Placeholder color matching bg */
  border-radius: 10px;
  /* Match card radius */
  overflow: hidden;
}

.img-border-wrapper>img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}