/* =========================================================
   SDR PREMIUM SEARCH
   Modern / Glass / SaaS / RTL
   Names preserved 100%
   ========================================================= */


/* =========================================================
   SEARCH CONTAINER
   ========================================================= */

#search-container {
    position: fixed;

    top: clamp(12px, 1.5vw, 20px);
    left: 50%;

    width: min(92vw, 680px);

    transform: translateX(-50%);

    z-index: 999999;

    pointer-events: none;

    isolation: isolate;

    animation:
        sdr-search-enter
        0.65s
        cubic-bezier(.16, 1, .3, 1)
        both;
}


/* =========================================================
   SEARCH PILL / GLASS DOCK
   ========================================================= */

.search-pill {
    position: relative;

    display: flex;
    flex-direction: row;
    align-items: center;

    width: 100%;

    min-height: 58px;

    box-sizing: border-box;

    padding: 6px;

    pointer-events: auto;

    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.88),
            rgba(255,255,255,0.68)
        );

    border: 1px solid rgba(255,255,255,0.95);

    box-shadow:
        0 2px 5px rgba(15,23,42,0.04),
        0 8px 24px rgba(15,23,42,0.08),
        0 18px 45px rgba(15,23,42,0.10);

    backdrop-filter:
        blur(20px)
        saturate(150%);

    -webkit-backdrop-filter:
        blur(20px)
        saturate(150%);

    transition:
        box-shadow 0.35s ease,
        border-color 0.35s ease,
        transform 0.35s cubic-bezier(.16,1,.3,1);
}


/* Subtle outer glow */

.search-pill::before {
    content: "";

    position: absolute;
    inset: -1px;

    border-radius: inherit;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.95),
            rgba(207,244,228,0.28),
            rgba(255,255,255,0.85)
        );

    z-index: -1;

    pointer-events: none;
}


/* Top reflection */

.search-pill::after {
    content: "";

    position: absolute;

    left: 8%;
    right: 8%;
    top: 1px;

    height: 1px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.95),
            transparent
        );

    pointer-events: none;
}


/* =========================================================
   FOCUS STATE
   ========================================================= */

.search-pill:focus-within {
    border-color:
        rgba(7,145,130,0.22);

    box-shadow:
        0 2px 5px rgba(15,23,42,0.04),
        0 10px 28px rgba(15,23,42,0.09),
        0 20px 48px rgba(7,145,130,0.13),
        0 0 0 4px rgba(7,145,130,0.055);
}


/* =========================================================
   SEARCH BUTTON
   ========================================================= */

.search-btn {
    position: relative;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding:
        0 clamp(18px, 2vw, 25px);

    border: 0;
    border-radius: 999px;

    background:
        linear-gradient(
            135deg,
            #0b9a89 0%,
            #078e80 48%,
            #06766b 100%
        );

    color: #fbf1e7;

    font-family: inherit;

    font-size: clamp(13px, 1vw, 15px);

    font-weight: 750;

    line-height: 1;

    letter-spacing: -0.01em;

    white-space: nowrap;

    cursor: pointer;

    overflow: hidden;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,0.20),
        inset 0 -1px 1px rgba(0,0,0,0.08),
        0 3px 7px rgba(7,145,130,0.12),
        0 8px 20px rgba(7,145,130,0.18);

    text-shadow:
        0 1px 2px rgba(0,0,0,0.08);

    transition:
        transform 0.35s cubic-bezier(.16,1,.3,1),
        background 0.35s ease,
        box-shadow 0.35s ease;
}


/* Button shine */

.search-btn::before {
    content: "";

    position: absolute;

    top: -100%;
    left: -40%;

    width: 45%;
    height: 300%;

    transform: rotate(25deg) translateX(-180%);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,0.35),
            transparent
        );

    transition:
        transform 0.7s cubic-bezier(.16,1,.3,1);

    pointer-events: none;
}


.search-btn:hover::before {
    transform:
        rotate(25deg)
        translateX(450%);
}


/* =========================================================
   SEARCH BUTTON HOVER
   ========================================================= */

.search-btn:hover {
    transform:
        translateY(-2px)
        scale(1.015);

    background:
        linear-gradient(
            135deg,
            #0da08f 0%,
            #079486 48%,
            #067c71 100%
        );

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,0.24),
        0 5px 10px rgba(7,145,130,0.14),
        0 12px 26px rgba(7,145,130,0.24);
}


.search-btn:active {
    transform:
        translateY(0)
        scale(0.97);

    transition-duration: 0.1s;
}


/* =========================================================
   INPUT FIELD
   ========================================================= */

#searchBox {
    flex: 1 1 auto;

    min-width: 0;

    height: 46px;

    box-sizing: border-box;

    border: none;
    outline: none;

    background: transparent;

    padding:
        0 clamp(16px, 2vw, 22px);

    font-family: inherit;

    font-size: clamp(14px, 1.1vw, 16px);

    font-weight: 500;

    line-height: 1.5;

    color: #173b38;

    direction: rtl;

    caret-color: #079182;

    transition:
        color 0.25s ease;
}


#searchBox:focus {
    color: #123b37;
}


/* =========================================================
   PLACEHOLDER
   ========================================================= */

