/*!
==================================================================
  EDUCEET — Header search overlay
==================================================================
  PHP: educeet_header_search() in inc/template-helper.php (wp_footer)
       template-parts/header/header-1.php (the trigger)
  JS : assets/js/script.js, "Search Js"
  Enqueue: inc/common/theme-scripts.php (handle: educeet-header-search)
==================================================================
*/

/* header search button */


/* ── Backdrop ───────────────────────────────────────────────── */
.oit-search-body-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(4, 10, 14, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
}

.oit-search-body-overlay.apply {
    opacity: 1;
    visibility: visible;
}

/* ── The panel ───────────────────────────────────────────────
   ------------------------------------------------------------ */
.oit-search-form-toggle {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 99999;
    padding: 48px 0 64px;
    background: rgba(11, 20, 22, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 0 0 28px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    transform: translateY(-101%);
    visibility: hidden;
    transition: transform .5s cubic-bezier(.22, 1, .36, 1), visibility .5s;
}

.oit-search-form-toggle.search-active {
    transform: translateY(0);
    visibility: visible;
}

.admin-bar .oit-search-form-toggle {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .oit-search-form-toggle {
        top: 46px;
    }
}

/* ── Logo row ────────────────────────────────────────────────
   ------------------------------------------------------------ */
.oit-search-form-logo img {
    width: 140px;
    height: auto;
    opacity: .9;
    transition: opacity .3s ease;
}

.oit-search-form-logo:hover img {
    opacity: 1;
}

/* ── Close button ────────────────────────────────────────────
   ------------------------------------------------------------ */
.oit-search-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    color: var(--oit-clr-white, #fff);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, transform .3s ease;
}

.oit-search-close:hover,
.oit-search-close:focus-visible {
    border-color: var(--oit-clr-green, #88DE7D);
    background: var(--oit-clr-green, #88DE7D);
    color: var(--oit-clr-black, #11383F);
    transform: rotate(90deg);
}

.oit-search-close:focus-visible {
    outline: 2px solid var(--oit-clr-green, #88DE7D);
    outline-offset: 3px;
}

/* ── The form ────────────────────────────────────────────────
   ------------------------------------------------------------ */
.oit-search-form {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .4s ease, transform .4s ease;
}

.oit-search-form-toggle.search-active .oit-search-form {
    opacity: 1;
    transform: translateY(0);
    transition-delay: .18s;
}

.oit-search-form-input {
    position: relative;
    border-radius: 14px;
}

.oit-search-form-input input {
    display: block;
    width: 100%;
    height: 66px;
    padding: 0 68px 0 24px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    color: var(--oit-clr-white, #fff);
    font-size: 18px;
    font-weight: 500;
    line-height: 66px;
    outline: 0;
    transition: background-color .3s ease, border-color .3s ease;
}

.oit-search-form-input input:focus {
    border-color: rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .09);
}

.oit-search-form-input input::placeholder {
    color: rgba(255, 255, 255, .55);
    font-weight: 400;
}

.oit-search-focus-border {
    position: absolute;
    inset: 0;
    border: 1px solid var(--oit-clr-green, #88DE7D);
    border-radius: 14px;
    box-shadow: 0 0 0 4px rgba(136, 222, 125, .14);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.oit-search-form-input input:focus ~ .oit-search-focus-border {
    opacity: 1;
}

.oit-search-form-icon {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, .8);
    font-size: 19px;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease;
}

.oit-search-form-icon:hover,
.oit-search-form-icon:focus-visible {
    background: var(--oit-clr-green, #88DE7D);
    color: var(--oit-clr-black, #11383F);
}

.oit-search-form-icon:focus-visible {
    outline: 2px solid var(--oit-clr-green, #88DE7D);
    outline-offset: 2px;
}

/* ── Narrow screens ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .oit-search-form-toggle {
        padding: 28px 0 40px;
        border-radius: 0 0 20px 20px;
    }

    .oit-search-form-logo img {
        width: 112px;
    }

    .oit-search-close {
        width: 44px;
        height: 44px;
        font-size: 17px;
    }

    .oit-search-form-input input {
        height: 56px;
        padding: 0 58px 0 18px;
        font-size: 16px;
        line-height: 56px;
    }

    .oit-search-form-icon {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .oit-search-form-toggle,
    .oit-search-body-overlay,
    .oit-search-form,
    .oit-search-close,
    .oit-search-focus-border {
        transition-duration: .01ms;
        transition-delay: 0s;
    }

    .oit-search-close:hover {
        transform: none;
    }
}
