/* Styles for the Objects list page (artifacts/sb2artifact_list.html). */

/* #main-container has auto side margins and is a flex child of <body>, so it
   shrink-wraps to its content instead of using the available width. That
   capped the wide table at ~900px on any screen. Pin it to the full width
   (still bounded by its own max-width: 1300px). */
#main-container {
    width: 100%;
}

/* On a reasonably wide window there is room for every column header on one
   line; below that they may wrap. */
@media (min-width: 992px) {
    #objectTable thead th {
        white-space: nowrap;
    }
}

/* Breathing room between the DataTables controls (length menu + search box)
   and the table. The table clears both floated controls, so their own
   margin-bottom is what actually opens the gap. */
#objectTable_wrapper .dataTables_length,
#objectTable_wrapper .dataTables_filter {
    margin-bottom: 1.5rem;
}

/* Per-column search / filter row that sits under the column titles. */
#objectTable thead tr.column-filters th {
    padding: 4px 6px;
    font-weight: normal;
    vertical-align: top;
}

/* Full-width filter controls. Checkboxes inside the Object Type menu are
   excluded so Bootstrap's .form-check-input sizing (1em) still applies. */
#objectTable thead tr.column-filters input:not([type="checkbox"]),
#objectTable thead tr.column-filters .dropdown-toggle {
    width: 100%;
    min-width: 90px;
}

/* Every column filter is a Bootstrap dropdown (single-select for most columns,
   a checkbox menu for Object Type). data-bs-display="static" on the toggle skips
   Popper; the utility classes on the <ul> (w-100 / rounded-0 / shadow-none /
   border-top-0) keep it looking like part of the table. It stays absolutely
   positioned and overlays the rows below, so opening a menu does not change the
   filter row's height. */
#objectTable thead tr.column-filters .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    max-height: 260px;
    overflow-y: auto;
}

#objectTable thead tr.column-filters .dropdown-item:hover,
#objectTable thead tr.column-filters .dropdown-item:focus,
#objectTable thead tr.column-filters .dropdown-item:focus-within {
    background-color: #fdf1e8;
}

/* Currently-selected option: warm accent instead of Bootstrap's primary blue. */
#objectTable thead tr.column-filters .dropdown-item.active,
#objectTable thead tr.column-filters .dropdown-item:active {
    background-color: #d35400;
    color: #fff;
}

/* Object Type menu rows carry a checkbox alongside the label. */
#objectTable thead tr.column-filters .column-multi .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    white-space: normal;
}

#objectTable thead tr.column-filters .column-multi .dropdown-item input {
    margin: 0;
}

/* --- Active state -------------------------------------------------------- */
/* A column whose filter is set gets an accent border + tint so you can see
   at a glance which columns are narrowing the results. */
#objectTable thead tr.column-filters th.filter-active > input,
#objectTable thead tr.column-filters .filter-active .dropdown-toggle {
    border-color: #d35400;
    background-color: #fdf1e8;
    color: #a04000;
    font-weight: 500;
}

/* Focus: a thin, light-orange border in place of Bootstrap's thick blue glow. */
#objectTable thead tr.column-filters .form-control:focus,
#objectTable thead tr.column-filters .dropdown-toggle:focus,
#objectTable thead tr.column-filters .dropdown-toggle:focus-visible {
    border-color: #eaa96e;
    box-shadow: 0 0 0 1px rgba(234, 169, 110, 0.55);
    outline: none;
}

/* --- Active-filter summary bar (above the table) ----------------------- */
.active-filters {
    display: none;
}

.active-filters.has-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 1rem;
}

.active-filters .active-filters-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-right: 2px;
}

.active-filters .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #d35400;
    color: #fff;
    border-radius: 12px;
    padding: 2px 4px 2px 10px;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}

.active-filters .filter-chip-key {
    opacity: 0.75;
}

.active-filters .filter-chip-x {
    border: 0;
    /* The browser's default <button> padding (~6px each side) left only 4px
       for the 8px icon, so the grid centering below had no room to work
       with and the icon overflowed toward the box's start edge instead of
       centering. Zero it out. */
    padding: 0;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.active-filters .filter-chip-x:hover {
    background-color: rgba(255, 255, 255, 0.45);
}

.active-filters .active-filters-clear {
    font-size: 12px;
    font-weight: normal;
    text-decoration: none;
    color: #d35400;
    padding: 0 4px;
}
