/* AIForm_Table Core Styles: Filter Group, Search Cheat Sheet, Column Semi-Collapse & EAA Chips */

.aiform-filter-ig {
    display: table;
    width: 100%;
}

.aiform-filter-ig-input {
    display: table-cell;
    vertical-align: middle;
    width: 100%;
}

.aiform-filter-ig-btn {
    width: 1%;
    vertical-align: middle;
}

.btn-filter-help {
    min-width: auto;
    height: 30px;
    padding: 4px 8px;
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.smart-search-help {
    font-size: 14px;
    line-height: 22px;
}

.smart-search-help h4 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    font-weight: 600;
}

.smart-search-help table {
    margin-bottom: 0;
}

/* EAA Accessible Hidden Columns Chip Bar */
.aiform-hidden-cols-bar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px 0;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.aiform-hidden-cols-bar.is-active {
    display: flex;
}

.aiform-hidden-cols-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-right: 2px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.aiform-col-chip-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    min-height: 32px !important;
    min-width: 44px;
    padding: 4px 11px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #1e293b !important;
    background: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 16px !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aiform-col-chip-btn:hover {
    background: #f1f5f9 !important;
    border-color: #2271b1 !important;
    color: #0a4b78 !important;
}

.aiform-col-chip-btn.aiform-col-chip-filtered {
    background: #fff9e6 !important;
    border-color: #dba617 !important;
    color: #7c5800 !important;
}

.aiform-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.aiform-col-chip-btn:hover .aiform-chip-remove {
    background: #d63638;
    color: #ffffff;
}

.aiform-col-chip-all-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    min-height: 32px !important;
    padding: 4px 11px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #2271b1 !important;
    background: transparent !important;
    border: 1px dashed #2271b1 !important;
    border-radius: 16px !important;
    cursor: pointer;
}

.aiform-col-chip-all-btn:hover {
    background: #f0f6fc !important;
    border-style: solid !important;
}

/* TH Header & Semi-Collapsed Strip */
.aiform-th-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
}

.aiform-th-label {
    flex: 1 1 auto;
    min-width: 0;
}

.aiform-col-hide-btn {
    flex: 0 0 auto;
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #646970;
    opacity: 0.45;
    padding: 2px 4px;
    line-height: 1;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

th:hover .aiform-col-hide-btn,
.aiform-col-hide-btn:focus,
.aiform-col-hide-btn:focus-visible {
    opacity: 1;
    color: #d63638;
    background: rgba(214, 54, 56, 0.08);
}

.aiform-col-chip-btn:focus-visible,
.aiform-col-chip-all-btn:focus-visible,
.aiform-col-hide-btn:focus-visible,
.aiform-col-show-btn:focus-visible,
.aiform-col-show-all-btn:focus-visible {
    outline: 2px solid #2271b1 !important;
    outline-offset: 2px !important;
}

.aiform-th-collapsed {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.aiform-col-show-btn {
    padding: 2px 5px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    height: 24px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
}

table th.aiform-col-collapsed,
table td.aiform-col-collapsed {
    width: 1% !important;
    min-width: 28px !important;
    max-width: 30px !important;
    padding: 6px 2px !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    background-color: #f4f6f8 !important;
}

table th.aiform-col-collapsed > .aiform-th-expanded {
    display: none !important;
}

table th.aiform-col-collapsed > .aiform-th-collapsed {
    display: flex !important;
}

table td.aiform-col-collapsed > .aiform-td-content {
    display: none !important;
}

table td.aiform-col-collapsed::after {
    content: "·";
    color: #a7aaad;
    font-weight: 700;
    display: inline-block;
}

table th.aiform-col-collapsed.aiform-col-has-filter,
table td.aiform-col-collapsed.aiform-col-has-filter {
    background-color: #fff9e6 !important;
}

table th.aiform-col-collapsed.aiform-col-has-filter .aiform-col-show-btn {
    background-color: #fff3cd !important;
    border-color: #dba617 !important;
    color: #856404 !important;
}

/* Floating Top Tooltip (immune to .table-responsive overflow) */
#aiform-floating-tooltip {
    position: fixed;
    z-index: 999999;
    background: #1d2327;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    padding: 5px 9px;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    display: none;
}

#aiform-floating-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1d2327 transparent transparent transparent;
}