/* =========================
   CURATION LAYOUT
========================= */

#curateLayout {
  display: flex;
  gap: 16px;
  height: calc(100vh - 140px);
}

/* LEFT SIDE (filters + table stack) */
#curateLeft {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* RIGHT SIDE */
#curateRight {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================
   FILTERS
========================= */

#curateFilters {
  display: flex;
  gap: 12px;
  align-items: stretch;

  flex-shrink: 0;
  max-height: 240px; /* default (table mode) */
}

/* expanded in filter mode */
#curateLayout.filteraction #curateFilters {
  max-height: 500px;
}

/* Each filter column */
.curateFrame {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;

  border: 1px solid #999;
  padding: 6px;

  display: flex;
  flex-direction: column;
}

/* Header */
.lblCurationFilter {
  font-weight: bold;
  margin-bottom: 6px;
}

/* Scrollable options */
.curationOptions {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* Individual option */
.curationOption {
  display: flex;
  align-items: center;

  gap: 6px;
  margin-bottom: 2px;

  /* 🔥 NEW */
  justify-content: space-between;
  white-space: nowrap;
}

.filterLabel {
  flex: 1;
}

.filterCount {
  opacity: 0.7;
  margin-left: 10px;
  margin-right: 6px; /* 🔥 add this */
  white-space: nowrap;
}

/* Button row */
.curationButtons {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* =========================
   TABLE
========================= */

#curateTable {
  flex: 1 1 auto;
  min-height: 0;

  display: flex;
  flex-direction: column;

  max-width: 900px;
  margin: 0 auto;

  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#curateTable.inactive {
  pointer-events: none;
  opacity: 0.6;
}

.curateTableHeader {
  display: grid;
  grid-template-columns: 80px minmax(350px, 1fr) 140px 90px 70px 70px 70px;
  font-weight: bold;
  border-bottom: 1px solid #999;
  padding: 6px;
  flex-shrink: 0;
}

.curateRow {
  display: grid;
  grid-template-columns: 80px minmax(350px, 1fr) 140px 90px 70px 70px 70px;
  padding: 6px;
  border-bottom: 1px solid #ddd;
  align-items: center;
}

#curateTableBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;

  padding-bottom: 12px; /* 🔥 add this */
}

.groupAlt {
  background-color: #f5f7fa;
}

/* new for select all and clear buttons */
.curation-table-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: fit-content;
  margin-left: 20px;
}

#selectButtons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 80px;
  margin-top: 50px; /* adjust to align with header */
}

/* =========================
   RIGHT PANEL
========================= */

#curateButtons {
  border: 1px solid #999;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#curateCounts {
  border: 1px solid #999;
  padding: 10px;
}

.countRow {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

/* =========================
   BUTTONS
========================= */

#curateButtons button {
  width: 100%;
}

#curateViewMode {
  margin: 10px 0;
  padding: 8px 0;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}

.viewToggle {
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 6px;
}
