/* ============================================================
   VisionCore · 11 Gallery final — match redesign mock exactly
   
   Targets the NEW markup produced by:
   - js/features/gallery/sidebar.js  (replaced version)
   - js/app-init.js                  (buildTagOverlayHtml — patched)

   Adds:
   - Thumbnail/initial-block in every folder row
   - Brand-pink LoRA name highlight
   - PICK / REVIEW / DROP color-coded chips on gallery cards
   ============================================================ */

/* ============================================================
   SIDEBAR · new card-style folder row
   ============================================================ */
.folder-item {
  padding: 8px !important;
}

.folder-item-card {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: flex-start !important;
}

.folder-item-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--vc-r-sm);
  overflow: hidden;
  background: var(--vc-card);
  border: 1px solid var(--vc-line);
  flex-shrink: 0;
  position: relative;
}
.folder-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.folder-item-thumb-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  position: relative;
  overflow: hidden;
}
.folder-item-thumb-initial::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
}
.folder-item-thumb-initial span {
  position: relative;
  font-family: var(--vc-font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: rgba(255,255,255,.92);
  z-index: 1;
}

/* Body */
.folder-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.folder-item-primary {
  display: block !important;
  font-family: var(--vc-font-sans) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--vc-ink-2) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: -.005em !important;
}
.folder-item.active .folder-item-primary {
  color: #fff !important;
}

.folder-item-lora {
  display: block;
  font-family: var(--vc-font-sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--vc-brand-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.folder-item-date,
.folder-item-count {
  display: block;
  font-family: var(--vc-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--vc-ink-4);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-item-count {
  margin-top: 3px;
}

.folder-item-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* Active state — brand pink wash on entire card */
.folder-item.active {
  background: var(--vc-brand-bg) !important;
  border-color: var(--vc-brand-line) !important;
}
.folder-item.active .folder-item-thumb {
  border-color: var(--vc-brand-line);
}

.folder-section-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 8px);
  min-height: 36px;
  margin: 8px 4px 4px;
  padding: 0 12px;
  border-radius: var(--vc-r-md);
  border: 1px solid var(--vc-line);
  background: rgba(255,255,255,.035);
  color: var(--vc-ink-3);
  font-family: var(--vc-font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--vc-fast);
}
.folder-section-load-more:hover {
  border-color: var(--vc-brand-line);
  background: var(--vc-brand-bg);
  color: var(--vc-brand-soft);
}

/* Formatted name fallback (legacy/header) */
.folder-name-formatted {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.folder-name-checkpoint {
  font-family: var(--vc-font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--vc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-name-lora {
  font-family: var(--vc-font-sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--vc-brand-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-name-date {
  font-family: var(--vc-font-mono);
  font-size: 10.5px;
  color: var(--vc-ink-4);
}

.header-name-formatted {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.header-name-checkpoint {
  font-family: var(--vc-font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--vc-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}
.header-name-lora {
  font-family: var(--vc-font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--vc-brand-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

/* ============================================================
   GALLERY CARD · semantic chip colors (PICK / REVIEW / DROP)
   Activated by the patched buildTagOverlayHtml that emits
   data-bucket="pick|review|drop" on .image-tag-chip
   ============================================================ */
.image-tag-chip[data-bucket="pick"],
.image-tag-chip.pick {
  background: var(--vc-success-bg) !important;
  border-color: rgba(0,230,118,.32) !important;
  color: var(--vc-success-soft) !important;
}
.image-tag-chip[data-bucket="review"],
.image-tag-chip.review {
  background: var(--vc-warn-bg) !important;
  border-color: rgba(240,152,25,.32) !important;
  color: var(--vc-warn-soft) !important;
}
.image-tag-chip[data-bucket="drop"],
.image-tag-chip.drop {
  background: var(--vc-danger-bg) !important;
  border-color: rgba(255,68,68,.32) !important;
  color: var(--vc-danger-soft) !important;
}
.image-tag-chip[data-bucket="delete"],
.image-tag-chip[data-bucket="monster"] {
  background: var(--vc-danger-bg) !important;
  border-color: rgba(255,68,68,.32) !important;
  color: var(--vc-danger-soft) !important;
}
.image-tag-chip[data-bucket="regen"],
.image-tag-chip[data-bucket="schema"] {
  background: var(--vc-warn-bg) !important;
  border-color: rgba(240,152,25,.32) !important;
  color: var(--vc-warn-soft) !important;
}
.image-tag-chip[data-bucket="unclassified"],
.image-tag-chip.subtle {
  background: rgba(10,10,10,.78) !important;
  color: var(--vc-ink-4) !important;
  border-color: rgba(255,255,255,.06) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* ============================================================
   FORCE: kill any remaining legacy inline styles in folder rows
   (defensive — in case both old and new sidebar.js coexist)
   ============================================================ */
.folder-item [style*="color:#ff2a5f"] { color: var(--vc-brand-soft) !important; }
.folder-item [style*="word-break"] {
  word-break: normal !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