#searchBox::placeholder {
    color: rgba(23,59,56,0.48);

    font-size: clamp(13px, 1.05vw, 15px);

    font-weight: 450;

    transition:
        color 0.25s ease;
}


#searchBox:focus::placeholder {
    color: rgba(23,59,56,0.30);
}


/* =========================================================
   SEARCH RESULTS
   ========================================================= */

#searchResults {
    position: relative;

    margin-top: 10px;

    width: 100%;

    box-sizing: border-box;

    padding: 7px;

    background:
        rgba(255,255,255,0.92);

    border:
        1px solid rgba(255,255,255,0.95);

    border-radius: 22px;

    box-shadow:
        0 4px 10px rgba(15,23,42,0.04),
        0 12px 28px rgba(15,23,42,0.09),
        0 25px 55px rgba(15,23,42,0.11);

    backdrop-filter:
        blur(22px)
        saturate(150%);

    -webkit-backdrop-filter:
        blur(22px)
        saturate(150%);

    max-height: min(380px, 55vh);

    overflow-y: auto;

    display: none;

    pointer-events: auto;

    direction: rtl;

    animation:
        sdr-results-enter
        0.28s
        cubic-bezier(.16,1,.3,1)
        both;
}


/* =========================================================
   RESULT SCROLLBAR
   ========================================================= */

#searchResults::-webkit-scrollbar {
    width: 5px;
}


#searchResults::-webkit-scrollbar-track {
    background: transparent;
}


#searchResults::-webkit-scrollbar-thumb {
    background: rgba(7,145,130,0.20);

    border-radius: 999px;
}


#searchResults::-webkit-scrollbar-thumb:hover {
    background: rgba(7,145,130,0.35);
}


/* Firefox */

#searchResults {
    scrollbar-width: thin;
    scrollbar-color:
        rgba(7,145,130,0.25)
        transparent;
}


/* =========================================================
   RESULT ITEM
   ========================================================= */

.search-item {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 48px;

    box-sizing: border-box;

    padding:
        11px 14px;

    margin: 2px 0;

    border-radius: 15px;

    font-family: inherit;

    font-size: clamp(13px, 1vw, 15px);

    font-weight: 500;

    line-height: 1.5;

    color: #244541;

    direction: rtl;

    cursor: pointer;

    transition:
        background 0.22s ease,
        color 0.22s ease,
        transform 0.22s cubic-bezier(.16,1,.3,1),
        padding-right 0.22s ease;
}


/* Result hover indicator */

.search-item::before {
    content: "";

    position: absolute;

    right: 7px;

    top: 50%;

    width: 3px;
    height: 0;

    border-radius: 999px;

    background: #079182;

    transform:
        translateY(-50%);

    transition:
        height 0.22s cubic-bezier(.16,1,.3,1);
}


.search-item:hover {
    background:
        linear-gradient(
            90deg,
            rgba(207,244,228,0.30),
            rgba(207,244,228,0.70)
        );

    color: #067c70;

    padding-right: 18px;

    transform: translateX(-2px);
}


.search-item:hover::before {
    height: 22px;
}


/* =========================================================
   KEYBOARD / ACCESSIBILITY
   ========================================================= */

.search-btn:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(255,255,255,0.95),
        0 0 0 6px rgba(7,145,130,0.28),
        0 10px 25px rgba(7,145,130,0.20);
}


#searchBox:focus-visible {
    outline: none;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    #search-container {
        top: 10px;

        width: calc(100vw - 20px);
    }


    .search-pill {
        min-height: 52px;

        padding: 5px;
    }


    #searchBox {
        height: 42px;

        padding:
            0 13px;

        font-size: 14px;
    }


    #searchBox::placeholder {
        font-size: 13px;
    }


    .search-btn {
        min-height: 42px;

        padding:
            0 16px;

        font-size: 13px;
    }


    #searchResults {
        margin-top: 8px;

        padding: 6px;

        border-radius: 18px;

        max-height: 55vh;
    }


    .search-item {
        min-height: 46px;

        padding:
            10px 12px;

        border-radius: 13px;
    }
}


/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 380px) {

    #search-container {
        width: calc(100vw - 14px);

        top: 7px;
    }


    .search-pill {
        min-height: 48px;

        padding: 4px;
    }


    #searchBox {
        height: 40px;

        padding:
            0 10px;

        font-size: 13px;
    }


    #searchBox::placeholder {
        font-size: 12px;
    }


    .search-btn {
        min-height: 40px;

        padding:
            0 13px;

        font-size: 12px;
    }
}


/* =========================================================
   ENTRANCE ANIMATION
   ========================================================= */

@keyframes sdr-search-enter {

    from {
        opacity: 0;

        transform:
            translateX(-50%)
            translateY(-14px)
            scale(0.96);

        filter: blur(4px);
    }

    to {
        opacity: 1;

        transform:
            translateX(-50%)
            translateY(0)
            scale(1);

        filter: blur(0);
    }
}


/* =========================================================
   RESULTS ANIMATION
   ========================================================= */

@keyframes sdr-results-enter {

    from {
        opacity: 0;

        transform:
            translateY(-8px)
            scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    #search-container,
    #searchResults {
        animation: none;
    }


    .search-pill,
    .search-btn,
    .search-btn::before,
    #searchBox,
    .search-item,
    .search-item::before {
        transition: none;
    }
}