/* Homepage search (2026-12-03, v2).
   One wide pill: search icon · rotating "Search <real title>" hint · "/" key · clear · Filters.
   Quick filter pills underneath with small icons that move on hover and when picked.
   Motion is short and only on interaction; everything is still under prefers-reduced-motion. */

.t4-window .controls { flex-direction: column; align-items: center; gap: 16px; margin: 28px 0 44px !important; }
.t4-window .search-container { max-width: 660px !important; width: 100%; }
.search-input-wrapper { isolation: isolate; }

/* ── the field ── */
#searchInput.search-input {
    height: 58px; padding: 0 172px 0 56px !important; font-size: 15.5px !important; font-weight: 450; letter-spacing: -.005em;
    border-radius: 999px !important; color: #f2f2f1 !important; caret-color: #fff;
    background: linear-gradient(180deg, rgba(237, 237, 236, .075), rgba(237, 237, 236, .04)) !important;
    border: 1px solid rgba(237, 237, 236, .14) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 44px -24px rgba(0, 0, 0, .85), 0 0 0 0 rgba(237, 237, 236, 0) !important;
    transition: border-color .2s ease, background .2s ease, box-shadow .25s ease !important;
}
#searchInput.search-input:hover { border-color: rgba(237, 237, 236, .22) !important; }
#searchInput.search-input:focus {
    border-color: rgba(237, 237, 236, .38) !important;
    background: linear-gradient(180deg, rgba(237, 237, 236, .1), rgba(237, 237, 236, .06)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 44px -24px rgba(0, 0, 0, .85), 0 0 0 5px rgba(237, 237, 236, .06) !important;
}
/* the real placeholder only shows while focused; at rest the rotating hint stands in for it */
#searchInput.search-input::placeholder { color: rgba(237, 237, 236, .42) !important; transition: color .15s ease; }
#searchInput.search-input:not(:focus)::placeholder { color: transparent !important; }

