/* =============================================
   Full‐width search bar (under navbar) + blur dropdown
   ============================================= */

/* Toggle button — matches the theme's other nav icon buttons
   (.menu-toggle, .novapulse-dark-toggle): 40x40, round, subtle border,
   accent color on hover. */
.sta-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle, rgba(128,128,128,0.25));
    border-radius: 999px;
    color: var(--nav-text, inherit);
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
body.scheme-light .sta-search-toggle {
    border-color: transparent;
}
.sta-search-toggle:hover {
    opacity: 1;
    color: var(--nav-hover, var(--link-color, inherit));
    background-color: rgba(0,0,0,0.04);
    border-color: var(--link-color, var(--border-subtle));
}
.sta-search-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Search bar container – no background/border of its own, just positions
   the input. All visible styling (background, rounding) lives on the
   input field itself now. */
.sta-search-bar {
    position: fixed;
    left: 0;
    width: 100%;
    z-index: 9999;
    top: var(--header-height, 78px);
    background: none;
    border: none;
    box-shadow: none;
    animation: staSlideDown 0.2s ease;
}

/* Mobile navbar height */
@media (max-width: 768px) {
    .sta-search-bar {
        top: var(--header-height, 70px);
    }
}

@keyframes staSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Inner container – centered, max-width */
.sta-search-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 16px;
}

/* Text input — the only visible surface now: rounded, translucent
   theme-derived background (no separate bar background behind it). */
.sta-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 18px;
    font-family: inherit;
    border: 2px solid var(--input-border, #ccc);
    border-radius: 10px;
    background: color-mix(in srgb, var(--input-bg, #fff) 90%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--input-text, inherit);
    outline: none;
    box-sizing: border-box;
    box-shadow: var(--card-shadow, 0 2px 12px rgba(0,0,0,0.08));
    transition: border-color 0.25s;
}
.sta-search-input:focus {
    border-color: var(--input-focus-border, var(--link-color));
}
.sta-search-input::placeholder {
    color: var(--input-placeholder, #888);
    opacity: 1;
}

/* Results container – rounded, blur, theme colors */
.sta-search-results {
    margin-top: 6px;
    border-radius: var(--card-radius, 14px);
    overflow: hidden;
    /* Semi‐transparent background from theme + blur */
    background: color-mix(in srgb, var(--card-bg, #fff) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    box-shadow: var(--card-shadow, 0 8px 24px rgba(0,0,0,0.1));
    max-height: 60vh;
    overflow-y: auto;
}

/* Single result link */
.sta-search-results a {
    display: block;
    padding: 12px 18px;
    color: var(--heading-color, #111);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-subtle, rgba(128,128,128,0.1));
    transition: background 0.15s, color 0.15s;
}
.sta-search-results a:last-child {
    border-bottom: none;
}
.sta-search-results a:hover,
.sta-search-results a:focus {
    background: var(--link-color-soft, rgba(128,128,128,0.08));
    color: var(--link-color, inherit);
    outline: none;
}
.sta-search-results small {
    opacity: 0.7;
    margin-left: 8px;
    font-size: 0.85em;
}

/* Messages */
.sta-no-results,
.sta-error {
    padding: 16px 18px;
    text-align: center;
    opacity: 0.8;
    font-size: 14px;
    color: var(--body-text, inherit);
}
.sta-error {
    color: #c0392b;
}
