/* ── Local SearchBar — full design from the React component ──────────────
   HTML stays the original Kendo markup; localSearchDesign.js injects the
   extra elements (clear / hint / submit / helper). All visibility is
   driven by classes on .k-searchbox: .sb-focused, .sb-has-value,
   .sb-submitting.
*/

:root {
    --sb-primary:        #004d9a;
    --sb-primary-dark:   #003a75;
    --sb-primary-soft:   rgba(0, 77, 154, 0.18);
    --sb-primary-glow:   rgba(0, 77, 154, 0.10);
    --sb-border:         #d8dde6;
    --sb-border-hover:   #b0bccf;
    --sb-icon-bg:        #f0f2f5;
    --sb-icon-bg-active: #e6eef8;
    --sb-icon-fg:        #8a95a3;
    --sb-text:           #1a2232;
    --sb-placeholder:    #aab2be;
    --sb-muted:          #f0f2f5;
}

/* ── outer box (rounded, glass bg) ────────────────────────────────────── */
.k-searchbox.sb-enhanced {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    border-radius: 14px !important;
    border: 1.5px solid var(--sb-border) !important;
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 3px 10px !important;
    transition: background 0.3s ease;
    box-shadow: none !important;
}
.k-searchbox.sb-enhanced:hover,
.k-searchbox.sb-enhanced.sb-focused {
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: none !important;
}

/* ── left search icon (boxed pill) — hidden when has-value ─────────────── */
.k-searchbox.sb-enhanced .k-input-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--sb-icon-bg);
    color: var(--sb-icon-fg);
    font-size: 14px;
    margin: 0 !important;
    transition: background 0.3s ease, color 0.3s ease,
                width 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
}
.k-searchbox.sb-enhanced.sb-focused .k-input-icon {
    background: var(--sb-icon-bg-active);
    color: var(--sb-primary);
}
.k-searchbox.sb-enhanced.sb-has-value .k-input-icon {
    width: 0;
    opacity: 0;
    transform: scale(0.85);
    margin-right: -10px !important;
    overflow: hidden;
    pointer-events: none;
}

/* ── input ─────────────────────────────────────────────────────────────── */
.k-searchbox.sb-enhanced .LocalSearchField,
.k-searchbox.sb-enhanced .k-input-inner {
    flex: 1 1 auto;
    min-width: 0;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 13.5px !important;
    color: var(--sb-text) !important;
    line-height: 1.4;
    padding: 6px 4px !important;
    box-shadow: none !important;
}
.k-searchbox.sb-enhanced .LocalSearchField::placeholder,
.k-searchbox.sb-enhanced .k-input-inner::placeholder {
    color: var(--sb-placeholder);
    opacity: 1;
}

/* ── clear button (X) — visible when has-value & not submitting ───────── */
.k-searchbox.sb-enhanced .sb-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #2a2f3a;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
}
.k-searchbox.sb-enhanced .sb-clear:hover {
    background: var(--sb-muted);
    color: #000;
}
.k-searchbox.sb-enhanced.sb-has-value:not(.sb-submitting) .sb-clear {
    display: flex;
    animation: sbFadeIn 0.2s ease;
}

/* ── Enter hint pill — visible when focused + has-value & not submitting */
.k-searchbox.sb-enhanced .sb-hint {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--sb-border);
    background: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    font-weight: 500;
    color: var(--sb-icon-fg);
    user-select: none;
    flex-shrink: 0;
}
.k-searchbox.sb-enhanced .sb-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 3px;
    border-radius: 4px;
    background: var(--sb-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--sb-text);
    border: none;
    box-shadow: none;
    line-height: 1;
}
.k-searchbox.sb-enhanced.sb-focused.sb-has-value:not(.sb-submitting) .sb-hint {
    display: flex;
    animation: sbSlideInRight 0.2s ease;
}
@media (max-width: 575px) {
    .k-searchbox.sb-enhanced .sb-hint { display: none !important; }
}

/* ── submit button (right) — visible when has-value ───────────────────── */
.k-searchbox.sb-enhanced .sb-submit {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: var(--sb-primary);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 12px var(--sb-primary-soft);
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
.k-searchbox.sb-enhanced .sb-submit:hover {
    background: var(--sb-primary-dark);
    transform: scale(1.06);
    box-shadow: 0 4px 18px rgba(0, 77, 154, 0.35);
}
.k-searchbox.sb-enhanced .sb-submit:active {
    transform: scale(0.94);
}
.k-searchbox.sb-enhanced.sb-has-value .sb-submit {
    display: flex;
    animation: sbSlideInRight3 0.25s ease;
}
.k-searchbox.sb-enhanced.sb-submitting .sb-submit {
    opacity: 0.8;
    cursor: default;
}
.k-searchbox.sb-enhanced .sb-submit-icon { display: inline-block; }
.k-searchbox.sb-enhanced .sb-submit-spinner { display: none; }
.k-searchbox.sb-enhanced.sb-submitting .sb-submit-icon { display: none; }
.k-searchbox.sb-enhanced.sb-submitting .sb-submit-spinner { display: inline-block; }

/* Force white icon color regardless of theme/utility CSS overrides */
.k-searchbox.sb-enhanced .sb-submit i,
.k-searchbox.sb-enhanced .sb-submit .fa,
.k-searchbox.sb-enhanced .sb-submit-icon,
.k-searchbox.sb-enhanced .sb-submit-spinner {
    color: #fff !important;
}

/* ── kill conflicting Kendo styling ────────────────────────────────────── */
.k-searchbox.sb-enhanced.k-input-solid { box-shadow: none; }
.k-searchbox.sb-enhanced .k-input-inner:focus { box-shadow: none !important; outline: none !important; }

/* ── animations ───────────────────────────────────────────────────────── */
@keyframes sbFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes sbSlideInRight {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes sbSlideInRight3 {
    from { opacity: 0; transform: translateX(12px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
