/* =============================================================================
   UXArmy — Live Search  [uxarmy_live_search]
   Full-width overlay, left-to-right input expansion, scrollable results.
   ============================================================================= */

/* ── Body scroll lock when overlay is open ────────────────────────────────── */
.uxarmy-search-is-open {
    overflow: hidden;
}

/* ── Trigger button ───────────────────────────────────────────────────────── */
.uxarmy-search-widget {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.uxarmy-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #0f2030;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.uxarmy-search-trigger:hover {
    background: #f0f5fa;
    color: #1579c8;
}

.uxarmy-search-trigger:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

/* ── Backdrop ─────────────────────────────────────────────────────────────── */
.uxarmy-search-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(15, 32, 48, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.uxarmy-search-backdrop.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ── Overlay panel ────────────────────────────────────────────────────────── */
.uxarmy-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    box-shadow: 0 4px 32px rgba(15, 32, 48, 0.14);
    /* Slide in from top */
    transform: translateY(-110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.uxarmy-search-overlay.is-open {
    transform: translateY(0);
}

/* ── Header row (search bar) ──────────────────────────────────────────────── */
.uxarmy-search-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 32px;
    border-bottom: 1.5px solid #eef2f6;
}

/* ── Form wrap — the left-to-right animated container ────────────────────── */
.uxarmy-search-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f4f7fa;
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 0;
    /* Left-to-right reveal: starts fully clipped from the right */
    clip-path: inset(0 100% 0 0 round 12px);
    transition:
        clip-path    0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
        border-color 0.18s ease,
        background   0.18s ease;
}

.uxarmy-search-overlay.is-open .uxarmy-search-form-wrap {
    clip-path: inset(0 0% 0 0 round 12px);
}

.uxarmy-search-form-wrap:focus-within {
    border-color: #1579c8;
    background: #ffffff;
}

/* ── Search icon inside form ──────────────────────────────────────────────── */
.uxarmy-search-icon {
    flex-shrink: 0;
    display: inline-flex;
    color: #8a9baa;
    transition: color 0.18s ease;
}

.uxarmy-search-form-wrap:focus-within .uxarmy-search-icon {
    color: #1579c8;
}

/* ── Text input ───────────────────────────────────────────────────────────── */
.uxarmy-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #0f2030;
    -webkit-appearance: none;
    appearance: none;
}

.uxarmy-search-input::placeholder {
    color: #b0bec8;
}

/* Remove browser's built-in clear button */
.uxarmy-search-input::-webkit-search-cancel-button,
.uxarmy-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* ── Clear (×) button ─────────────────────────────────────────────────────── */
.uxarmy-search-clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #aab8c4;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.uxarmy-search-clear:hover {
    background: #eef2f6;
    color: #5a6b7a;
}

/* ── Close text button ────────────────────────────────────────────────────── */
.uxarmy-search-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #5a6b7a;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.uxarmy-search-close:hover {
    background: #f0f5fa;
    color: #0f2030;
}

.uxarmy-search-close:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

/* ── Results body ─────────────────────────────────────────────────────────── */
.uxarmy-search-body {
    max-height: calc(100vh - 74px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 32px 28px;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar */
.uxarmy-search-body::-webkit-scrollbar        { width: 5px; }
.uxarmy-search-body::-webkit-scrollbar-track  { background: transparent; }
.uxarmy-search-body::-webkit-scrollbar-thumb  { background: #d0dae4; border-radius: 3px; }
.uxarmy-search-body::-webkit-scrollbar-thumb:hover { background: #aab8c4; }

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.uxarmy-search-loading {
    display: none;
    padding: 36px 0;
    text-align: center;
}

.uxarmy-search-loading.is-visible {
    display: block;
}

/* Spinner reuses the keyframe already defined in elementor-tag-filter.css */
.uxarmy-search-loading .uxarmy-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #dce8f2;
    border-top-color: #1579c8;
    border-radius: 50%;
    animation: uxarmy-spin 0.75s linear infinite;
}

/* ── Results count ────────────────────────────────────────────────────────── */
.uxarmy-results-count {
    margin: 0;
    padding: 18px 0 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0f2030;
}

/* ── Result list ──────────────────────────────────────────────────────────── */
.uxarmy-search-results-list {
    /* intentionally empty — populated by JS */
}

/* ── Single result item ───────────────────────────────────────────────────── */
.uxarmy-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 12px 18px 0;
    border-bottom: 1px solid #eef2f6;
    text-decoration: none;
    color: inherit;
    border-radius: 0;
    transition: background 0.15s ease, padding-left 0.15s ease;
}

.uxarmy-result-item:last-child {
    border-bottom: none;
}

.uxarmy-result-item:hover {
    background: #f7fafc;
    padding-left: 10px;
}

.uxarmy-result-content {
    flex: 1;
    min-width: 0;
}

/* ── Type label (ARTICLE / TAG / GUIDE …) ─────────────────────────────────── */
.uxarmy-result-type {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #8a9baa;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* ── Title ────────────────────────────────────────────────────────────────── */
.uxarmy-result-title {
    margin: 0 0 6px;
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: #0f2030;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}

.uxarmy-result-item:hover .uxarmy-result-title {
    color: #1579c8;
}

/* ── Snippet ──────────────────────────────────────────────────────────────── */
.uxarmy-result-snippet {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #5a6b7a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Keyword highlight (matches the Lyssna mint/teal highlight in screenshot) */
.uxarmy-result-snippet mark {
    background: #c0f0e8;
    color: inherit;
    font-style: normal;
    border-radius: 3px;
    padding: 0 3px;
}

/* ── Arrow ────────────────────────────────────────────────────────────────── */
.uxarmy-result-arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f5fa;
    color: #1579c8;
    font-size: 16px;
    line-height: 1;
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.uxarmy-result-item:hover .uxarmy-result-arrow {
    background: #1579c8;
    color: #ffffff;
    transform: translateX(4px);
}

/* ── Empty / error state ──────────────────────────────────────────────────── */
.uxarmy-search-empty {
    padding: 36px 0;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #8a9baa;
    text-align: center;
    margin: 0;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
    .uxarmy-search-header {
        padding: 12px 16px;
        gap: 10px;
    }

    .uxarmy-search-body {
        padding: 0 16px 20px;
    }

    .uxarmy-result-title {
        font-size: 16px;
    }

    .uxarmy-result-item {
        gap: 12px;
        padding: 14px 10px 14px 0;
    }

    .uxarmy-result-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .uxarmy-search-close {
        padding: 6px 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .uxarmy-search-form-wrap {
        padding: 8px 12px;
    }

    .uxarmy-search-input {
        font-size: 15px;
    }

    .uxarmy-result-type {
        display: none; /* save space on very small screens */
    }
}
