/*
|--------------------------------------------------------------------------
| ToolVerse - Search Tools
|--------------------------------------------------------------------------
| Scope:
| - ONLY .tv-tool-search
| - 12 tools supported
| - No unwanted focus border
| - Desktop / Tablet / Mobile
|--------------------------------------------------------------------------
*/


/* ==========================================================================
   SECTION
   ========================================================================== */

.tv-tool-search {
    position: relative;
    z-index: 5;

    width: 100%;

    padding:
        72px
        0;

    background:
        #ffffff;
}


/* ==========================================================================
   SHELL
   ========================================================================== */

.tv-tool-search__shell {
    position: relative;

    width: 100%;
    max-width: 1080px;

    margin-inline:
        auto;

    padding:
        48px
        52px;

    overflow: hidden;

    border:
        1px solid
        rgba(224, 228, 236, 0.95);

    border-radius:
        28px;

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #fbfcff 55%,
            #f8f9ff 100%
        );

    box-shadow:
        0 24px 60px
        rgba(16, 24, 40, 0.07);
}


.tv-tool-search__shell::before {
    content: "";

    position: absolute;

    top: -150px;
    right: -130px;

    width: 330px;
    height: 330px;

    border-radius:
        50%;

    background:
        radial-gradient(
            circle,
            rgba(99, 91, 255, 0.10),
            rgba(99, 91, 255, 0.025) 52%,
            transparent 72%
        );

    pointer-events:
        none;
}


.tv-tool-search__shell::after {
    content: "";

    position: absolute;

    bottom: -160px;
    left: -150px;

    width: 320px;
    height: 320px;

    border-radius:
        50%;

    background:
        radial-gradient(
            circle,
            rgba(0, 168, 132, 0.07),
            rgba(0, 168, 132, 0.02) 52%,
            transparent 72%
        );

    pointer-events:
        none;
}


/* ==========================================================================
   HEADING
   ========================================================================== */

.tv-tool-search__heading {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 700px;

    margin-inline:
        auto;

    text-align:
        center;
}


.tv-tool-search__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;

    padding:
        0
        11px;

    border:
        1px solid
        rgba(99, 91, 255, 0.13);

    border-radius:
        999px;

    background:
        var(--tv-color-primary-soft);

    color:
        var(--tv-color-primary-dark);

    font-size: 10px;
    font-weight: 750;

    line-height: 1;

    letter-spacing:
        0.2px;
}


.tv-tool-search__title {
    margin:
        15px
        0
        0;

    color:
        var(--tv-color-heading);

    font-size:
        clamp(
            28px,
            3.2vw,
            40px
        );

    font-weight:
        820;

    line-height:
        1.12;

    letter-spacing:
        -1.35px;
}


.tv-tool-search__description {
    max-width:
        620px;

    margin:
        14px
        auto
        0;

    color:
        var(--tv-color-muted);

    font-size:
        14px;

    line-height:
        1.7;
}


/* ==========================================================================
   SEARCH AREA
   ========================================================================== */

.tv-tool-search__search-area {
    position: relative;
    z-index: 3;

    width: 100%;
    max-width: 780px;

    margin:
        30px
        auto
        0;
}


.tv-tool-search__form {
    width: 100%;
}


/* ==========================================================================
   SEARCH INPUT WRAPPER
   ========================================================================== */

.tv-tool-search__input-wrap {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-height: 60px;

    padding-left:
        19px;

    border:
        1px solid
        var(--tv-color-border-strong);

    border-radius:
        18px;

    background:
        #ffffff;

    box-shadow:
        0 10px 30px
        rgba(16, 24, 40, 0.065);

    /*
    |--------------------------------------------------------------------------
    | IMPORTANT
    |--------------------------------------------------------------------------
    | Border and shadow intentionally remain the SAME during input focus.
    | This removes the purple focus-border issue.
    |--------------------------------------------------------------------------
    */

    transition:
        box-shadow 180ms ease;
}


/* ==========================================================================
   NO OUTER FOCUS BORDER / RING
   ========================================================================== */

.tv-tool-search__input-wrap:focus-within {
    border-color:
        var(--tv-color-border-strong);

    box-shadow:
        0 10px 30px
        rgba(16, 24, 40, 0.065);
}


/* ==========================================================================
   SEARCH ICON
   ========================================================================== */

.tv-tool-search__search-icon {
    display: grid;
    place-items: center;

    width: 21px;
    height: 21px;

    flex:
        0
        0
        21px;

    color:
        #7b8798;

    pointer-events:
        none;
}


.tv-tool-search__search-icon svg {
    width: 20px;
    height: 20px;

    fill: none;

    stroke:
        currentColor;

    stroke-width:
        1.9;

    stroke-linecap:
        round;
}


