/* ============================================================
   OMNI-SEARCH v5 PATCH
   Supplements omni-search.css with styles for:
     1. Collapse / Expand toggle button on the Smart Search row
     2. Overflow badge on QF bar ("+N more applied")
     3. Overflow toast notification
     4. Collapsed state body hiding
   ============================================================ */

/* ── 1. Toggle button (collapse/expand Smart Search) ────── */
.omni-nlp-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b0bac6;
    font-size: 0.78rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.25s var(--omni-spring, cubic-bezier(0.34,1.56,0.64,1));
    padding: 0;
    order: -1; /* Leftmost element */
}

    .omni-nlp-toggle:hover {
        background: rgba(245, 130, 32, 0.1);
        color: var(--omni-orange, #F58220);
        transform: scale(1.15);
    }

    .omni-nlp-toggle:active {
        transform: scale(0.92);
    }

/* ── 2. Collapsible body (input area + clear btn) ──────── */
.omni-nlp-body {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
    overflow: hidden;
    max-height: 48px;
    transition: max-height 0.32s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.28s ease;
    opacity: 1;
}

/* Collapsed state — body folds away, row shrinks to label only */
.omni-nlp-row.omni-nlp-collapsed .omni-nlp-body {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.omni-nlp-row.omni-nlp-collapsed {
    padding-top: 6px;
    padding-bottom: 6px;
    min-height: unset;
}

    /* The label stays visible in collapsed state as a "breadcrumb" */
    .omni-nlp-row.omni-nlp-collapsed .omni-nlp-left {
        opacity: 0.55;
    }

/* ── 3. Overflow badge on QF header ─────────────────────── */
.omni-qf-overflow-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(245,130,32,0.15), rgba(245,130,32,0.08));
    border: 1px solid rgba(245,130,32,0.35);
    color: var(--omni-orange, #F58220);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 9px;
    border-radius: 20px;
    margin-left: 8px;
    white-space: nowrap;
    animation: overflow-badge-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    cursor: default;
    vertical-align: middle;
}

    .omni-qf-overflow-badge i {
        font-size: 0.6rem;
        animation: nlp-star-pulse 2s infinite alternate ease-in-out;
    }

@keyframes overflow-badge-in {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── 4. Overflow toast (bottom-right notification) ─────── */
.omni-overflow-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--omni-black, #1A1D20);
    color: #fff;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.28s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
}

    .omni-overflow-toast i {
        color: var(--omni-orange, #F58220);
        font-size: 0.85rem;
    }

    .omni-overflow-toast.visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ── 5. Responsive ──────────────────────────────────────── */
@media (max-width: 767px) {
    .omni-overflow-toast {
        bottom: 16px;
        right: 12px;
        left: 12px;
        justify-content: center;
        border-radius: 16px;
    }

    .omni-qf-overflow-badge {
        font-size: 0.62rem;
        padding: 2px 7px;
    }
}

/* ============================================================
   OMNI-SEARCH v6 PATCH — NLP-First QF Mode
   Styles for the NLP chip bar that replaces standard QF widgets
   while Smart Search is active.
   ============================================================ */

/* ── NLP Chip Bar (replaces #qfInputs while typing) ──────── */
.omni-nlp-chip-bar {
    display: none; /* shown via JS in NLP mode */
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px 12px;
    min-height: 54px;
    animation: nlp-bar-in 0.28s var(--omni-spring, cubic-bezier(0.34,1.56,0.64,1)) both;
}

@keyframes nlp-bar-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Individual NLP result chip ──────────────────────────── */
.omni-nlp-result-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(245,130,32,0.12), rgba(245,130,32,0.06));
    border: 1.5px solid rgba(245,130,32,0.38);
    border-radius: 24px;
    padding: 5px 10px 5px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--omni-black, #1A1D20);
    cursor: default;
    animation: chip-pop-in 0.32s var(--omni-spring, cubic-bezier(0.34,1.56,0.64,1)) both;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .omni-nlp-result-chip:hover {
        border-color: rgba(245,130,32,0.65);
        box-shadow: 0 3px 12px rgba(245,130,32,0.18);
    }

@keyframes chip-pop-in {
    from {
        opacity: 0;
        transform: scale(0.75) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.omni-nlp-chip-icon {
    color: var(--omni-orange, #F58220);
    font-size: 0.68rem;
    animation: nlp-star-pulse 2s infinite alternate ease-in-out;
    line-height: 1;
}

.omni-nlp-chip-label {
    letter-spacing: 0.01em;
    line-height: 1;
}

/* Remove (×) button on each chip */
.omni-nlp-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: rgba(245,130,32,0.15);
    color: var(--omni-orange, #F58220);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    transition: background 0.18s ease, transform 0.18s ease;
    line-height: 1;
}

    .omni-nlp-chip-remove:hover {
        background: rgba(245,130,32,0.35);
        transform: scale(1.2);
    }

/* ── Empty hint (no matches yet while typing) ────────────── */
.omni-nlp-chip-hint {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    font-weight: 500;
    padding: 4px 0;
    animation: nlp-bar-in 0.28s ease both;
}

/* ── QF row in NLP mode — subtle orange left accent ─────── */
#qfRow.nlp-mode-active {
    border-left: 3px solid rgba(245,130,32,0.5);
}

    #qfRow.nlp-mode-active .qf-title::after {
        content: ' — Describing';
        font-size: 0.65rem;
        font-weight: 600;
        color: var(--omni-orange, #F58220);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-left: 6px;
        opacity: 0.8;
        animation: nlp-bar-in 0.3s ease both;
    }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .omni-nlp-chip-bar {
        padding: 8px 12px 10px;
        gap: 6px;
    }

    .omni-nlp-result-chip {
        font-size: 0.73rem;
        padding: 4px 8px 4px 7px;
    }
}

@media (max-width: 480px) {
    .omni-nlp-result-chip {
        font-size: 0.7rem;
        padding: 4px 7px 4px 6px;
    }

    .omni-nlp-chip-hint {
        font-size: 0.7rem;
    }
}
/* ============================================================
   OMNI-SEARCH v7 PATCH
   Additional styles for new v7 additions:
     1. Overflow disclaimer bar below the NLP chip bar
     2. Main filter panel section count badges (Rooms, Price)
     3. Ensure action buttons (.omni-nlp-actions) are wired into
        the body layout correctly (flex row with input wrapper)
   ============================================================ */

/* ── 1. Overflow disclaimer ────────────────────────────────── */
.omni-nlp-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 7px 16px 9px;
    font-size: 0.73rem;
    color: #6b7280;
    font-style: italic;
    border-top: 1px dashed rgba(245,130,32,0.18);
    background: rgba(245,130,32,0.03);
    animation: nlp-bar-in 0.3s ease both;
    line-height: 1.45;
}

    .omni-nlp-disclaimer strong {
        color: var(--omni-orange, #F58220);
        font-style: normal;
    }

@media (max-width: 767px) {
    .omni-nlp-disclaimer {
        padding: 6px 12px 8px;
        font-size: 0.7rem;
    }
}

/* ── 2. Main filter panel — section count badges ────────────── */
/* These badges sit inside .fp-sec-header alongside the title.
   The HTML must have <span id="fpRoomsBadge" class="fp-sec-badge"></span>
   and <span id="fpPriceBadge" class="fp-sec-badge"></span> inside their
   respective section header elements.                           */
.fp-sec-badge {
    display: none; /* hidden until .visible is added via JS */
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--omni-orange, #F58220);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-left: 6px;
    line-height: 1;
    vertical-align: middle;
    animation: fp-badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

    .fp-sec-badge.visible {
        display: inline-flex;
    }

@keyframes fp-badge-pop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

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

/* Ensure section header has the right flex layout to accommodate badge */
.fp-sec-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── 3. Action buttons layout fix ──────────────────────────── */
/* The omni-nlp-input-wrapper takes up most space; actions sit at the end */
.omni-nlp-body {
    gap: 8px;
}

.omni-nlp-input-wrapper {
    flex: 1;
    min-width: 0;
}
/* ============================================================
   OMNI-SEARCH v8 PATCH
   All additional styles for v8 enhancements:
     1. Overflow disclaimer bar below the NLP chip bar
     2. Main filter panel section count badges (Rooms, Price)
     3. Action buttons layout (.omni-nlp-actions — confirm, edit, clear)
     4. Locked input state (.omni-nlp-locked / .omni-nlp-is-locked)
     5. Edit (pen) button in locked state
     6. Semantic region chips (globe icon, tinted background)
     7. Hidden helper utility
   ============================================================ */

/* ── 0. Utility ──────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── 1. Overflow disclaimer ──────────────────────────────────── */
.omni-nlp-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 7px 16px 9px;
    font-size: 0.73rem;
    color: #6b7280;
    font-style: italic;
    border-top: 1px dashed rgba(245,130,32,0.18);
    background: rgba(245,130,32,0.03);
    animation: nlp-bar-in 0.3s ease both;
    line-height: 1.45;
}

    .omni-nlp-disclaimer strong {
        color: var(--omni-orange, #F58220);
        font-style: normal;
    }

@media (max-width: 767px) {
    .omni-nlp-disclaimer {
        padding: 6px 12px 8px;
        font-size: 0.7rem;
    }
}

/* ── 2. Main filter panel section count badges ───────────────── */
.fp-sec-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--omni-orange, #F58220);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-left: 6px;
    line-height: 1;
    vertical-align: middle;
    animation: fp-badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

    .fp-sec-badge.visible {
        display: inline-flex;
    }

@keyframes fp-badge-pop {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

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

.fp-sec-header {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── 3. Action buttons layout ────────────────────────────────── */
.omni-nlp-body {
    gap: 8px;
}

.omni-nlp-input-wrapper {
    flex: 1;
    min-width: 0;
}

/* Action button row */
.omni-nlp-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Base style shared by all action buttons */
.omni-nlp-confirm,
.omni-nlp-edit,
.omni-nlp-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: transparent;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    font-size: 0.8rem;
    padding: 0;
    line-height: 1;
}

/* Confirm ✓ — green accent */
.omni-nlp-confirm {
    color: #16a34a;
    border-color: #16a34a;
}

    .omni-nlp-confirm:hover {
        background: #16a34a;
        color: #fff;
        transform: scale(1.1);
    }

/* Edit ✏ — blue accent */
.omni-nlp-edit {
    color: #2563eb;
    border-color: #2563eb;
}

    .omni-nlp-edit:hover {
        background: #2563eb;
        color: #fff;
        transform: scale(1.1);
    }

/* Clear ✗ — neutral / red on hover */
.omni-nlp-clear {
    color: #6b7280;
    border-color: #d1d5db;
}

    .omni-nlp-clear:hover {
        border-color: #ef4444;
        color: #ef4444;
        transform: scale(1.1);
    }

/* ── 4. Locked input state ───────────────────────────────────── */
/*
  When the user presses ✓ the row gets .omni-nlp-is-locked.
  The input itself gets .omni-nlp-locked (readonly).
  Visual effect: dimmed text, lock icon cursor, faint sealed border.
*/
.omni-nlp-real-input.omni-nlp-locked {
    color: #374151;
    background: rgba(245, 130, 32, 0.04);
    cursor: not-allowed;
    caret-color: transparent;
    border-color: rgba(245, 130, 32, 0.35);
    border-style: dashed;
}

/* Locked row gets a subtle orange-tinted left border accent */
.omni-nlp-row.omni-nlp-is-locked {
    border-left: 3px solid rgba(245, 130, 32, 0.5);
}

    /* Lock icon overlay on the visualizer when locked */
    .omni-nlp-row.omni-nlp-is-locked .omni-nlp-input-wrapper::after {
        content: '\F4C0'; /* Bootstrap Icons: bi-lock-fill codepoint */
        font-family: 'bootstrap-icons';
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(245,130,32,0.45);
        font-size: 0.75rem;
        pointer-events: none;
    }

/* Ensure input wrapper is positioned for the lock overlay */
.omni-nlp-input-wrapper {
    position: relative;
}

/* Locked state label hint */
.omni-nlp-row.omni-nlp-is-locked .omni-nlp-label::after {
    content: ' (locked)';
    font-size: 0.65rem;
    color: rgba(245,130,32,0.6);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ── 5. Semantic region chips ────────────────────────────────── */
/*
  Semantic region chips (e.g. "Business Hubs", "Coastal Areas")
  get a tinted map-pin icon and a slightly different colour scheme
  to distinguish them from plain filter chips.
*/
.omni-nlp-result-chip[data-type*="semanticLocation"] {
    background: rgba(37, 99, 235, 0.07);
    border-color: rgba(37, 99, 235, 0.25);
}

    .omni-nlp-result-chip[data-type*="semanticLocation"] .omni-nlp-chip-icon i {
        color: #2563eb;
    }

    .omni-nlp-result-chip[data-type*="semanticLocation"] .omni-nlp-chip-label {
        color: #1d4ed8;
        font-weight: 600;
    }

    /* Tooltip on semantic chip to hint that it adds multiple locations */
    .omni-nlp-result-chip[data-type*="semanticLocation"]::after {
        content: attr(title);
    }

/* ── 6. Subtype chip — property icon tint ────────────────────── */
.omni-nlp-result-chip[data-type="subtype"] {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.25);
}

    .omni-nlp-result-chip[data-type="subtype"] .omni-nlp-chip-icon i {
        color: #7c3aed;
    }

    .omni-nlp-result-chip[data-type="subtype"] .omni-nlp-chip-label {
        color: #6d28d9;
        font-weight: 600;
    }

/* ── 7. Overflow badge ───────────────────────────────────────── */
.omni-qf-overflow-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--omni-orange, #F58220);
    background: rgba(245,130,32,0.08);
    border: 1px dashed rgba(245,130,32,0.35);
    cursor: help;
    white-space: nowrap;
}

/* ── 8. Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
    .omni-nlp-confirm,
    .omni-nlp-edit,
    .omni-nlp-clear {
        width: 26px;
        height: 26px;
        font-size: 0.72rem;
    }

    .omni-nlp-actions {
        gap: 3px;
    }
}


/* ============================================================
   SMART SEARCH v8 PATCH ADDITIONS
   1. Collapsed tab pill shows "Smart Search" (via main CSS pseudo-content)
   2. QF row "Describing" annotation uses new label text
   3. Continuous-line visual consistency for the 3-row stack
   ============================================================ */

/* QF row annotation shows "Describe It" mode indicator */
#qfRow.nlp-mode-active .qf-title::after {
    content: ' \2014 Describe It Active';
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--omni-orange, #F58220);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-left: 6px;
    opacity: 0.85;
    animation: nlp-bar-in 0.3s ease both;
}

/* Ensure collapsed toggle pill font matches brand */
.omni-nlp-row.omni-nlp-collapsed .omni-nlp-toggle::before {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: var(--omni-orange, #F58220);
    text-transform: uppercase;
}