/* ── search icon: tips toward the text when the field is focused ── */
.t4-window .search-icon {
    left: 22px !important; width: 19px !important; height: 19px !important; color: rgba(237, 237, 236, .62) !important;
    transition: color .2s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1) !important; z-index: 2;
}
.search-input-wrapper:focus-within .search-icon { color: #fff !important; transform: translateY(-50%) rotate(-14deg) scale(1.06) !important; }

/* ── rotating hint: Search “<a real pack title>” ── */
.hs-ph {
    position: absolute; left: 56px; right: 176px; top: 50%; transform: translateY(-50%); z-index: 1;
    display: flex; align-items: center; gap: .32em; height: 24px; overflow: hidden; white-space: nowrap;
    font-size: 15.5px; font-weight: 450; letter-spacing: -.005em; color: rgba(237, 237, 236, .5); pointer-events: none;
    transition: opacity .15s ease;
}
.hs-ph-w { position: relative; flex: 1 1 auto; min-width: 0; height: 24px; overflow: hidden; }
.hs-ph-t { position: absolute; left: 0; top: 0; line-height: 24px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: rgba(237, 237, 236, .78); }
.hs-ph-t.in { animation: hsPhIn .5s cubic-bezier(.2, .8, .2, 1) both; }
.hs-ph-t.out { animation: hsPhOut .35s cubic-bezier(.4, 0, 1, 1) both; }
@keyframes hsPhIn { from { transform: translateY(100%); opacity: 0; filter: blur(3px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes hsPhOut { from { transform: none; opacity: 1; } to { transform: translateY(-90%); opacity: 0; filter: blur(3px); } }
#searchInput:focus ~ .hs-ph, #searchInput:not(:placeholder-shown) ~ .hs-ph { opacity: 0; }

/* ── "/" key and clear button share the slot left of Filters ── */
.hs-kbd, .hs-clear { position: absolute; top: 50%; z-index: 9; }
.hs-kbd {
    right: 130px; transform: translateY(-50%); min-width: 24px; height: 24px; padding: 0 6px; box-sizing: border-box;
    display: grid; place-items: center; border: 1px solid rgba(237, 237, 236, .16); border-bottom-width: 2px; border-radius: 7px;
    font: 500 12px/1 'Geist', 'Inter', sans-serif; color: rgba(237, 237, 236, .55); pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}
#searchInput:focus ~ .hs-kbd, #searchInput:not(:placeholder-shown) ~ .hs-kbd { opacity: 0; transform: translateY(-50%) scale(.85); }
.hs-kbd.press { animation: hsKey .22s ease; }
@keyframes hsKey { 50% { transform: translateY(-40%); border-bottom-width: 1px; } }

.hs-clear {
    right: 124px; width: 32px; height: 32px; margin-top: -16px; padding: 0; border: 0; border-radius: 50%;
    display: grid; place-items: center; background: rgba(237, 237, 236, .08); color: rgba(237, 237, 236, .75); cursor: pointer;
    opacity: 0; transform: scale(.6) rotate(-90deg); pointer-events: none;
    transition: opacity .18s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1), background .15s ease, color .15s ease;
}
.hs-clear svg { width: 14px; height: 14px; }
.hs-clear:hover { background: rgba(237, 237, 236, .16); color: #fff; }
#searchInput:not(:placeholder-shown) ~ .hs-clear { opacity: 1; transform: none; pointer-events: auto; }

/* ── Filters button: the slider knobs slide on hover ── */
#filterMenuBtn.filter-menu-btn {
    right: 8px !important; width: auto !important; height: 42px !important; padding: 0 17px 0 14px !important;
    gap: 8px; border-radius: 999px !important; border: 1px solid rgba(237, 237, 236, .16) !important; background: rgba(237, 237, 236, .03) !important;
    color: #ededec !important; font: 500 13.5px/1 'Geist', 'Inter', sans-serif; white-space: nowrap; user-select: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease !important;
}
#filterMenuBtn.filter-menu-btn:hover { background: rgba(237, 237, 236, .1) !important; border-color: rgba(237, 237, 236, .28) !important; }
#filterMenuBtn.filter-menu-btn.active { background: #ededec !important; color: #121212 !important; border-color: #ededec !important; }
#filterMenuBtn.filter-menu-btn:active { transform: translateY(-50%) scale(.96) !important; }
#filterMenuBtn svg { width: 16px; height: 16px; flex: none; overflow: visible; }
#filterMenuBtn .k1, #filterMenuBtn .k2 { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
#filterMenuBtn:hover .k1, #filterMenuBtn.active .k1 { transform: translateX(-6px); }
#filterMenuBtn:hover .k2, #filterMenuBtn.active .k2 { transform: translateX(6px); }

/* ── quick filter pills ── */
.hs-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hs-chip {
    display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px 0 13px; border-radius: 999px;
    border: 1px solid rgba(237, 237, 236, .14); background: rgba(237, 237, 236, .025);
    color: rgba(237, 237, 236, .66); font: 500 13.5px/1 'Geist', 'Inter', sans-serif; cursor: pointer; white-space: nowrap; user-select: none;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .12s ease;
}
.hs-chip svg { width: 16px; height: 16px; flex: none; overflow: visible; }
.hs-chip:hover { color: #fff; border-color: rgba(237, 237, 236, .3); background: rgba(237, 237, 236, .07); }
.hs-chip:active { transform: scale(.96); }
.hs-chip.on { background: #ededec; color: #121212; border-color: #ededec; }
.hs-chip:focus-visible, #filterMenuBtn:focus-visible, .hs-clear:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* icon motion: plays on hover, and once when the pill is picked */
.hs-chip .ic { transform-box: fill-box; }
.hs-chip[data-f="most-downloaded"] .ic { transform-origin: 50% 100%; }
.hs-chip[data-f="most-downloaded"]:hover .ic, .hs-chip[data-f="most-downloaded"].on .ic { animation: hsFlame 1.1s ease-in-out infinite; }
@keyframes hsFlame { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.94, 1.1) skewX(-3deg); } 60% { transform: scale(1.04, .95) skewX(2deg); } }

.hs-chip[data-f="recently-added"] .ic { transform-origin: 50% 50%; }
.hs-chip[data-f="recently-added"]:hover .ic, .hs-chip[data-f="recently-added"].on .ic { animation: hsSpark .7s cubic-bezier(.34, 1.56, .64, 1); }
.hs-chip[data-f="recently-added"] .tw { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.hs-chip[data-f="recently-added"]:hover .tw, .hs-chip[data-f="recently-added"].on .tw { animation: hsTwinkle .8s ease .1s; }
@keyframes hsSpark { 0% { transform: rotate(0) scale(1); } 45% { transform: rotate(35deg) scale(1.18); } 100% { transform: rotate(90deg) scale(1); } }
@keyframes hsTwinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 40% { opacity: 1; transform: scale(1); } }

.hs-chip[data-f="movies"] .clap { transform-box: fill-box; transform-origin: 0% 100%; }
.hs-chip[data-f="movies"]:hover .clap, .hs-chip[data-f="movies"].on .clap { animation: hsClap .55s cubic-bezier(.5, 0, .3, 1); }
@keyframes hsClap { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-22deg); } 70% { transform: rotate(3deg); } }

.hs-chip[data-f="tv"] .ant { transform-box: fill-box; transform-origin: 50% 100%; }
.hs-chip[data-f="tv"]:hover .ant, .hs-chip[data-f="tv"].on .ant { animation: hsAnt .7s ease-in-out; }
.hs-chip[data-f="tv"] .scr { opacity: 0; }
.hs-chip[data-f="tv"]:hover .scr, .hs-chip[data-f="tv"].on .scr { animation: hsScr .7s ease; }
@keyframes hsAnt { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
@keyframes hsScr { 0%, 100% { opacity: 0; } 30%, 60% { opacity: .9; } }

.hs-chip[data-f="games"] .ic { transform-origin: 50% 60%; }
.hs-chip[data-f="games"]:hover .ic, .hs-chip[data-f="games"].on .ic { animation: hsPad .6s ease-in-out; }
.hs-chip[data-f="games"] .btn-a { transform-box: fill-box; transform-origin: 50% 50%; }
.hs-chip[data-f="games"]:hover .btn-a, .hs-chip[data-f="games"].on .btn-a { animation: hsPress .6s ease .15s; }
@keyframes hsPad { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-10deg); } 65% { transform: rotate(7deg); } }
@keyframes hsPress { 0%, 100% { transform: scale(1); } 50% { transform: scale(2.2); } }