/* ==========================================================================
   INPUT
   ========================================================================== */

.tv-tool-search__input {
    width: 100%;
    min-width: 0;

    height: 58px;

    padding:
        0
        14px;

    border:
        0 !important;

    outline:
        0 !important;

    outline-offset:
        0 !important;

    background:
        transparent;

    color:
        var(--tv-color-heading);

    font-family:
        inherit;

    font-size:
        14px;

    font-weight:
        500;

    line-height:
        1;

    box-shadow:
        none !important;

    -webkit-appearance:
        none;

    appearance:
        none;
}


.tv-tool-search__input:focus,
.tv-tool-search__input:focus-visible,
.tv-tool-search__input:active {
    border:
        0 !important;

    outline:
        0 !important;

    box-shadow:
        none !important;
}


.tv-tool-search__input::placeholder {
    color:
        #98a2b3;

    opacity:
        1;
}


.tv-tool-search__input::-webkit-search-decoration,
.tv-tool-search__input::-webkit-search-cancel-button,
.tv-tool-search__input::-webkit-search-results-button,
.tv-tool-search__input::-webkit-search-results-decoration {
    display:
        none;
}


/* ==========================================================================
   CLEAR BUTTON
   ========================================================================== */

.tv-tool-search__clear {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    flex:
        0
        0
        34px;

    padding:
        0;

    margin-right:
        7px;

    border:
        0;

    outline:
        0;

    border-radius:
        10px;

    background:
        #f4f6f9;

    color:
        #667085;

    cursor:
        pointer;

    transition:
        background-color 160ms ease,
        color 160ms ease;
}


.tv-tool-search__clear[hidden] {
    display:
        none;
}


.tv-tool-search__clear svg {
    width: 15px;
    height: 15px;

    fill: none;

    stroke:
        currentColor;

    stroke-width:
        2;

    stroke-linecap:
        round;
}


.tv-tool-search__clear:hover {
    background:
        #eceff4;

    color:
        var(--tv-color-heading);
}


.tv-tool-search__clear:focus,
.tv-tool-search__clear:focus-visible {
    outline:
        0;

    box-shadow:
        none;
}


/* ==========================================================================
   SEARCH BUTTON
   ========================================================================== */

.tv-tool-search__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 112px;
    min-height: 46px;

    flex:
        0
        0
        auto;

    margin-right:
        6px;

    padding:
        0
        17px;

    border:
        0;

    outline:
        0;

    border-radius:
        13px;

    background:
        linear-gradient(
            135deg,
            #7169ff 0%,
            #635bff 52%,
            #5048dc 100%
        );

    color:
        #ffffff;

    font-family:
        inherit;

    font-size:
        12px;

    font-weight:
        750;

    line-height:
        1;

    box-shadow:
        0 7px 16px
        rgba(99, 91, 255, 0.19);

    cursor:
        pointer;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}


.tv-tool-search__submit svg {
    width: 16px;
    height: 16px;

    fill: none;

    stroke:
        currentColor;

    stroke-width:
        2;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;

    transition:
        transform 180ms ease;
}


.tv-tool-search__submit:hover {
    transform:
        translateY(-1px);

    box-shadow:
        0 10px 20px
        rgba(99, 91, 255, 0.25);
}


.tv-tool-search__submit:hover svg {
    transform:
        translateX(2px);
}


.tv-tool-search__submit:focus,
.tv-tool-search__submit:focus-visible {
    outline:
        0;
}


/* ==========================================================================
   SEARCH HINT
   ========================================================================== */

.tv-tool-search__hint {
    margin:
        9px
        0
        0;

    padding-left:
        4px;

    color:
        #8a95a5;

    font-size:
        10px;

    font-weight:
        500;

    line-height:
        1.5;
}


/* ==========================================================================
   POPULAR CHIPS
   ========================================================================== */

.tv-tool-search__quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    gap: 7px;

    margin-top:
        17px;
}


.tv-tool-search__quick-label {
    margin-right:
        2px;

    color:
        #7d8898;

    font-size:
        10px;

    font-weight:
        650;
}


.tv-tool-search__chip {
    min-height:
        29px;

    padding:
        0
        10px;

    border:
        1px solid
        var(--tv-color-border);

    outline:
        0;

    border-radius:
        999px;

    background:
        rgba(255, 255, 255, 0.85);

    color:
        #596579;

    font-family:
        inherit;

    font-size:
        10px;

    font-weight:
        650;

    line-height:
        1;

    box-shadow:
        0 1px 3px
        rgba(16, 24, 40, 0.025);

    cursor:
        pointer;

    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}


