/* ==========================================================================
   slide-fx-picker.css — THIẾT KẾ LẠI HOÀN TOÀN bộ chọn hiệu ứng.
   ---------------------------------------------------------------------
   Bản cũ: 2 khối <select> nâng cấp thành 2 lưới icon MỞ ĐỘC LẬP, cùng lúc,
   ngay dưới thanh công cụ -> chiếm gần hết chiều ngang, nhìn rối và "vỡ"
   bố cục (đúng như ảnh chụp bị phản hồi là xấu).
   Bản mới: 1 THANH GỌN (tw-fx-bar) chỉ hiển thị 2 "viên thuốc" (pill) tóm
   tắt hiệu ứng đang chọn -> bấm vào mới mở ra ĐÚNG 1 HỘP THOẠI (tw-fx-modal)
   chia rõ 2 TAB "Chuyển slide" / "Nội dung xuất hiện", không bao giờ có 2
   lưới icon hiển thị chồng nhau cùng lúc nữa.
   ========================================================================== */

.tw-fx-native-select { display: none !important; }

/* ---------------- Thanh tóm tắt hiệu ứng (luôn hiển thị, rất gọn) ---------------- */
.tw-fx-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 16px;
}
.tw-fx-bar-pills { display: flex; align-items: stretch; gap: 8px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }

.tw-fx-bar-current {
  flex-basis: 100%;
  font-size: 10.5px; font-weight: 700; color: var(--tw-text-soft);
  margin-bottom: 1px;
}
.tw-fx-bar-current strong { color: var(--tw-primary-dark); font-weight: 800; }

.tw-fx-autoassign-btn { border-color: var(--tw-primary-light); color: var(--tw-primary-dark); }
.tw-fx-autoassign-btn:hover { border-color: var(--tw-primary); background: var(--tw-primary-soft); }

.tw-fx-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--tw-surface-alt);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius-sm);
  padding: 5px 9px 5px 7px;
  cursor: pointer;
  font: inherit; text-align: left;
  min-width: 0; width: 208px; flex: 0 0 auto;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.tw-fx-pill:hover { border-color: var(--tw-primary-light); background: var(--tw-surface); }
.tw-fx-pill:active { transform: scale(.98); }
.tw-fx-pill:focus-visible { outline: none; border-color: var(--tw-primary); box-shadow: var(--tw-focus-ring); }

.tw-fx-pill-icon {
  flex: none; width: 26px; height: 26px; border-radius: 7px;
  background: var(--tw-primary-soft); color: var(--tw-primary);
  display: flex; align-items: center; justify-content: center;
}
.tw-fx-pill-icon svg { width: 17px; height: 17px; }

