/*---*\
    Ninja Tables
    Sitewide customizations for FooTable / Ninja Tables markup

    KEY FEATURES:
    - Search/filter row: primary (yellow) by default; secondary (black) on .bg-yellow
    - Dark header row, zebra body rows
    - Horizontal scroll on small screens

    IMPLEMENTATION NOTES:
    - Targets .footable_parent / .foo-table / .footable-filtering from the plugin
    - Loaded via fx_ninja (depends on fx_ninja_plugin)
    - .bg-yellow search button uses --color-text-dark-gray against the black filter bar
\*---*/

.footable_parent.ninja_table_wrapper {
    margin: 32px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
    border-radius: var(--radius-button);
}

.footable_parent.ninja_table_wrapper:not(:last-child) {
    margin-bottom: 32px;
}

.footable_parent .foo-table,
.footable_parent table.foo-table {
    width: 100%;
    min-width: 664px;
    margin: 0 !important;
    border: 0 !important;
    border-collapse: collapse;
    border-radius: 0 !important;
    font-family: var(--font-body);
    font-size: 15px !important;
    line-height: 1.4;
}

.footable_parent .foo-table thead tr.footable-filtering > th {
    padding: 12px 16px !important;
    border: 0 !important;
    border-top-left-radius: var(--radius-card);
    border-top-right-radius: var(--radius-card);
    background-color: var(--color-primary) !important;
    vertical-align: middle;
}

.footable_parent .foo-table thead tr.footable-filtering .form-inline {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.footable_parent .foo-table thead tr.footable-filtering .form-group {
    margin: 0;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group {
    display: flex;
    align-items: stretch;
    width: auto;
    max-width: 100%;
}

.footable_parent .foo-table thead tr.footable-filtering .form-control {
    width: 180px;
    max-width: 50vw;
    height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background-color: var(--color-surface-white);
    color: var(--color-secondary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.2;
}

.footable_parent .foo-table thead tr.footable-filtering .form-control:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group-btn {
    display: flex;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: #404040;
    background-image: none;
    color: var(--color-text-inverse);
    box-shadow: none;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn.dropdown-toggle {
    color: var(--color-secondary);
    background-color: var(--color-surface-white);

    display: none;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn::before,
.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn::after {
    display: none;
    content: none;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn:hover,
.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn:focus-visible {
    background-color: var(--color-secondary);
    color: var(--color-text-inverse);
    opacity: 0.9;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn + .btn {
    margin-top: 0;
    margin-left: 0;
    border-left: 1px solid rgb(255 255 255 / 20%);
}

.footable_parent .foo-table thead tr.footable-filtering .caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    vertical-align: middle;
}

.footable_parent .foo-table thead tr.footable-filtering .fooicon-search::before {
    display: block;
    content: "\e911";
    font-family: 'kelly-tractor-icons' !important;
    background-image: none;
    border: 0;
    box-shadow: none;
    transform: none;
    font-size: 14px;
}

.footable_parent .foo-table thead tr:not(.footable-filtering) > th {
    padding: 14px 20px !important;
    border: 0 !important;
    background-color: var(--color-text-dark-gray) !important;
    color: var(--color-text-inverse) !important;
    font-family: var(--font-heading);
    font-size: 16px !important;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
}

.footable_parent .foo-table tbody tr td {
    padding: 12px 20px !important;
    border: 0 !important;
    border-left: 0 !important;
    color: var(--color-paragraph-content);
    font-size: 15px;
    text-align: left;
    vertical-align: middle;
}

.footable_parent .foo-table tbody tr:nth-child(odd) td {
    background-color: var(--color-surface-search-hover) !important;
}

.footable_parent .foo-table tbody tr:nth-child(even) td {
    background-color: var(--color-surface-white) !important;
}

.bg-white .footable_parent .foo-table tbody tr:nth-child(even) td {
    background-color: var(--color-surface-gray) !important;
}

.bg-yellow .footable_parent .foo-table thead tr.footable-filtering > th {
    padding: 13px 11px !important;
    border-top-left-radius: var(--radius-card);
    border-top-right-radius: var(--radius-card);
    background-color: var(--color-secondary) !important;
}

.bg-yellow .footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn {
    background-color: var(--color-text-dark-gray);
    color: var(--color-text-inverse);
}

.bg-yellow .footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn.dropdown-toggle {
    background-color: var(--color-surface-white);
    color: var(--color-secondary);
}

.bg-yellow .footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn:hover,
.bg-yellow .footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn:focus-visible {
    background-color: var(--color-text-dark-gray);
    color: var(--color-text-inverse);
}

.bg-yellow .footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn.dropdown-toggle:hover,
.bg-yellow .footable_parent .foo-table thead tr.footable-filtering .input-group-btn .btn.dropdown-toggle:focus-visible {
    background-color: var(--color-surface-white);
    color: var(--color-secondary);
}

.bg-yellow .footable_parent .foo-table thead tr:not(.footable-filtering) > th {
    padding: 16px 11px !important;
}

@media (min-width: 768px) {
    .footable_parent.ninja_table_wrapper {
        margin-top: 32px;
    }

    .footable_parent .foo-table,
    .footable_parent table.foo-table {
        font-size: 16px !important;
    }

    .footable_parent .foo-table thead tr:not(.footable-filtering) > th {
        font-size: 20px !important;
    }

    .footable_parent .foo-table tbody tr td {
        font-size: 16px;
    }
}

@media (min-width: 1200px) {
    .footable_parent .foo-table,
    .footable_parent table.foo-table {
        min-width: 0;
        font-size: 18px !important;
    }

    .footable_parent .foo-table thead tr:not(.footable-filtering) > th {
        padding: 14px 26px !important;
        font-size: 24px !important;
    }

    .footable_parent .foo-table tbody tr td {
        padding: 12px 26px !important;
        font-size: 18px;
    }

    .footable_parent .foo-table thead tr.footable-filtering .form-control {
        width: 220px;
        font-size: 16px;
    }
}


@media (max-width: 767px) {
    .footable_parent.ninja_table_wrapper {
        padding-bottom: 18px;
        scrollbar-width: thin;
        scrollbar-color: var(--color-secondary) var(--color-surface-white);
    }

    .footable_parent.ninja_table_wrapper::-webkit-scrollbar {
        height: 15px;
    }

    .footable_parent.ninja_table_wrapper::-webkit-scrollbar-track {
        background: var(--color-surface-white);
    }

    .footable_parent.ninja_table_wrapper::-webkit-scrollbar-thumb {
        border: 3px solid var(--color-surface-white);
        border-radius: 8px;
        background: var(--color-secondary);
    }

    .footable_parent .foo-table,
    .footable_parent table.foo-table {
        min-width: 664px;
    }
}

.footable_parent .foo-table .form-group.footable-filtering-search .input-group-btn > button {
    height: 38px !important;
}

.footable_parent .foo-table thead tr.footable-filtering .input-group {
    border-radius: 4px;
    overflow: hidden;
}

.footable-filtering-search p:is(:empty) {
    display: none;
}

.footable .pagination > li {
    padding: 0;
}

.footable .pagination > li:before {
    display: none;
}

.footable .pagination > li > a,
.footable .pagination > li > span {
    float: none;
}

.foo-table tbody tr td a {
    display: inline-block;
}