/* Note: Content pane background defined in base.css */

.search-page-shell,
.search-page-shell * {
    box-sizing: border-box;
    font-family: var(--font-main) !important;
}

.search-page-shell {
    width: 100%;
    max-width: 1080px;
    margin: -65px auto 60px;
    padding: 0;
    position: relative;
    z-index: 10;
    direction: rtl;
}

.search-page-panel {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.search-page-search-section {
    width: 100%;
    max-width: 1080px;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 23px 70px 29px;
    min-height: 130px;
}

.search-page-search-title {
    display: none;
}

.search-page-search-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: end;
    justify-content: center;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    direction: rtl;
}

#searchByNumberBar {
    grid-template-areas: "division year case filter";
}

#searchByDateBar {
    grid-template-areas: "division year date filter";
}

#searchByNumberBar .search-page-field-case .search-page-primary-input {
    width: 100%;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px;
    margin: 0 !important;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    padding: 0 12px;
    background: rgba(242, 240, 239, 0.96) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16) !important;
    text-align: right;
    direction: rtl;
}

#searchByNumberBar .search-page-field-case .search-page-primary-input::placeholder {
    direction: rtl;
    text-align: right;
}

.search-page-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    direction: rtl;
}

.search-page-field-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-page-field-short,
.search-page-field-medium,
.search-page-field-wide {
    width: 100%;
    max-width: 100%;
}

.search-page-field-division {
    grid-area: division;
}

.search-page-field-year {
    grid-area: year;
}

.search-page-field-date {
    grid-area: date;
}

.search-page-field-case {
    grid-area: case;
}

.search-page-field-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: row-reverse;
    gap: 10px;
    color: #f3f3f3;
    min-height: 18px;
    font-size: 15px;
    font-weight: 500;
    line-height: 18px;
    text-align: right;
}

.search-page-field-label-text {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.search-page-field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #f2f0ef;
    flex: 0 0 18px;
}

.search-page-field-icon img,
.search-page-field-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.search-page-select,
.search-page-input {
    width: 100%;
    height: 100%;
    border: none !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #777;
    font-size: 15px;
    font-weight: 500;
    outline: none;
}

.search-page-select-wrap,
.search-page-primary-input,
.search-page-inline-search {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    background: rgba(242, 240, 239, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16) !important;
    overflow: hidden;
}

/* Grid placeholder styles in base.css */

.search-page-select-wrap {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
}

.search-page-select {
    position: absolute;
    inset: 0;
    margin: 0 !important;
    box-sizing: border-box;
    height: 50px !important;
    text-align: right;
    direction: rtl;
    cursor: pointer;
    padding: 0 12px 0 40px;
    -webkit-appearance: none;
    appearance: none;
}

select#ctl00_Main_DLstCaseYearP1.search-page-select,
select#ctl00_Main_DlstCaseYearP4.search-page-select,
select#ctl00_Main_DLstCaseYearP1,
select#ctl00_Main_DlstCaseYearP4 {
    height: 50px !important;
    border-radius: 12px !important;
    padding: 0 12px 0 40px !important;
    border: none !important;
    text-align: right !important;
    text-align-last: auto !important;
    box-shadow: none !important;
    background: transparent !important;
}

.search-page-select-wrap .search-page-select-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 10px;
    color: rgba(0, 0, 0, 0.4);
    flex: 0 0 16px;
    pointer-events: none;
}

.search-page-select-wrap .search-page-select-arrow svg {
    width: 16px;
    height: 10px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-page-hidden-select {
    display: none !important;
}

.search-page-select-wrap.search-page-select-wrap-combobox {
    overflow: visible;
}

.search-page-select-wrap.search-page-select-wrap-combobox .search-page-select-arrow {
    display: none;
}

.search-page-combobox {
    position: relative;
    width: 100%;
    height: 50px;
    border-radius: 12px;
    direction: rtl;
}

.search-page-combobox-button {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 12px 0 40px;
    border: none;
    border-radius: 12px;
    background: rgba(242, 240, 239, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    color: #777;
    font-size: 15px;
    font-weight: 500;
    text-align: right;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.search-page-combobox-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.25;
    max-height: 2.5em;
    text-align: right;
}

.search-page-combobox-button:focus {
    outline: none;
}

.search-page-combobox-static .search-page-combobox-button {
    border: none;
    background: transparent;
    box-shadow: none;
}

.search-page-combobox-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 10px;
    color: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.search-page-combobox-arrow svg {
    width: 16px;
    height: 10px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-page-combobox-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 9999;
    display: none;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: rgba(242, 240, 239, 0.98);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
}

.search-page-combobox-menu-no-search {
    padding: 6px;
}

.search-page-combobox.is-open .search-page-combobox-menu {
    display: block;
}

.search-page-combobox-options {
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
}

.search-page-combobox-options::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.search-page-combobox-options::-webkit-scrollbar-track {
    background: transparent;
}

.search-page-combobox-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.28);
    border-radius: 999px;
}

.search-page-combobox-options::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.search-page-combobox-option {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #777;
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    cursor: pointer;
    display: block;
}

.search-page-combobox-option:hover,
.search-page-combobox-option.is-selected {
    background: rgba(13, 66, 97, 0.1);
}

.search-page-combobox-empty {
    padding: 10px;
    color: #777;
    text-align: center;
    font-size: 13px;
}

.menu-search-court-wrap.search-page-select-wrap-combobox {
    overflow: visible;
}

