/* Note: CSS variables and content pane background defined in base.css */

body.text-search-page-layout td[id$='ContentPane'] {
    background-color: var(--color-offwhite, #F2F0EF) !important;
    background-image: none !important;
}

.text-search-page,
.text-search-page *,
.text-search-shell,
.text-search-shell * {
    box-sizing: border-box;
    font-family: var(--font-main) !important;
}

.text-search-shell {
    width: 100%;
    max-width: 1080px;
    margin: -65px auto 60px;
    padding: 0;
    position: relative;
    z-index: 10;
    direction: rtl;
}

.text-search-panel {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.text-search-search-section {
    width: 100%;
    margin: 0;
    padding: 23px 70px 29px;
    height: auto;
}

#textSearchBar.text-search-search-bar {
    min-height: 78px;
    padding: 0;
    gap: 14px;
    direction: rtl;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: flex-start;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

#textSearchBar .text-search-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    height: auto;
    background: transparent;
    direction: ltr;
}

#textSearchBar .text-search-field-wide {
    flex: 1 1 auto;
}

#textSearchBar .text-search-field-short {
    flex: 0 0 220px;
}

#textSearchBar .text-search-option-field {
    flex: 0 0 220px;
}

.text-search-field-label,
.text-search-divisions-title {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: right;
    direction: rtl;
    padding: 0 8px;
}

#textSearchBar .text-search-input,
#textSearchBar .text-search-any-wrap,
#textSearchBar .text-search-select {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: none !important;
    border-radius: 12px;
    background: rgba(242, 240, 239, 0.96) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16) !important;
    color: var(--color-blue);
    font-size: 15px;
    font-weight: 500;
    outline: none;
}

#textSearchBar .text-search-input {
    text-align: right;
    direction: rtl;
}

#textSearchBar .text-search-select {
    text-align: right;
    direction: rtl;
}

#textSearchBar .text-search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

#textSearchBar .text-search-select-wrap {
    width: 100%;
}

#textSearchBar .text-search-any-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
}

#textSearchBar .text-search-any-wrap input[type=checkbox] {
    order: 1;
    position: static;
    opacity: 1;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-blue);
    cursor: pointer;
}

#textSearchBar .text-search-any-wrap label {
    order: 2;
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin: 0;
    color: var(--color-blue);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    direction: rtl;
    cursor: pointer;
}

#textSearchBar .text-search-any-wrap label::before {
    content: none;
}

#textSearchBar .text-search-any-wrap label::after {
    content: none;
}

#textSearchBar .text-search-button {
    flex: 0 0 56px;
    width: 56px !important;
    height: 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 12px !important;
    background-color: var(--color-gold) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#textSearchBar .text-search-button svg {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    transition: transform 0.2s ease;
}

#textSearchBar .text-search-button:hover,
#textSearchBar .text-search-button:focus {
    background-color: #b49f79 !important;
}

#textSearchBar .text-search-button:hover svg,
#textSearchBar .text-search-button:focus svg {
    transform: scale(1.08);
}

.text-search-divisions-panel {
    margin-top: 18px;
}

.text-search-divisions-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    direction: rtl;
}

.text-search-divisions-list > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(242, 240, 239, 0.96);
    color: var(--color-blue);
}

.text-search-divisions-list input[type=checkbox] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--color-blue);
}

.text-search-divisions-list label {
    margin: 0;
    color: var(--color-blue);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
}

.text-search-hidden {
    display: none;
}

/* Results title styles in base.css */

/* Results panel styles in base.css */

/* Grid placeholder styles in base.css */

.text-search-results.is-empty .principles-grid-table,
.text-search-results.is-empty table[id*='GridText'],
.text-search-results.is-empty .datagrid,
.text-search-results.is-empty .datagridHeader,
.text-search-results.is-empty .datagridItem,
.text-search-results.is-empty .datagridAlternate {
    display: none !important;
}

@media (max-width: 1023px) {
    .text-search-shell {
        width: calc(100% - 40px);
        margin: -50px auto 50px;
        padding: 0;
    }

    .text-search-search-section {
        padding: 24px 20px;
    }

    #textSearchBar.text-search-search-bar {
        min-height: 0;
        flex-wrap: wrap;
        gap: 16px;
    }

    #textSearchBar .text-search-field,
    #textSearchBar .text-search-field-wide,
    #textSearchBar .text-search-field-short,
    #textSearchBar .text-search-option-field {
        flex: 1 1 100%;
        min-width: 100%;
    }

    #textSearchBar .text-search-button {
        width: 100%;
        height: 50px !important;
        flex: 1 1 100%;
    }

    .text-search-divisions-list {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .text-search-shell {
        margin: -40px auto 40px;
        padding: 0px;
    }

    .text-search-search-section {
        padding: 20px;
    }

    #textSearchBar.text-search-search-bar {
        min-height: 0;
        flex-wrap: wrap;
    }

    #textSearchBar .text-search-field,
    #textSearchBar .text-search-field-wide,
    #textSearchBar .text-search-field-short {
        flex: 1 1 100%;
        min-width: 100%;
    }

    #textSearchBar .text-search-field:nth-of-type(n+2) .text-search-field-label {
        color: #777;
    }

    #textSearchBar .text-search-field:nth-of-type(n+2) .text-search-field-label svg,
    #textSearchBar .text-search-field:nth-of-type(n+2) .text-search-field-label img {
        color: #777;
        filter: brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(0%) hue-rotate(155deg) brightness(96%) contrast(90%);
    }

    #textSearchBar .text-search-button {
        width: 100%;
        flex: 1 1 100%;
    }

    .text-search-divisions-list {
        gap: 8px;
        flex-wrap: wrap;
    }

    .text-search-divisions-list > span {
        width: 100%;
        justify-content: flex-end;
    }

    /* Results padding at mobile now in base.css */

    .text-search-results-title {
        font-size: 22px;
    }
}
