/* =========================================================
   5TV ADVANCED SEARCH
   ========================================================= */

.ftv-search-page {
    min-height: 75vh;
    padding: 34px 0 64px;
}

.ftv-search-shell {
    width: min(1480px, calc(100% - 40px));
    margin: 0 auto;
}


/* Header */

.ftv-search-header {
    margin-bottom: 22px;
}

.ftv-search-header__eyebrow {
    display: block;
    margin-bottom: 4px;

    color: #969ca6;

    font-size: 10px;
    font-weight: 700;
}

.ftv-search-header h1 {
    margin: 0;

    color: #f5f5f5;

    font-size: clamp(27px, 2.7vw, 40px);
    font-weight: 900;
}

.ftv-search-header__accent {
    display: block;

    width: 42px;
    height: 3px;

    margin-top: 8px;

    border-radius: 999px;

    background: rgba(230,185,79,.68);
}


/* Search bar */

.ftv-search-form {
    margin-bottom: 30px;
}

.ftv-search-mainbar {
    display: flex;
    gap: 9px;

    padding: 8px;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;

    background: rgba(255,255,255,.035);

    box-shadow:
        0 10px 28px rgba(0,0,0,.12);
}

.ftv-search-input-wrap {
    position: relative;

    flex: 1;
    min-width: 0;
}

.ftv-search-input-wrap svg {
    position: absolute;

    top: 50%;
    right: 14px;

    width: 19px;
    height: 19px;

    transform: translateY(-50%);

    color: #818791;

    pointer-events: none;
}

.ftv-search-input-wrap input {
    width: 100%;
    height: 46px;

    padding: 0 44px 0 14px;

    border: 0;
    outline: 0;

    border-radius: 10px;

    background: rgba(5,7,9,.45);

    color: #fff;

    font-family: inherit;
    font-size: 13px;
}

.ftv-search-input-wrap input::placeholder {
    color: #747b85;
}

.ftv-search-submit,
.ftv-search-filter-toggle,
.ftv-search-apply {
    border: 0;

    border-radius: 10px;

    font-family: inherit;
    font-weight: 800;

    cursor: pointer;
}

.ftv-search-submit {
    min-width: 86px;

    background: #e6b94f;
    color: #171717;
}

.ftv-search-filter-toggle {
    display: none;
}


/* Desktop filters */

.ftv-search-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;

    margin-top: 14px;

    padding: 17px;

    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;

    background: rgba(255,255,255,.025);
}

.ftv-search-filters__mobile-head {
    display: none;
}

.ftv-filter-group__label {
    display: block;

    margin-bottom: 8px;

    color: #c5c8cd;

    font-size: 11px;
    font-weight: 800;
}

.ftv-filter-options {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;
}

.ftv-filter-chip {
    cursor: pointer;
}

.ftv-filter-chip input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}

.ftv-filter-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 29px;

    padding: 0 10px;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;

    background: rgba(255,255,255,.025);

    color: #9ea4ad;

    font-size: 10px;
    font-weight: 650;

    transition:
        background .16s ease,
        border-color .16s ease,
        color .16s ease;
}

.ftv-filter-chip:hover span {
    border-color: rgba(230,185,79,.32);
    color: #d7d9dd;
}

.ftv-filter-chip input:checked + span {
    border-color: rgba(230,185,79,.58);

    background: rgba(230,185,79,.12);

    color: #e6b94f;
}

.ftv-search-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;

    padding-top: 3px;
}

.ftv-search-clear {
    color: #969ca6;

    font-size: 10px;
    text-decoration: none;
}

.ftv-search-apply {
    min-height: 35px;

    padding: 0 16px;

    background: #e6b94f;
    color: #171717;

    font-size: 10px;
}


/* Results header */

.ftv-search-results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 17px;
}

.ftv-search-results-head h2 {
    margin: 0;

    color: #f2f2f2;

    font-size: 18px;
    font-weight: 850;
}

.ftv-search-results-head h2 span {
    color: #e6b94f;
}

.ftv-search-results-head small {
    display: block;

    margin-top: 5px;

    color: #969ca6;

    font-size: 9px;
}

.ftv-search-results-count {
    flex: none;

    color: #969ca6;

    font-size: 10px;
}


/* Results */

.ftv-search-grid {
    display: grid;

    grid-template-columns:
        repeat(7, minmax(0, 1fr));

    gap: 17px 13px;
}

.ftv-search-grid .ftv-home-poster-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;

    flex: none !important;
}


/* Pagination */

.ftv-search-pagination {
    margin-top: 34px;
}

