/* ============================================================
   DynaGrid popups (kartik-v/yii2-dynagrid)

   Styles the "Personalize Grid Configuration" modal (gear icon
   in the grid toolbar) and the named filter/sort settings modal
   (funnel/sort icons), without touching the vendor package.

   DynaGrid always suffixes its modal ids "-grid-modal",
   "-filter-modal" and "-sort-modal" (see kartik\dynagrid\DynaGrid::
   init(), $this->_gridModalId / _filterModalId / _sortModalId) on
   top of the per-grid base id, so attribute selectors on that
   suffix scope every rule below to exactly these three modals —
   nothing here leaks into other Bootstrap modals (e.g. the
   KrajeeDialog confirm/alert boxes used elsewhere in the app).
   ============================================================ */

.modal[id$="-grid-modal"] .modal-content,
.modal[id$="-filter-modal"] .modal-content,
.modal[id$="-sort-modal"] .modal-content {
  border: none;
  border-radius: var(--bs-border-radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.modal[id$="-grid-modal"] .modal-header,
.modal[id$="-filter-modal"] .modal-header,
.modal[id$="-sort-modal"] .modal-header {
  background: var(--la-bg-subtle);
  border-bottom: 2px solid var(--la-accent-teal);
  padding: 16px 24px;
}

.modal[id$="-grid-modal"] .modal-title,
.modal[id$="-filter-modal"] .modal-title,
.modal[id$="-sort-modal"] .modal-title {
  color: var(--la-text-heading);
  font-size: 17px;
  font-weight: 700;
}

.modal[id$="-grid-modal"] .modal-body,
.modal[id$="-filter-modal"] .modal-body,
.modal[id$="-sort-modal"] .modal-body {
  padding: 22px 24px;
  background: var(--la-bg-subtle);
}

.modal[id$="-grid-modal"] .modal-footer,
.modal[id$="-filter-modal"] .modal-footer,
.modal[id$="-sort-modal"] .modal-footer {
  border-top: 1px solid var(--la-border);
  padding: 14px 24px;
  background: var(--la-bg-surface);
}

/* ─── Column configuration form (page size / theme / filter / sort) ─ */

.dynagrid-config-form .form-group {
  padding-top: 0;
}

.dynagrid-column-label {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--la-text-heading);
  padding: 0 0 8px;
  margin: 18px 0 14px;
  border: none;
  border-bottom: 2px solid var(--la-border);
}

/* ─── Visible / hidden column lists ─────────────────────────────── */

.sortable.list {
  background: var(--la-bg-surface);
  border: 1px solid var(--la-border);
  border-radius: var(--bs-border-radius);
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sortable.list li {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 3px 0;
  border-radius: 6px;
  background: var(--la-bg-surface);
  border: 1px solid transparent;
  font-size: 13px;
}

.sortable.cursor-move li:not(.disabled) {
  cursor: grab;
}

.sortable.list li:not(.disabled):hover {
  background: var(--la-bg-hover);
  border-color: var(--la-border);
}

.sortable.list li:not(.disabled)::before {
  content: "\22ee\22ee";
  letter-spacing: -2px;
  color: var(--la-text-muted);
  font-size: 12px;
  flex: none;
}

.sortable.list li .icon-visible-column,
.sortable.list li .icon-hidden-column {
  color: var(--la-accent-teal);
  flex: none;
}

/* The first item in each list is a disabled "Visible Columns" / "Hidden
   / Fixed Columns" header row (kartik\dynagrid\DynaGrid::$sortableHeader) —
   restyle it as a section label instead of a Bootstrap alert. */
.sortable.list li.disabled.dynagrid-sortable-header {
  background: linear-gradient(135deg, var(--la-primary-dark) 0%, var(--la-primary) 100%);
  color: #fff;
  border: none;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  justify-content: center;
}

.dynagrid-sortable-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--la-thead-from) 0%, var(--la-thead-to) 100%);
  color: var(--la-thead-color);
  font-size: 14px;
}

/* Vertically center the separator badge against the two column lists —
   `.row` is already a flex container (Bootstrap 5), so the column only
   needs to become a flex box itself to center its own content. Scoped to
   `.dynagrid-config-form` so it can't affect other `.col-sm-2.text-center`
   usages elsewhere in the app. */
.dynagrid-config-form .col-sm-2.text-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Named filter/sort settings popup (save/select a preset) ──────── */

.dynagrid-detail-list {
  margin-top: 4px;
}

.dynagrid-settings-text ul {
  background: var(--la-bg-subtle);
  border-color: var(--la-border);
}
