
/* =========================================================
   04. LIVE SEARCH FEEDBACK — MAIN CONTAINER
========================================================= */

.faq-library-search-feedback {
    --feedback-accent: var(--success);

    position: relative;
    isolation: isolate;

    display: flex;
    align-items: center;
    gap: 13px;

    width: fit-content;
    max-width: min(100%, 560px);
    margin: 17px auto 0;
    padding: 13px 19px;

    overflow: hidden;

    color: var(--text);

    background: linear-gradient(
        115deg,
        color-mix(
            in srgb,
            var(--feedback-accent) 7%,
            var(--surface)
        ),
        var(--surface) 76%
    );

    border: 1px solid color-mix(
        in srgb,
        var(--feedback-accent) 22%,
        var(--border)
    );

    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.8;
    text-align: start;

    transform-origin: top center;

    animation: faqFeedbackReveal 420ms
        cubic-bezier(.16, 1, .3, 1) both;

    transition:
        background 250ms ease,
        border-color 250ms ease,
        box-shadow 250ms ease,
        color 250ms ease;
}

/* Respect the HTML hidden attribute */
.faq-library-search-feedback[hidden] {
    display: none !important;
}

/* Subtle ambient highlight */
.faq-library-search-feedback::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;

    background: radial-gradient(
        circle at 0% 50%,
        color-mix(
            in srgb,
            var(--feedback-accent) 13%,
            transparent
        ),
        transparent 66%
    );

    opacity: .8;
    pointer-events: none;
}

/* Animated brand accent */
.faq-library-search-feedback::before {
    content: "";
    position: absolute;

    inset-block: 12px;
    inset-inline-start: 0;

    width: 3px;
    border-radius: 4px;

    background: var(--feedback-accent);

    transform: scaleY(.25);
    transform-origin: center;

    animation: faqAccentGrow 500ms 100ms ease-out both;
}

/* =========================================================
   05. STATUS INDICATOR
========================================================= */

.faq-library-search-feedback__indicator {
    position: relative;

    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;
    flex: 0 0 30px;

    border-radius: 10px;

    color: var(--feedback-accent);

    background: color-mix(
        in srgb,
        var(--feedback-accent) 12%,
        var(--surface)
    );

    animation: faqIndicatorReveal 500ms
        80ms cubic-bezier(.16, 1, .3, 1) both;
}

/* Expanding animated ring */
.faq-library-search-feedback__indicator::before {
    content: "";
    position: absolute;
    inset: -4px;

    border: 1px solid var(--feedback-accent);
    border-radius: 13px;

    opacity: 0;

    animation: faqIndicatorRing 1.9s 300ms ease-out infinite;
}

/* Inner glowing dot */
.faq-library-search-feedback__indicator::after {
    content: "";

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: currentColor;

    box-shadow: 0 0 12px color-mix(
        in srgb,
        var(--feedback-accent) 40%,
        transparent
    );
}

/* =========================================================
   06. FEEDBACK TEXT
========================================================= */

.faq-library-search-feedback__text {
    display: block;
    min-width: 0;

    color: var(--text);
    overflow-wrap: anywhere;
    letter-spacing: .05px;
}

/* Matching results */
.faq-library-search-feedback:not(.is-empty) {
    --feedback-accent: var(--success);
}

/* =========================================================
   07. NO RESULTS STATE
========================================================= */

.faq-library-search-feedback.is-empty {
    --feedback-accent: var(--primary);

    background: linear-gradient(
        115deg,
        color-mix(
            in srgb,
            var(--primary) 9%,
            var(--surface)
        ),
        var(--surface) 76%
    );

    border-color: color-mix(
        in srgb,
        var(--primary) 28%,
        var(--border)
    );

    box-shadow:
        var(--shadow-sm),
        0 0 0 3px color-mix(
            in srgb,
            var(--primary) 5%,
            transparent
        );
}

.faq-library-search-feedback.is-empty
.faq-library-search-feedback__indicator {
    border-radius: 50%;

    background: color-mix(
        in srgb,
        var(--primary) 12%,
        var(--surface)
    );
}

/* =========================================================
   08. ANIMATIONS
========================================================= */

@keyframes faqFeedbackReveal {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(.96);
        filter: blur(3px);
    }

    70% {
        opacity: 1;
        transform: translateY(2px) scale(1.005);
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes faqIndicatorReveal {
    0% {
        opacity: 0;
        transform: scale(.55) rotate(-12deg);
    }

    70% {
        opacity: 1;
        transform: scale(1.12) rotate(3deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes faqIndicatorRing {
    0% {
        transform: scale(.8);
        opacity: .5;
    }

    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

@keyframes faqAccentGrow {
    from {
        transform: scaleY(.25);
        opacity: .4;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* =========================================================
   09. DARK THEME
========================================================= */

html[data-theme="dark"] .faq-library-search-feedback {
    background: linear-gradient(
        115deg,
        color-mix(
            in srgb,
            var(--feedback-accent) 9%,
            var(--surface)
        ),
        var(--surface) 76%
    );

    border-color: color-mix(
        in srgb,
        var(--feedback-accent) 24%,
        var(--border)
    );

    box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .faq-library-search__clear {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

html[data-theme="dark"] .faq-library-search__clear:hover {
    color: #fff;

    background: color-mix(
        in srgb,
        var(--primary) 18%,
        var(--surface)
    );

    border-color: color-mix(
        in srgb,
        var(--primary) 35%,
        var(--border)
    );
}

/* =========================================================
   10. RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 600px) {
    .faq-library-search-feedback {
        width: 100%;
        max-width: 100%;

        margin-top: 13px;
        padding: 11px 14px;
        gap: 11px;

        border-radius: var(--radius-sm);

        font-size: 12px;
        line-height: 1.75;
    }

    .faq-library-search-feedback__indicator {
        width: 27px;
        height: 27px;
        flex-basis: 27px;

        border-radius: 9px;
    }

    .faq-library-search-feedback::before {
        inset-block: 10px;
    }

    .faq-library-search__clear {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
        font-size: 20px;
    }

    .faq-library-search__button {
        gap: 7px;
    }

    .faq-library-search__button svg {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
}

/* =========================================================
   11. KEYBOARD ACCESSIBILITY
========================================================= */

.faq-library-search__clear:focus-visible,
.faq-library-search__button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* =========================================================
   12. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .faq-library-search-feedback,
    .faq-library-search-feedback::before,
    .faq-library-search-feedback__indicator,
    .faq-library-search-feedback__indicator::before {
        animation: none !important;
        filter: none !important;
        transition: none !important;
    }

    .faq-library-search__field,
    .faq-library-search__icon,
    .faq-library-search__clear,
    .faq-library-search__button,
    .faq-library-search__button svg {
        transition: none !important;
    }
}