.tv-tool-search__chip:hover {
    border-color:
        rgba(99, 91, 255, 0.20);

    background:
        var(--tv-color-primary-soft);

    color:
        var(--tv-color-primary-dark);

    transform:
        translateY(-1px);
}


/*
|--------------------------------------------------------------------------
| IMPORTANT
| Clicking a Popular chip must NOT leave a purple outline/border.
|--------------------------------------------------------------------------
*/

.tv-tool-search__chip:focus,
.tv-tool-search__chip:focus-visible,
.tv-tool-search__chip:active {
    outline:
        0;

    box-shadow:
        0 1px 3px
        rgba(16, 24, 40, 0.025);
}


/* ==========================================================================
   RESULTS
   ========================================================================== */

.tv-tool-search__results {
    position: relative;
    z-index: 3;

    width: 100%;
    max-width: 900px;

    margin:
        32px
        auto
        0;

    padding-top:
        25px;

    border-top:
        1px solid
        var(--tv-color-border);
}


.tv-tool-search__results[hidden] {
    display:
        none;
}


/* ==========================================================================
   RESULTS HEAD
   ========================================================================== */

.tv-tool-search__results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-bottom:
        15px;
}


.tv-tool-search__results-count {
    margin:
        0;

    color:
        var(--tv-color-heading);

    font-size:
        12px;

    font-weight:
        700;

    line-height:
        1.4;
}


.tv-tool-search__results-close {
    padding:
        0;

    border:
        0;

    outline:
        0;

    background:
        transparent;

    color:
        var(--tv-color-primary);

    font-family:
        inherit;

    font-size:
        10px;

    font-weight:
        700;

    line-height:
        1.3;

    cursor:
        pointer;

    transition:
        color 160ms ease;
}


.tv-tool-search__results-close:hover {
    color:
        var(--tv-color-primary-dark);
}


.tv-tool-search__results-close:focus,
.tv-tool-search__results-close:focus-visible {
    outline:
        0;
}


/* ==========================================================================
   RESULTS GRID
   ========================================================================== */

.tv-tool-search__results-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap:
        11px;
}


/* ==========================================================================
   RESULT CARD
   ========================================================================== */

.tv-tool-search__result-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width:
        0;

    min-height:
        142px;

    padding:
        17px;

    overflow:
        hidden;

    border:
        1px solid
        var(--tv-color-border);

    border-radius:
        16px;

    background:
        #ffffff;

    color:
        inherit;

    text-decoration:
        none;

    box-shadow:
        0 4px 14px
        rgba(16, 24, 40, 0.035);

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}


.tv-tool-search__result-card:hover {
    border-color:
        rgba(99, 91, 255, 0.20);

    transform:
        translateY(-2px);

    box-shadow:
        0 10px 24px
        rgba(16, 24, 40, 0.065);
}


.tv-tool-search__result-category {
    display: inline-flex;
    align-items: center;

    width:
        fit-content;

    min-height:
        24px;

    padding:
        0
        8px;

    border-radius:
        999px;

    background:
        var(--tv-color-primary-soft);

    color:
        var(--tv-color-primary-dark);

    font-size:
        8px;

    font-weight:
        750;

    line-height:
        1;

    text-transform:
        uppercase;

    letter-spacing:
        0.35px;
}


.tv-tool-search__result-name {
    margin:
        10px
        0
        0;

    color:
        var(--tv-color-heading);

    font-size:
        14px;

    font-weight:
        760;

    line-height:
        1.35;
}


.tv-tool-search__result-description {
    margin:
        6px
        0
        0;

    color:
        var(--tv-color-muted);

    font-size:
        10px;

    line-height:
        1.55;
}


.tv-tool-search__result-open {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    width:
        fit-content;

    margin-top:
        auto;

    padding-top:
        12px;

    color:
        var(--tv-color-primary);

    font-size:
        10px;

    font-weight:
        750;

    line-height:
        1.2;
}


.tv-tool-search__result-open::after {
    content:
        "→";

    font-size:
        13px;

    transition:
        transform 160ms ease;
}


.tv-tool-search__result-card:hover
.tv-tool-search__result-open::after {
    transform:
        translateX(3px);
}


/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.tv-tool-search__empty {
    width: 100%;

    padding:
        32px
        20px;

    text-align:
        center;
}


.tv-tool-search__empty[hidden] {
    display:
        none;
}


.tv-tool-search__empty-icon {
    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;

    margin-inline:
        auto;

    border-radius:
        14px;

    background:
        var(--tv-color-primary-soft);

    color:
        var(--tv-color-primary);
}


.tv-tool-search__empty-icon svg {
    width: 21px;
    height: 21px;

    fill:
        none;

    stroke:
        currentColor;

    stroke-width:
        1.8;

    stroke-linecap:
        round;
}