.ftv-search-pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 5px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.ftv-search-pagination a,
.ftv-search-pagination span {
    min-width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 9px;

    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;

    background: rgba(255,255,255,.025);

    color: #a8adb5;

    font-size: 10px;
    text-decoration: none;
}

.ftv-search-pagination .current {
    border-color: #e6b94f;

    background: #e6b94f;

    color: #171717;
}


/* Empty */

.ftv-search-empty {
    padding: 65px 20px;

    text-align: center;

    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;

    background: rgba(255,255,255,.02);
}

.ftv-search-empty__icon {
    display: block;

    margin-bottom: 8px;

    color: #e6b94f;

    font-size: 37px;
}

.ftv-search-empty h3 {
    margin: 0 0 7px;

    color: #eee;

    font-size: 18px;
}

.ftv-search-empty p {
    margin: 0 0 14px;

    color: #969ca6;

    font-size: 11px;
}

.ftv-search-empty a {
    color: #e6b94f;

    font-size: 10px;
    text-decoration: none;
}


.ftv-filter-backdrop {
    display: none;
}


/* Responsive */

@media (max-width: 1250px) {
    .ftv-search-grid {
        grid-template-columns:
            repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .ftv-search-grid {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .ftv-search-page {
        padding: 20px 0 45px;
    }

    .ftv-search-shell {
        width: calc(100% - 20px);
    }

    .ftv-search-header {
        margin-bottom: 14px;
    }

    .ftv-search-header__eyebrow {
        font-size: 8px;
    }

    .ftv-search-header h1 {
        font-size: 24px;
    }

    .ftv-search-header__accent {
        width: 34px;
    }


    .ftv-search-mainbar {
        gap: 6px;

        padding: 6px;

        border-radius: 12px;
    }

    .ftv-search-input-wrap input {
        height: 42px;

        padding-right: 39px;

        font-size: 11px;
    }

    .ftv-search-input-wrap svg {
        right: 12px;

        width: 16px;
        height: 16px;
    }

    .ftv-search-submit {
        min-width: 56px;

        padding: 0 9px;

        font-size: 10px;
    }

    .ftv-search-filter-toggle {
        position: relative;

        min-width: 43px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        gap: 4px;

        padding: 0 9px;

        background: rgba(255,255,255,.06);

        color: #d9dadd;

        font-size: 0;
    }

    .ftv-search-filter-toggle svg {
        width: 17px;
        height: 17px;
    }

    .ftv-search-filter-toggle b {
        position: absolute;

        top: -5px;
        left: -4px;

        min-width: 16px;
        height: 16px;

        display: grid;
        place-items: center;

        border-radius: 999px;

        background: #e6b94f;

        color: #171717;

        font-size: 8px;
    }


    /*
     * Bottom Sheet
     */
    .ftv-search-filters {
        position: fixed;
        z-index: 100001;

        right: 0;
        left: 0;
        bottom: 0;

        max-height: 82vh;

        margin: 0;

        padding:
            0
            14px
            calc(16px + env(safe-area-inset-bottom));

        overflow-y: auto;

        border: 0;
        border-radius: 20px 20px 0 0;

        background: #111419;

        box-shadow:
            0 -16px 50px rgba(0,0,0,.38);

        transform: translateY(105%);

        visibility: hidden;

        transition:
            transform .24s ease,
            visibility .24s ease;
    }

    body.ftv-filter-open
    .ftv-search-filters {
        transform: translateY(0);

        visibility: visible;
    }

    .ftv-search-filters__mobile-head {
        position: sticky;
        z-index: 3;

        top: 0;

        display: flex;
        align-items: center;
        justify-content: space-between;

        margin: 0 -14px 12px;

        padding: 15px 16px 12px;

        background: #111419;

        border-bottom:
            1px solid rgba(255,255,255,.06);
    }

    .ftv-search-filters__mobile-head strong {
        color: #f2f2f2;

        font-size: 13px;
    }

    .ftv-search-filters__mobile-head button {
        width: 30px;
        height: 30px;

        display: grid;
        place-items: center;

        border: 0;
        border-radius: 9px;

        background: rgba(255,255,255,.06);

        color: #fff;

        font-size: 20px;
    }

    .ftv-filter-group {
        padding-bottom: 5px;
    }

    .ftv-filter-group__label {
        font-size: 10px;
    }

    .ftv-filter-options {
        gap: 5px;
    }

    .ftv-filter-chip span {
        min-height: 27px;

        padding: 0 9px;

        font-size: 9px;
    }

    .ftv-search-filter-actions {
        position: sticky;

        bottom: 0;

        margin: 8px -14px -16px;

        padding:
            12px
            14px
            calc(12px + env(safe-area-inset-bottom));

        background:
            linear-gradient(
                to top,
                #111419 78%,
                rgba(17,20,25,.92)
            );
    }

    .ftv-search-apply {
        flex: 1;
    }


    .ftv-filter-backdrop {
        position: fixed;
        z-index: 100000;

        inset: 0;

        background: rgba(0,0,0,.64);

        backdrop-filter: blur(3px);

        opacity: 0;
        visibility: hidden;

        display: block;

        transition:
            opacity .2s ease,
            visibility .2s ease;
    }

    body.ftv-filter-open
    .ftv-filter-backdrop {
        opacity: 1;
        visibility: visible;
    }


    .ftv-search-results-head {
        margin-bottom: 13px;
    }

    .ftv-search-results-head h2 {
        font-size: 14px;
    }

    .ftv-search-results-count {
        font-size: 8px;
    }


    /*
     * 3 posters like home
     */
    .ftv-search-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 9px 7px;
    }
}


/* =========================================================
   LIGHT
   ========================================================= */

@media (prefers-color-scheme: light) {

    .ftv-search-header h1,
    .ftv-search-results-head h2 {
        color: #20242a;
    }

    .ftv-search-mainbar,
    .ftv-search-filters {
        border-color: rgba(20,25,30,.08);

        background: rgba(20,25,30,.025);
    }

    .ftv-search-input-wrap input {
        background: rgba(20,25,30,.04);

        color: #20242a;
    }

    .ftv-filter-group__label {
        color: #454b54;
    }

    .ftv-filter-chip span {
        border-color: rgba(20,25,30,.08);

        color: #606771;
    }
}

/* =========================================================
   DESKTOP SEARCH FILTERS — COLLAPSED LIKE MOBILE
   ========================================================= */

@media (min-width: 768px) {

    /*
     * Show filter button on desktop.
     */
    .ftv-search-filter-toggle {
        position: relative;

        min-width: 48px;
        height: 46px;

        display: inline-flex !important;
        align-items: center;
        justify-content: center;

        gap: 5px;

        padding: 0 13px;

        border:
            1px solid rgba(255,255,255,.08);

        border-radius: 10px;

        background:
            rgba(255,255,255,.045);

        color:
            #d9dadd;

        font-family: inherit;
        font-size: 10px;
        font-weight: 750;

        cursor: pointer;

        transition:
            background .16s ease,
            border-color .16s ease,
            color .16s ease;
    }


    .ftv-search-filter-toggle svg {
        width: 16px;
        height: 16px;
    }


    .ftv-search-filter-toggle:hover {
        border-color:
            rgba(230,185,79,.32);

        color:
            #e6b94f;
    }


    .ftv-search-filter-toggle b {
        position: absolute;

        top: -6px;
        left: -5px;

        min-width: 17px;
        height: 17px;

        display: grid;
        place-items: center;

        padding: 0 4px;

        border-radius: 999px;

        background: #e6b94f;

        color: #171717;

        font-size: 8px;
        font-weight: 850;
    }


    /*
     * Hidden by default.
     */
    .ftv-search-filters {
        display: none !important;

        margin-top: 12px !important;
    }


    /*
     * Open when body gets the same class
     * already used by search.js.
     */
    body.ftv-filter-open
    .ftv-search-filters {
        display: flex !important;

        animation:
            ftvDesktopFilterOpen .18s ease both;
    }


    /*
     * No full-screen backdrop on desktop.
     */
    .ftv-filter-backdrop {
        display: none !important;
    }


    /*
     * Mobile-only top header isn't needed.
     */
    .ftv-search-filters__mobile-head {
        display: none !important;
    }


    @keyframes ftvDesktopFilterOpen {

        from {
            opacity: 0;
            transform: translateY(-6px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}


/* Light mode */
@media (min-width: 768px)
and (prefers-color-scheme: light) {

    .ftv-search-filter-toggle {
        border-color:
            rgba(20,25,30,.09);

        background:
            rgba(20,25,30,.04);

        color:
            #555d67;
    }
}

/* =========================================================
   MOBILE FILTER BUTTON — SHOW "تصفية"
   ========================================================= */

@media (max-width: 767px) {

    .ftv-search-filter-toggle {
        min-width: auto !important;

        padding:
            0
            10px !important;

        gap:
            5px !important;

        font-size:
            9px !important;
    }

    .ftv-search-filter-toggle span {
        display:
            inline !important;
    }

    .ftv-search-filter-toggle svg {
        width:
            15px !important;

        height:
            15px !important;
    }
}