.tw-fx-pill-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.tw-fx-pill-kind {
  font-size: 8.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--tw-text-soft);
}
.tw-fx-pill-name {
  font-size: 12px; font-weight: 800; color: var(--tw-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tw-fx-pill-caret { flex: none; width: 13px; height: 13px; color: var(--tw-text-soft); }

.tw-fx-shuffle-btn {
  height: 38px; padding: 0 12px;
  border-radius: var(--tw-radius-sm);
  border: 1px solid var(--tw-border);
  background: var(--tw-surface);
  color: var(--tw-text);
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  flex: 0 0 auto;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tw-fx-shuffle-btn:hover { border-color: var(--tw-primary); color: var(--tw-primary); background: var(--tw-primary-soft); }
.tw-fx-shuffle-btn svg { width: 13px; height: 13px; }

.tw-fx-count { font-size: 9.5px; font-weight: 700; color: var(--tw-text-soft); white-space: nowrap; padding-left: 2px; margin-left: auto; }

@media (max-width: 780px) {
  .tw-fx-bar { justify-content: center; }
  .tw-fx-bar-pills { flex-basis: 100%; justify-content: center; }
  .tw-fx-pill { width: 100%; max-width: 320px; }
  .tw-fx-count { flex-basis: 100%; text-align: center; margin-left: 0; }
}

/* ---------------- Hộp thoại chọn hiệu ứng: 2 tab trong CÙNG 1 modal ---------------- */
.tw-fx-modal { display: flex; flex-direction: column; max-height: 82vh; }
.tw-fx-modal .tw-modal-head { flex: none; }

.tw-fx-tabs {
  flex: none;
  display: flex;
  border-bottom: 1px solid var(--tw-border);
  background: var(--tw-surface-alt);
}
.tw-fx-tab {
  flex: 1 1 50%;
  padding: 12px 10px;
  text-align: center;
  font-size: 12px; font-weight: 800;
  color: var(--tw-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.tw-fx-tab:hover { color: var(--tw-primary-dark); }
.tw-fx-tab.is-active { color: var(--tw-primary); border-bottom-color: var(--tw-primary); background: var(--tw-surface); }

.tw-fx-slide-switch {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--tw-border);
  background: var(--tw-primary-soft);
}
.tw-fx-slide-switch[hidden] { display: none; }
.tw-fx-slide-switch-btn {
  flex: none; width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid var(--tw-border); background: var(--tw-surface);
  color: var(--tw-text); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .15s ease, color .15s ease, opacity .15s ease;
}
.tw-fx-slide-switch-btn svg { width: 15px; height: 15px; }
.tw-fx-slide-switch-btn:hover:not(:disabled) { border-color: var(--tw-primary); color: var(--tw-primary); }
.tw-fx-slide-switch-btn:disabled { opacity: .35; cursor: default; }
.tw-fx-slide-switch-label {
  font-size: 12px; font-weight: 800; color: var(--tw-primary-dark);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px;
}

.tw-fx-modal-body {
  flex: 1 1 auto; min-height: 0;
  padding: 14px 16px 6px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}

.tw-fx-search { flex: none; }
.tw-fx-search-input {
  width: 100%; background: var(--tw-surface-alt); border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius-sm); padding: 9px 12px; color: var(--tw-text); outline: none;
  font-size: 12.5px; font-family: inherit;
}
.tw-fx-search-input:focus { border-color: var(--tw-primary); background: var(--tw-surface); box-shadow: var(--tw-focus-ring); }

.tw-fx-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px;
  overflow-y: auto; padding: 2px 2px 14px;
  flex: 1 1 auto; min-height: 220px;
}
.tw-fx-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--tw-surface-alt); border: 1px solid var(--tw-border); border-radius: var(--tw-radius-sm);
  padding: 10px 6px 8px; cursor: pointer; color: var(--tw-text-muted); transition: all .12s ease;
}
.tw-fx-option:hover { background: var(--tw-primary-soft); border-color: var(--tw-primary-light); color: var(--tw-primary-dark); }
.tw-fx-option:focus-visible { outline: none; border-color: var(--tw-primary); box-shadow: var(--tw-focus-ring); }
.tw-fx-option.is-selected { background: var(--tw-primary-soft); border-color: var(--tw-primary); color: var(--tw-primary-dark); box-shadow: 0 0 0 1px var(--tw-primary) inset; }
.tw-fx-option[hidden] { display: none; }

.tw-fx-option-icon { width: 28px; height: 28px; }
.tw-fx-option-icon svg { width: 100%; height: 100%; }
.tw-fx-option-label {
  font-size: 10px; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.tw-fx-empty { padding: 30px 8px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--tw-text-soft); }

.tw-fx-modal-foot {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--tw-border);
  background: var(--tw-surface-alt);
}
.tw-fx-modal-count { font-size: 10.5px; font-weight: 700; color: var(--tw-text-soft); }
.tw-fx-modal-foot-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tw-fx-modal-foot .tw-fx-shuffle-btn { height: 33.5px; }

@media (max-width: 640px) {
  .tw-fx-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .tw-fx-modal { max-height: 90vh; }
}

@media (prefers-reduced-motion: reduce) {
  .tw-fx-pill, .tw-fx-tab, .tw-fx-option { transition: none; }
}