.tv-tool-search__empty h3 {
    margin:
        13px
        0
        0;

    color:
        var(--tv-color-heading);

    font-size:
        15px;

    font-weight:
        760;

    line-height:
        1.3;
}


.tv-tool-search__empty p {
    max-width:
        380px;

    margin:
        6px
        auto
        0;

    color:
        var(--tv-color-muted);

    font-size:
        11px;

    line-height:
        1.6;
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 900px) {

    .tv-tool-search {
        padding:
            60px
            0;
    }


    .tv-tool-search__shell {
        padding:
            42px
            34px;

        border-radius:
            24px;
    }


    .tv-tool-search__title {
        font-size:
            clamp(
                27px,
                4vw,
                36px
            );
    }
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 700px) {

    .tv-tool-search {
        padding:
            48px
            0;
    }


    .tv-tool-search__shell {
        padding:
            34px
            20px;

        border-radius:
            21px;
    }


    .tv-tool-search__title {
        margin-top:
            13px;

        font-size:
            clamp(
                25px,
                7.5vw,
                32px
            );

        letter-spacing:
            -1px;
    }


    .tv-tool-search__description {
        margin-top:
            12px;

        font-size:
            13px;

        line-height:
            1.65;
    }


    .tv-tool-search__search-area {
        margin-top:
            25px;
    }


    .tv-tool-search__input-wrap {
        min-height:
            56px;

        padding-left:
            16px;

        border-radius:
            16px;
    }


    .tv-tool-search__input {
        height:
            54px;

        padding:
            0
            11px;

        font-size:
            13px;
    }


    .tv-tool-search__submit {
        width:
            46px;

        min-width:
            46px;

        min-height:
            44px;

        padding:
            0;

        margin-right:
            5px;

        border-radius:
            12px;
    }


    .tv-tool-search__submit span {
        display:
            none;
    }


    .tv-tool-search__submit svg {
        width:
            17px;

        height:
            17px;
    }


    .tv-tool-search__quick {
        margin-top:
            15px;

        gap:
            6px;
    }


    .tv-tool-search__results {
        margin-top:
            27px;

        padding-top:
            21px;
    }


    .tv-tool-search__results-grid {
        grid-template-columns:
            1fr;
    }
}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 480px) {

    .tv-tool-search__shell {
        padding:
            30px
            15px;

        border-radius:
            18px;
    }


    .tv-tool-search__eyebrow {
        min-height:
            28px;

        font-size:
            9px;
    }


    .tv-tool-search__title {
        font-size:
            26px;
    }


    .tv-tool-search__description {
        font-size:
            12px;
    }


    .tv-tool-search__input-wrap {
        min-height:
            54px;

        padding-left:
            13px;

        border-radius:
            14px;
    }


    .tv-tool-search__search-icon {
        width:
            19px;

        height:
            19px;

        flex-basis:
            19px;
    }


    .tv-tool-search__search-icon svg {
        width:
            18px;

        height:
            18px;
    }


    .tv-tool-search__input {
        height:
            52px;

        font-size:
            12px;
    }


    .tv-tool-search__clear {
        width:
            31px;

        height:
            31px;

        flex-basis:
            31px;

        margin-right:
            4px;
    }


    .tv-tool-search__submit {
        width:
            42px;

        min-width:
            42px;

        min-height:
            42px;

        border-radius:
            11px;
    }


    .tv-tool-search__hint {
        font-size:
            9px;
    }


    .tv-tool-search__quick-label {
        width:
            100%;

        margin:
            0
            0
            2px;

        text-align:
            center;
    }


    .tv-tool-search__results-head {
        align-items:
            flex-start;
    }


    .tv-tool-search__result-card {
        min-height:
            136px;

        padding:
            15px;
    }
}


/* ==========================================================================
   VERY SMALL MOBILE
   ========================================================================== */

@media (max-width: 360px) {

    .tv-tool-search__shell {
        padding:
            27px
            12px;
    }


    .tv-tool-search__title {
        font-size:
            24px;
    }


    .tv-tool-search__input {
        padding:
            0
            8px;
    }


    .tv-tool-search__clear {
        display:
            none;
    }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .tv-tool-search__input-wrap,
    .tv-tool-search__clear,
    .tv-tool-search__submit,
    .tv-tool-search__submit svg,
    .tv-tool-search__chip,
    .tv-tool-search__result-card,
    .tv-tool-search__result-open::after {
        transition:
            none;
    }


    .tv-tool-search__submit:hover,
    .tv-tool-search__chip:hover,
    .tv-tool-search__result-card:hover {
        transform:
            none;
    }
}