/* ============================================================
   BULK FACE BLUR — wizard-gallery.css
   Step 2 — Auto-blur toggle, toolbar, and the image grid
   ============================================================ */

/* ══════════════════════════════════════════
   1. AUTO-BLUR-ALL TOGGLE — the headline feature, so it gets its
      own prominent card above the toolbar rather than living
      inside it.
   ══════════════════════════════════════════ */
.bb-autoblur{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--fb-brand-soft);
  border: 1.5px solid var(--fb-brand);
  margin-bottom: 18px;
}

.bb-switch{
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.bb-switch input{
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.bb-switch__track{
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--fb-line-strong);
  transition: background 0.18s ease;
}

.bb-switch__thumb{
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(26,26,34,0.25);
  transition: transform 0.18s ease;
}

.bb-switch input:checked + .bb-switch__track{ background: var(--fb-brand); }
.bb-switch input:checked + .bb-switch__track .bb-switch__thumb{ transform: translateX(20px); }

.bb-autoblur__text{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bb-autoblur__title{
  font-weight: 800;
  font-size: 16px;
  color: var(--fb-ink);
}

.bb-autoblur__hint{
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fb-brand-dark);
}


/* ══════════════════════════════════════════
   2. TOOLBAR
   ══════════════════════════════════════════ */
.bb-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.bb-toolbar__count{
  font-size: 15px;
  font-weight: 800;
  color: var(--fb-ink-soft);
}

.bb-toolbar__actions{ display: flex; gap: 8px; }

.bb-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--fb-line);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: var(--fb-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
}

.bb-chip svg{ width: 16px; height: 16px; }
.bb-chip:active{ background: var(--fb-bg); }
.bb-chip--danger{ color: var(--fb-error); }
.bb-chip--danger:active{ background: var(--fb-error-soft); }


/* ══════════════════════════════════════════
   3. IMAGE GRID
   ══════════════════════════════════════════ */
.bb-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (min-width: 480px){
  .bb-grid{ grid-template-columns: repeat(3, 1fr); gap: 12px; }
}


/* ══════════════════════════════════════════
   4. CARD
   ══════════════════════════════════════════ */
.bb-card{
  position: relative;
  background: #fff;
  border: 1.5px solid var(--fb-line);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.bb-card__remove{
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--fb-error);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(26,26,34,0.15);
}
.bb-card__remove svg{ width: 14px; height: 14px; }

.bb-card__thumbwrap{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 16px 16px,
    linear-gradient(-45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 16px 16px,
    linear-gradient(45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 16px 16px,
    linear-gradient(-45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 16px 16px,
    #fafafd;
}

.bb-card__thumb{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Per-card status badge — shown while this image is being scanned */
.bb-card__status{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(26,26,34,0.45);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}
.bb-card.is-scanning .bb-card__status{ display: flex; }

.bb-card__spinner{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: bbSpin 0.7s linear infinite;
  margin-right: 8px;
}
@keyframes bbSpin{ to{ transform: rotate(360deg); } }

/* Face-count badge — shown once a photo has been scanned */
.bb-card__badge{
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--fb-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.bb-card__badge.is-none{ background: var(--fb-ink-soft); }
.bb-card__badge.is-hidden{ display: none; }

.bb-card__name{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--fb-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bb-card__edit{
  width: 100%;
  height: 40px;
  border-radius: 9999px;
  border: none;
  background: var(--fb-brand);
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 2px 8px rgba(66,181,164,0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.bb-card__edit svg{ width: 15px; height: 15px; }
.bb-card__edit:active{ transform: scale(0.97); }

.bb-card__edit.is-edited{
  background: #fff;
  color: var(--fb-brand-dark);
  border: 1.5px solid var(--fb-brand);
  box-shadow: none;
}

@media (min-width: 768px){
  .bb-grid{ grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .bb-chip:hover{ border-color: var(--fb-brand); color: var(--fb-brand); }
  .bb-chip--danger:hover{ border-color: var(--fb-error); color: var(--fb-error); }
  .bb-card__edit:hover{
    background: var(--fb-brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(66,181,164,0.36);
  }
  .bb-card__edit.is-edited:hover{ background: var(--fb-brand-soft); transform: none; box-shadow: none; }
}