.menu-search-court-wrap.search-page-select-wrap-combobox::before {
    display: none;
}

.menu-search-court-wrap.search-page-select-wrap-combobox .search-page-combobox {
    height: 100%;
}

.menu-search-court-wrap.search-page-select-wrap-combobox .search-page-combobox-button {
    height: 100%;
    background: rgba(242, 240, 239, 0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    color: #777;
}

.search-page-primary-input,
.search-page-input {
    text-align: right;
    direction: rtl;
}

.search-page-primary-input {
    display: block;
    height: 50px !important;
    min-height: 50px;
    padding: 0 16px;
    line-height: 50px;
}

.search-page-input::placeholder {
    color: #9a9a9a;
}

.search-page-field-filter {
    grid-area: filter;
}

.search-page-inline-search {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    width: 100%;
    direction: rtl;
}

.search-page-filter-input {
    flex: 1 1 auto;
    padding: 0 16px;
    white-space: nowrap;
}

.search-page-button {
    width: 49px;
    min-width: 49px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none !important;
    border-radius: 0 !important;
    background-color: var(--color-gold) !important;
    box-shadow: none !important;
    text-decoration: none !important;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.search-page-button img,
.search-page-button svg {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    transition: transform 0.2s ease;
}

.search-page-button:hover,
.search-page-button:focus {
    background-color: #b49f79 !important;
}

.search-page-button:hover img,
.search-page-button:hover svg,
.search-page-button:focus img,
.search-page-button:focus svg {
    transform: scale(1.08);
}

.search-page-submit-button {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
}

/* Base results panel styles in base.css; page-specific addition below */
.search-page-results {
    position: relative;
}

/* Results title styles in base.css */

.search-page-results-stack {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.search-page-results-empty {
    display: none;
    margin-top: 16px;
    color: var(--color-blue);
    font-size: 15px;
    font-weight: 500;
    text-align: right;
}

.search-page-no-results {
    margin-top: 16px;
    color: var(--color-blue);
    font-size: 16px;
    font-weight: 600;
    text-align: right;
}

.search-page-hidden {
    display: none;
}

/* Loading overlay base styles in base.css */

.search-page-results.is-loading .search-page-results-loading {
    display: flex;
}

/* Spinner uses shared .alpha-spinner from base.css; keep page-specific animation name for safety */
.search-page-results-loading .alpha-spinner {
    animation-name: shared-spin;
}

.search-page-results.is-loading .search-page-grid-placeholder,
.search-page-results.is-loading .search-page-no-results,
.search-page-results.is-loading .grid,
.search-page-results.is-loading .principles-grid-table {
    opacity: 0.25;
    pointer-events: none;
}

@media (max-width: 1080px) {
    .search-page-shell {
        padding: 0 20px;
    }

    .search-page-search-section {
        min-height: 220px;
        padding: 21px 24px;
    }

    .search-page-search-bar {
        grid-template-columns: repeat(2, minmax(0, 220px));
        max-width: 460px;
        justify-content: center;
    }

    #searchByNumberBar {
        grid-template-areas:
            "division year"
            "case filter";
    }

    #searchByDateBar {
        grid-template-areas:
            "division year"
            "date filter";
    }

    .search-page-field-case .search-page-field-label,
    .search-page-field-date .search-page-field-label,
    .search-page-field-filter .search-page-field-label {
        color:#777;
    }

    .search-page-field-case .search-page-field-icon img,
    .search-page-field-date .search-page-field-icon img,
    .search-page-field-filter .search-page-field-icon img {
        filter: brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(0%) hue-rotate(155deg) brightness(96%) contrast(90%);
    }
}

@media (max-width: 768px) {
    .search-page-shell {
        margin: -40px auto 40px;
        padding: 0 20px;
    }

    .search-page-search-section {
        padding: 20px;
        min-height: auto;
    }

    .search-page-search-bar {
        grid-template-columns: 1fr;
        gap: 18px;
        max-width: 100%;
        justify-content: center;
    }

    .search-page-field-short,
    .search-page-field-medium,
    .search-page-field-wide {
        width: 100%;
    }

    #searchByNumberBar {
        grid-template-areas:
            "division"
            "year"
            "case"
            "filter";
    }

    #searchByDateBar {
        grid-template-areas:
            "division"
            "year"
            "date"
            "filter";
    }

    .search-page-search-bar .search-page-field .search-page-field-label {
        color: #777;
    }

    .search-page-search-bar .search-page-field .search-page-field-icon img,
    .search-page-search-bar .search-page-field .search-page-field-icon svg {
        filter: brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(0%) hue-rotate(155deg) brightness(96%) contrast(90%);
    }

    .search-page-search-bar .search-page-field-division .search-page-field-label {
        color: #f3f3f3;
    }

    .search-page-search-bar .search-page-field-division .search-page-field-icon img,
    .search-page-search-bar .search-page-field-division .search-page-field-icon svg {
        filter: none;
    }

    .search-page-field-label {
        font-size: 14px;
        line-height: 18px;
    }

    .search-page-select-wrap,
    .search-page-primary-input,
    .search-page-inline-search {
        height: 50px;
    }

    .search-page-select,
    .search-page-input {
        font-size: 15px;
    }

    .search-page-button {
        width: 49px;
        min-width: 49px;
    }

    /* Results padding at mobile now in base.css */

    .search-page-results-title {
        font-size: 22px;
    }
}
