/* B4M Search — floating button + popup. Everything scoped under .b4ms_ */

/* reCAPTCHA v3 badge is hidden site-wide (attribution text lives in the
   footer, as Google's FAQ requires). Duplicated here in case a page loads
   without the footer snippet. */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* Floating search button, docked left of the Help bubble (JS sets --b4ms-right) */
.b4ms_fab {
    position: fixed !important;
    bottom: 24px !important;
    right: var(--b4ms-right, 24px) !important;
    width: 46px !important;
    height: 46px !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
    color: #4fc3f7 !important;
    font-size: 17px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(79, 195, 247, 0.35) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 999998 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.b4ms_fab:hover {
    transform: translateY(-2px) !important;
    color: #ffffff !important;
    box-shadow: 0 15px 35px rgba(79, 195, 247, 0.35), 0 0 0 1px rgba(79, 195, 247, 0.6) !important;
}

/* Overlay + modal */
.b4ms_overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(6, 6, 15, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 1000001 !important;
    display: none !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 12vh 16px 24px !important;
    opacity: 0 !important;
    transition: opacity 0.25s ease !important;
}

.b4ms_overlay.b4ms_open {
    display: flex !important;
    opacity: 1 !important;
}

.b4ms_modal {
    width: 100% !important;
    max-width: 620px !important;
    background: linear-gradient(160deg, #14142a, #1a1a2e) !important;
    border: 1px solid rgba(79, 195, 247, 0.25) !important;
    border-radius: 14px !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55) !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 72vh !important;
    overflow: hidden !important;
    transform: translateY(-12px) !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.b4ms_overlay.b4ms_open .b4ms_modal {
    transform: translateY(0) !important;
}

/* Input row */
.b4ms_inputwrap {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
}

.b4ms_input_icon {
    color: #4fc3f7 !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
}

.b4ms_input {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #e8e8f2 !important;
    font-size: 17px !important;
    padding: 4px 0 !important;
    min-width: 0 !important;
}

.b4ms_input::placeholder {
    color: #6b7280 !important;
}

.b4ms_close {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: #9ca3af !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.b4ms_close:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
}

/* Results */
.b4ms_results {
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 !important;
    min-height: 0 !important;
    padding: 6px 8px 10px !important;
}

.b4ms_status {
    padding: 26px 18px !important;
    text-align: center !important;
    color: #6b7280 !important;
    font-size: 14px !important;
}

.b4ms_group_label {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #4fc3f7 !important;
    padding: 12px 12px 4px !important;
}

.b4ms_item {
    display: block !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: background 0.15s ease !important;
}

.b4ms_item:hover,
.b4ms_item.b4ms_active {
    background: rgba(79, 195, 247, 0.12) !important;
}

.b4ms_item_title {
    display: block !important;
    color: #e8e8f2 !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin-bottom: 2px !important;
}

.b4ms_item_excerpt {
    display: block !important;
    color: #9ca3af !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.b4ms_item mark {
    background: rgba(79, 195, 247, 0.28) !important;
    color: inherit !important;
    border-radius: 3px !important;
    padding: 0 1px !important;
}

/* Footer */
.b4ms_footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 10px 18px !important;
    flex-shrink: 0 !important;
    min-height: 20px !important;
}

.b4ms_seeall {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #4fc3f7 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.b4ms_seeall:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Visibility toggle — must be a class with !important because the component
   rules above also use !important (inline style.display would lose). */
.b4ms_hidden {
    display: none !important;
}

/* Mobile */
@media (max-width: 480px) {
    .b4ms_fab {
        bottom: 16px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 16px !important;
    }

    .b4ms_overlay {
        padding: 8px !important;
        align-items: stretch !important;
    }

    .b4ms_modal {
        max-height: none !important;
        height: calc(100dvh - 16px) !important;
        max-width: none !important;
    }
}
