/* AI mode frame + glow */
.site-search-container.ai-active {
    position: relative;
    border: 0 !important;
    border-radius: var(--tblr-border-radius-lg);
    box-shadow: 0 8px 28px rgba(76, 110, 245, .18), 0 0 0 2px rgba(76, 110, 245, .25) inset;
    transition: box-shadow .3s ease, background .3s ease;
    background: linear-gradient(180deg, #fff, #fafbff);
}

.site-search-container.ai-active:focus {
    border: 0 !important;
    box-shadow: 0 12px 48px rgba(76, 110, 245, .25), 0 0 0 3px rgba(76, 110, 245, .35) inset;
    background: linear-gradient(180deg, #fff, #f0f3ff);
}

.input-group-flat.ai-active:focus-within .form-control,
.input-group-flat.ai-active:focus-within .input-group-text {
    border-color: transparent !important;
    transition: border-color 0s ease;

}

/* Animated border using gradient mask */
.site-search-container.ai-active::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: var(--tblr-border-radius-lg);
    padding: 2px;
    background: linear-gradient(120deg, #6ea8fe, #a78bfa, #ffd166, #6ea8fe);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: aiBorder 3s linear infinite;
    pointer-events: none;
}
/* ai-active .ajanswork-ai-search-btn span hide */
.site-search-container.ai-active .site-search-btns .ajanswork-ai-search-btn span {
    display: none!important;
}

@keyframes aiBorder {
    0% {
        filter: hue-rotate(0deg);
        opacity: .85;
    }

    50% {
        filter: hue-rotate(90deg);
        opacity: 1;
    }

    100% {
        filter: hue-rotate(180deg);
        opacity: .85;
    }
}

/* Wand pulse + rotate */
.site-search-container.ai-active .ajanswork-ai-search-btn .icon {
    animation: wandSpin 1.2s ease-in-out infinite;
    transform-origin: 50% 55%;
}

.site-search-container.ai-active .ajanswork-ai-search-btn span {
    display: none;
}

@keyframes wandSpin {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(76, 110, 245, .0));
    }

    50% {
        transform: rotate(12deg) scale(1.05);
        filter: drop-shadow(0 0 4px rgba(76, 110, 245, .5));
    }
}

/* Typing dots after label */



/* Subtle shimmer behind inputs while AI active */
.site-search-container.ai-active .site-search-input {
    background:
        linear-gradient(100deg, rgba(255, 255, 255, 0) 40%, rgba(76, 110, 245, .08) 50%, rgba(255, 255, 255, 0) 60%) no-repeat;
    background-size: 200% 100%;
    animation: shimmer 2.2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Make textarea look like the input */
.site-search-textarea {
    resize: none;
    min-height: 48px;
    max-height: 220px;
    line-height: 1.4;
    transition: min-height .2s ease;
}

/* Optional: “AI” tiny badge in the left icon when active */
.site-search-container.ai-active .site-search-icon {
    position: relative;
}

.site-search-container.ai-active .site-search-icon::after {
    content: "AI";
    position: absolute;
    right: -6px;
    top: -8px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    z-index: 999;
    background: #4c6ef5;
    border-radius: 6px;
    padding: 1px 4px;
    box-shadow: 0 2px 6px rgba(76, 110, 245, .35);
}

/* Floating AI badge */
/* Floating AI badge that follows cursor */
.ai-cursor-badge {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    color: #fff;
    background: linear-gradient(120deg, #4c6ef5, #7950f2);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.9);
    transition: opacity .2s ease, transform .2s ease;
}

.ai-cursor-badge.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Optional: subtle AI-mode glow around the container */
.site-search-container.ai-active {
    position: relative;
    border-radius: .75rem;
    box-shadow: 0 8px 28px rgba(76, 110, 245, .18), 0 0 0 2px rgba(76, 110, 245, .25) inset;
    background: linear-gradient(180deg, #fff, #fafbff);
    transition: box-shadow .25s ease, background .25s ease;
}

.site-search-container.ai-active .site-search-input,
.site-search-container.ai-active .site-search-textarea {
    caret-color: #4c6ef5;
    /* Ajanswork AI brand blue */
}

/* start collapsed (~1 row) */
.site-search-textarea {
    line-height: 1.4;
    font-size: 14px;
    min-height: calc(1.4em * 1);
    transition: min-height 0.3s ease;
    resize: none;
    overflow: hidden;
}

/* expand to 4 rows when we add the class */
.site-search-textarea.ai-expand {
    min-height: calc(1.4em * 4);
}

.btn-ai {
    background: linear-gradient(120deg, #4c6ef5, #7950f2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--tblr-border-radius);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 110, 245, .25);
    transition: background 0.3s ease, box-shadow 0.3s ease, width 0.3s ease;
}

.btn-ai:hover {
    background: linear-gradient(120deg, #4c6ef5, #7950f2);
    color: white !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--tblr-border-radius);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 110, 245, .25);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}