.hs-chip[data-f="sports"] .ic { transform-origin: 50% 50%; }
.hs-chip[data-f="sports"]:hover .ic, .hs-chip[data-f="sports"].on .ic { animation: hsBall .8s cubic-bezier(.3, 0, .2, 1); }
@keyframes hsBall { 0% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-3px) rotate(140deg); } 65% { transform: translateY(0) rotate(270deg); } 80% { transform: translateY(-1px) rotate(330deg); } 100% { transform: translateY(0) rotate(360deg); } }

/* ── autocomplete: a separate floating panel under the bar ── */
.t4-window .search-dropdown {
    top: calc(100% + 10px) !important; left: 0; right: 0; padding: 6px; max-height: min(440px, 60vh) !important;
    background: #0e0e13 !important; opacity: 1 !important; border: 1px solid rgba(237, 237, 236, .13) !important; border-radius: 22px !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .05) !important;
    scrollbar-width: thin; scrollbar-color: rgba(237, 237, 236, .18) transparent; overscroll-behavior: contain;
}
.t4-window .search-dropdown.show { animation: hsDrop .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hsDrop { from { transform: translateY(-5px); } to { transform: none; } }
.t4-window .search-section { padding: 12px 12px 6px !important; }
.t4-window .search-section + .search-section, .t4-window .search-item + .search-section { margin-top: 4px; border-top: 1px solid rgba(237, 237, 236, .07); }
.t4-window .search-section-title {
    margin: 0 !important; font-size: 11px !important; font-weight: 600 !important; letter-spacing: .08em !important;
    color: rgba(237, 237, 236, .42) !important;
}
.t4-window .search-item {
    min-height: 44px; padding: 7px 12px !important; gap: 12px !important; border-radius: 14px !important; font-size: 14px !important;
    transition: background .12s ease !important;
}
.t4-window .search-item:hover { background: rgba(237, 237, 236, .065) !important; }
.t4-window .search-item i { width: 18px !important; text-align: center; font-size: 13px !important; color: rgba(237, 237, 236, .45) !important; transition: color .12s ease; }
.t4-window .search-item:hover i { color: #ededec !important; }
.t4-window .search-item .search-text { color: #ededec !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t4-window .search-item .search-category {
    flex: none; font-size: 11.5px !important; font-weight: 500; color: rgba(237, 237, 236, .6) !important;
    background: none !important; border: 1px solid rgba(237, 237, 236, .14); padding: 3px 9px !important; border-radius: 999px !important;
}
.t4-window .actor-item { min-height: 56px; }
.t4-window .actor-item .actor-thumbnail {
    width: 40px !important; height: 40px !important; border-radius: 50% !important; object-fit: cover; flex: none;
    background: #20202a; border: 1px solid rgba(237, 237, 236, .12) !important; font-size: 0; color: transparent;
}
.t4-window .actor-item .actor-info { min-width: 0; gap: 2px !important; }
.t4-window .actor-item .actor-name { font-size: 14px !important; font-weight: 600 !important; color: #ededec !important; }
.t4-window .actor-item .actor-known-for { font-size: 12.5px !important; color: rgba(237, 237, 236, .5) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t4-window .clear-history {
    margin: 6px 6px 4px; padding: 10px 12px !important; border: 0 !important; border-top: 1px solid rgba(237, 237, 236, .07) !important;
    border-radius: 0; font-size: 12.5px !important; color: rgba(237, 237, 236, .5) !important; text-align: center; cursor: pointer;
}
.t4-window .clear-history:hover { color: #ededec !important; background: none !important; }

@media (prefers-reduced-motion: reduce) {
    .t4-window .search-dropdown.show { animation: none; }
    .hs-chip .ic, .hs-chip .clap, .hs-chip .ant, .hs-chip .scr, .hs-chip .tw, .hs-chip .btn-a,
    .hs-ph-t.in, .hs-ph-t.out, .hs-kbd.press { animation: none !important; }
    .search-input-wrapper:focus-within .search-icon { transform: translateY(-50%) !important; }
}

@media (max-width: 880px) {
    .t4-window .controls { align-items: stretch; }
    .hs-kbd { display: none; }
    #searchInput.search-input { height: 52px; padding-right: 156px !important; }
    .hs-ph { right: 160px; }
    .hs-clear { right: 118px; }
    .hs-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
    .hs-chips::-webkit-scrollbar { display: none; }
}
