/* ============================================================
   Advanced Search Panel — Sidebar
   Shared across: search.advanced, search.results,
                  conference.view, author.view
   Typography: var(--font-family) = 'Helvetica Neue', Helvetica, Arial
   ============================================================ */

/* --- Panel card wrapper ------------------------------------ */

.select2-container{
    margin-left: 0.5rem;
}



.search-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem 1.25rem 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}

/* --- Panel header ------------------------------------------ */
.search-panel .main-header {
    margin-bottom: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
}

.search-panel .header-1 {
    font-family: var(--font-family);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-top: 0;
    margin-bottom: 0.3rem;
}

.search-panel .sub-text {
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.55;
    margin-bottom: 0;
}

.search-panel .error-message {
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    color: #dc2626;
    display: block;
    min-height: 1.2rem;
    margin-top: 0.2rem;
}

/* --- Search term input rows -------------------------------- */

/* Vertically center every element inside a search-term row */
.search-panel .form-row {
    align-items: center !important;
}

/* The empty label above the first input adds invisible height
   that pushes the input below the "in" / dropdown baseline */
.search-panel .search-query label.form-label:empty {
    display: none !important;
}

/* Reset rogue negative margin-top from index.css */
.search-panel .search-query,
.search-panel .search-query-additional {
    margin-left: 0 !important;
    margin-top: 0 !important;
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--text-color);
}

/* "in" connector — kill Bootstrap mt-2 / mt-4, rely on flex centering */
.search-panel .form-row > .center-text,
.search-panel .form-row > .w-auto.center-text {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Select query wrappers — reset stray top margins from index.css */
.search-panel .select-query,
.search-panel .select-query-additional,
.search-panel .option-query-additional {
    margin-top: 0 !important;
    margin-left: 0 !important;
}

/* Add / remove icon buttons — vertically centred by flex, no extra margin */
.search-panel .add-button {
    margin-top: 0 !important;
    margin-left: 8px !important;
    display: flex;
    align-items: center;
    height: 100%;
}

.search-panel .close-button,
.search-panel .close-button-1 {
    margin-top: 0 !important;
    display: flex;
    align-items: center;
    height: 100%;
}

.search-panel .form-control.term {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 400;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    height: auto;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-panel .form-control.term:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
    outline: none;
}

.search-panel .form-control.term::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* --- Select dropdowns ------------------------------------- */
.search-panel .form-select.searchField,
.search-panel .form-select.operator {
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 400;
    color: #475569;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 1.75rem 0.45rem 0.65rem;
    transition: border-color 0.18s ease;
}

.search-panel .form-select.searchField:focus,
.search-panel .form-select.operator:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
    outline: none;
}

/* "in" connector text */
.search-panel .center-text p,
.search-panel .w-auto p {
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0;
}

/* --- Additional row spacing ------------------------------- */
.search-panel .option-query-additional {
    margin-top: 1.4rem;
    margin-left: 0;
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--text-color);
}

/* --- Section divider -------------------------------------- */
.search-panel .divider {
    margin: 0.9rem 0 0.5rem;
    opacity: 0.12;
    width: 100%;
}

/* --- Filter section labels -------------------------------- */

/* Override index.css margin-left: 10px so label aligns with the select below */
.search-panel .sub-text-1 {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin: 1rem 0 0.35rem 0 !important;
    padding-left: 0 !important;
}

/* The inner-col has Bootstrap ms-2 (8px left margin) which shifts the select
   away from the label above it — remove it so both align to the same edge */
.search-panel .inner-col {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* --- Select2 multi-select overrides ----------------------- */
.search-panel .select2-container--default .select2-selection--multiple {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    min-height: 38px;
    background: #f8fafc;
    padding: 0.2rem 0.5rem;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    transition: border-color 0.18s ease;
}

.search-panel .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent);
    background: #ffffff;
}

.search-panel .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-color);
    border: none;
    border-radius: 5px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 2px 8px;
}

.search-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.75);
    margin-right: 4px;
}

.search-panel .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffffff;
    background: transparent;
}

.search-panel .select2-container .select2-search--inline .select2-search__field {
    font-family: var(--font-family);
    font-size: 0.9rem;
    margin: 2px 0;
    height: 26px;
    color: #475569;
}

/* --- Add / Remove row icon buttons ------------------------ */
.search-panel .add-search-button,
.search-panel .remove-search-button {
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.search-panel .add-search-button--primary {
    color: var(--primary-color);
}

.search-panel .remove-search-button--danger {
    color: #dc2626;
}

.search-panel .add-search-button:hover {
    transform: scale(1.12);
    opacity: 0.85;
}

.search-panel .remove-search-button:hover {
    transform: scale(1.12);
    opacity: 0.85;
}

.search-panel .add-button {
    margin-top: 8px;
    margin-left: 12px;
}

/* --- Action buttons container ----------------------------- */
.search-panel__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.search-panel__actions .btn {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.5;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    flex: 1;
    transition: background-color 0.18s ease, border-color 0.18s ease,
                color 0.18s ease, box-shadow 0.18s ease;
    margin: 0;
}

/* Reset — ghost style */
.search-panel__actions .conference-reset-button {
    background: transparent;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
}

.search-panel__actions .conference-reset-button:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
    box-shadow: none !important;
}

/* Search — filled primary */
.search-panel__actions .conference-search-button {
    background: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    color: #ffffff;
}

.search-panel__actions .conference-search-button:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 35%, transparent) !important;
}

/* --- Right-side help panel (advanced.cfm) ----------------- */
.search-help-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem 2rem 2rem;
}

.search-help-panel .advanced-search-header {
    font-family: var(--font-family);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin-top: 0;
    margin-bottom: 0.2rem;
}

.search-help-panel .search-help-header {
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.search-help-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-help-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 400;
    color: #475569;
    line-height: 1.6;
}

.search-help-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 1px;
}

.search-help-tip {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: #64748b;
    line-height: 1.6;
    background: #f8fafc;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    margin-top: 0.25rem;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 575.98px) {
    .search-panel {
        padding: 1.25rem 1rem 1rem;
        border-radius: 10px;
    }

    .search-panel .header-1 {
        font-size: 1.05rem;
    }

    .search-panel__actions {
        flex-direction: column;
        gap: 0.4rem;
    }
}


/* ============================================================
   Conference Detail — Sidebar overrides (Figma 72-2914)
   Scoped to .conf-detail-page (set on body for category.list
   and item.view non-leaf pages in layouts/default.cfm)
   ============================================================ */

/* Legacy conference-detail sidebar (not compact-refine — that uses .search-panel--compact-refine below) */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .header-1 {
    font-size: var(--font-size-card-meta) !important;
    font-weight: 600 !important;
    color: #212529 !important;
    letter-spacing: -0.0762px !important;
    margin-bottom: 4px !important;
    line-height: 19.5px !important;
}

/* Underline accent: 28×2px #334155 beneath "Refine Results" */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .header-1::after {
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    background: #334155;
    border-radius: 9999px;
    margin-top: 4px;
}

/* Hide subtitle — Figma shows no subtitle below heading */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .sub-text {
    display: none !important;
}

/* Remove the hairline below the header block */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .main-header {
    border-bottom: none !important;
    margin-bottom: 10px !important;
}

/* Filter section labels: 12px, semi-bold, #6c757d, uppercase */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .sub-text-1 {
    font-size: var(--font-size-xs) !important;
    font-weight: 600 !important;
    color: #6c757d !important;
    letter-spacing: 0.6145px !important;
    text-transform: uppercase !important;
    margin-top: 10px !important;
    margin-bottom: 4px !important;
}

/* Filter option buttons (legacy .conf-filter-btn) */
.conf-detail-page .search-panel .conf-filter-btn {
    font-size: var(--font-size-card-badge);
    height: 28px;
    border-radius: 7px;
    color: #495057;
    background: transparent;
    border: none;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.conf-detail-page .search-panel .conf-filter-btn.active,
.conf-detail-page .search-panel .conf-filter-btn:hover {
    background: rgba(51, 65, 85, 0.08);
    color: #334155;
    font-weight: 600;
}

/* Legacy conf-detail actions — compact-refine uses .search-panel__actions--compact-refine */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-panel__actions {
    border-top: 1px solid #e9ecef !important;
    padding-top: 9px !important;
    margin-top: 1rem !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .conference-search-button {
    display: none !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .conference-reset-button {
    flex: 1 1 100% !important;
    width: 100% !important;
    height: 36px !important;
    border: 1px solid #1e40af !important;
    border-radius: 12px !important;
    color: #1e40af !important;
    background: transparent !important;
    font-size: var(--font-size-sm) !important;
    font-weight: 400 !important;
    letter-spacing: -0.4629px !important;
    text-align: center !important;
    line-height: 20px !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .conference-reset-button:hover {
    background: rgba(30, 64, 175, 0.06) !important;
    border-color: #1e40af !important;
    color: #1e40af !important;
    box-shadow: none !important;
}

/* ================================================================
   Applied filter chips bar  (search/_applied_filters.cfm)
   Grouped layout: "Filtered by:  Journal: WM2017 ×  |  Session Type: oral ×  Clear all"
   ================================================================ */

.applied-filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    margin-bottom: 0.875rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: var(--font-family);
    max-width: 100%;
    min-width: 0;
}

.applied-filters-bar.d-none {
    display: none !important;
}

/* "Filtered by:" prefix label */
.applied-filters-bar__prefix {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    margin-right: 0.125rem;
}

/* One group per filter category: "Journal: WM2017 × WM2022 ×" */
.applied-filters-bar__group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
}

/* "Journal:" / "Session Type:" label inside a group */
.applied-filters-bar__group-label {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    margin-right: 0.125rem;
}

/* Boolean operator connector (AND / OR / NOT) between search-term chip groups */
.applied-filters-bar__group-label--op {
    font-weight: 500;
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}

/* Individual dismissible chip */
.applied-filters-bar__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    text-decoration: none;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
    padding: 2px 9px 2px 10px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    min-width: 0;
    max-width: min(100%, 22rem);
}

.applied-filters-bar__chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.applied-filters-bar__chip:hover,
.applied-filters-bar__chip:focus {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
    text-decoration: none;
}

.applied-filters-bar__chip-x {
    font-size: 12px;
    line-height: 1;
    font-weight: 400;
    opacity: 0.55;
    margin-left: 1px;
    transition: opacity 0.12s ease;
    flex-shrink: 0;
}

.applied-filters-bar__chip:hover .applied-filters-bar__chip-x {
    opacity: 0.9;
}

/* Thin vertical separator between groups and "Clear all" */
.applied-filters-bar__divider {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: #cbd5e1;
    margin: 0 0.25rem;
    align-self: center;
    flex-shrink: 0;
}

.applied-filters-bar__clear-all {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: 500;
    color: #64748b;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.12s ease;
}

.applied-filters-bar__clear-all:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Keep legacy cdp-chip--dismiss working on other pages that haven't been updated */
.applied-filters-bar .cdp-chip--dismiss {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: rgb(55, 65, 81);
    border: 1px solid rgb(203, 213, 225);
    border-radius: 9999px;
    text-decoration: none;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.applied-filters-bar .cdp-chip--dismiss:hover,
.applied-filters-bar .cdp-chip--dismiss:focus {
    background: rgb(226, 232, 240);
    border-color: rgb(148, 163, 184);
    color: rgb(17, 24, 39);
    text-decoration: none;
}

/* ================================================================
   Session / Tag Chip-List  (replaces select2 for sessions + tags)
   Figma: 89-717 / 89-731 — 5 chips visible, rest scrollable
   ================================================================ */

.sp-chip-list {
    /* Block (not flex) — flex column + max-height + overflow-y is unreliable in Chrome */
    display: block;
    max-height: 183px; /* ~6 × 30px rows visible */
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0.25rem;
    padding-right: 2px;
}

.sp-chip-list::-webkit-scrollbar {
    width: 4px;
}

.sp-chip-list::-webkit-scrollbar-track {
    background: transparent;
}

.sp-chip-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sp-chip-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Every chip row — Figma: h-30px, rounded-7px, no border */
.sp-filter-chip {
    display: flex !important;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: var(--font-size-card-badge);
    line-height: 18px;
    font-weight: 400 !important;
    color: #495057;
    background: transparent;
    transition: background 0.1s ease;
    margin-bottom: 1px;   /* replaces gap: 1px from former flex parent */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.sp-filter-chip:hover {
    background: rgba(51, 65, 85, 0.05);
}

/* Active state — Figma: rgba(51,65,85,0.08), #334155, semibold */
.sp-filter-chip--active {
    background: rgba(51, 65, 85, 0.08);
    color: #334155;
    font-weight: 600;
}

.sp-filter-chip--active:hover {
    background: rgba(51, 65, 85, 0.12);
}

/* Checkbox hidden but still submitted with form (display:none is safe for inputs) */
.sp-filter-chip__input {
    display: none;
}

.sp-filter-chip__text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "All" chip is a <span> not a <label>, same visual rules */
.sp-filter-chip--all {
    user-select: none;
}

/* Responsive */
@media (max-width: 767px) {
    .sp-chip-list {
        max-height: 153px; /* 5 × 30px + 3px */
    }
}

/* ── Conference-detail sidebar surface (Figma 72-2914) ──────────
   Flat panel: bg #f8f9fa, border-right #e9ecef, no card shadow.
   Scoped to .conf-detail-page (body class for category.list +
   item.view non-leaf — set in layouts/default.cfm line 158).
   ─────────────────────────────────────────────────────────────── */
.conf-detail-page .search-content {
    padding: 12px 14px;
    min-height: 100%;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    box-sizing: border-box;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 14px 0 0 !important;
    margin: 0 !important;
}

/* Ensure sidebar occupies full height of its row */
.conf-detail-page .row.align-items-start {
    align-items: stretch !important;
}

/* ── Search input area (Figma 72-2914) ──────────────────────────
   44px, rounded-12px, bg #f8f9fa, search icon at left-14px.
   The "in" connector, field dropdown, and add-row button are
   hidden — the sidebar uses keyword-only search.
   ─────────────────────────────────────────────────────────────── */

/* Legacy keyword-only search hacks — compact-refine outputs icon.cfm + w-100 input */
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .select-query,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .add-button,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .add-search-button,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .w-auto,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-lg-4,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-lg-1,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-md-4,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-md-1,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-sm-4,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-sm-1,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-xs-4,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-xs-1 {
    display: none !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-lg-5,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-md-5,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-sm-5,
.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container .row.form-row > .col-xs-5 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding-right: 0 !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .form-control.term {
    height: 44px !important;
    border-radius: 12px !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    font-size: var(--font-size-sm) !important;
    color: #212529 !important;
    padding-left: 44px !important;
    padding-right: 12px !important;
    box-shadow: none !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .form-control.term::placeholder {
    color: #adb5bd !important;
    font-size: var(--font-size-sm) !important;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-query {
    position: relative;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-query::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23adb5bd' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.846-3.846a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-terms-container {
    margin-bottom: 8px;
}

.conf-detail-page .search-panel:not(.search-panel--compact-refine) .search-section-label {
    display: block;
    font-size: var(--font-size-xs) !important;
    font-weight: 600 !important;
    color: #6c757d !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6145px !important;
    margin-bottom: 6px;
}

/* Mobile/tablet: collapse toggle replaces sidebar separator — no bottom rule */
@media (max-width: 991.98px) {
    .conf-detail-page .search-content {
        border-right: none;
        border-bottom: none;
        min-height: unset;
        padding-right: 0;
    }
}

/* ================================================================
   Compact refine sidebar — author.view, item.view, category.list
   Shared UX: full-width search, chips, stacked Reset + Search
   ================================================================ */

.search-panel--compact-refine {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.search-panel--compact-refine .main-header {
    margin-bottom: 0.625rem !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.search-panel--compact-refine .header-1 {
    margin-bottom: 0 !important;
    font-size: var(--font-size-base) !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
    color: #212529 !important;
}

.search-panel--compact-refine .sub-text {
    margin: 0.25rem 0 0 !important;
    padding: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
    letter-spacing: 0.01em !important;
    color: #9ca3af !important;
    white-space: normal !important;
}

.search-panel--compact-refine .error-message {
    min-height: 0 !important;
    margin-top: 0 !important;
}

.search-panel--compact-refine .error-message:empty {
    display: none !important;
}

.search-panel--compact-refine > .row {
    max-width: 100%;
}

.search-panel--compact-refine .search-panel__actions--compact-refine {
    max-width: 100%;
}

.search-panel--compact-refine .sub-text-1 {
    font-size: var(--font-size-xs) !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #6c757d !important;
    margin: 0 0 0.375rem !important;
    margin-left: 0 !important;
}

.search-panel--compact-refine .search-section-label {
    font-size: var(--font-size-xs) !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6c757d !important;
    margin: 0.625rem 0 0.375rem !important;
}

.search-panel--compact-refine .search-terms-container {
    margin-bottom: 16px !important;
}

.search-panel--compact-refine > .row.g-0 > .col-12 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.search-panel--compact-refine .col-lg-12 > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    --bs-gutter-x: 0;
}

.search-panel--compact-refine .col-lg-12.col-md-12.col-sm-12 {
    margin-bottom: 16px;
}

.search-panel--compact-refine .col-lg-12.col-md-12.col-sm-12:last-of-type {
    margin-bottom: 0;
}

.search-panel--compact-refine .select2-container {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.search-panel--compact-refine .select2-container--default .select2-selection--multiple {
    min-height: 38px !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    padding: 4px 10px !important;
    align-items: center;
}

.search-panel--compact-refine .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0 4px 0 0 !important;
}

.search-panel--compact-refine .select2-container--default .select2-selection--multiple .select2-search__field {
    margin-top: 0 !important;
    font-size: var(--font-size-sm) !important;
}

.search-panel--compact-refine .author-search-input-wrap__icon {
    pointer-events: none;
    z-index: 2;
}

.search-panel--compact-refine .author-search-input-wrap__icon svg {
    width: 14px;
    height: 14px;
}

.search-panel--compact-refine .author-search-input-wrap__input {
    height: 38px !important;
    min-height: 38px !important;
    font-size: var(--font-size-sm) !important;
    line-height: 1.4 !important;
    border: 1px solid #ced4da !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #212529 !important;
}

.search-panel--compact-refine .author-search-input-wrap__input:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15) !important;
}

.search-panel--compact-refine .author-search-input-wrap__input::placeholder {
    color: #6c757d !important;
    font-size: var(--font-size-sm) !important;
}

.search-panel__actions--compact-refine {
    margin-top: 0;
    padding-top: 9px !important;
    border-top: 1px solid #e9ecef;
}

.search-panel__actions--compact-refine .search-panel__action-icon {
    margin-left: 0;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Action buttons: icons follow button label color (not global --color-icon) */
.search-panel__actions--compact-refine .conference-reset-button .app-icon,
.search-panel__actions--compact-refine .conference-search-button .app-icon {
    color: currentColor !important;
    margin-right: 0;
}

.search-panel__actions--compact-refine .conference-reset-button,
.search-panel__actions--compact-refine .conference-search-button {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 0.875rem !important;
    font-size: var(--font-size-sm) !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: 0.01em !important;
    border-radius: 7px !important;
    margin: 0 !important;
}

.search-panel--compact-refine .sp-chip-list--compact-refine .sp-filter-chip {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.search-panel--compact-refine .search-section-label,
.search-panel--compact-refine .sub-text-1,
.search-panel--compact-refine .inner-col,
.search-panel--compact-refine .sp-chip-list--compact-refine {
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.search-panel__actions--compact-refine .conference-reset-button {
    background: #ffffff !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
}

.search-panel__actions--compact-refine .conference-reset-button:hover {
    background: #f8f9fa !important;
    color: #495057 !important;
}

.search-panel__actions--compact-refine .conference-search-button {
    background: #334155 !important;
    border: none !important;
    color: #ffffff !important;
}

.search-panel__actions--compact-refine .conference-search-button:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

@media (max-width: 991.98px) {
    .search-panel--compact-refine {
        max-width: 100%;
    }

    .search-panel--compact-refine .sub-text {
        white-space: normal !important;
    }

    .search-panel__actions--compact-refine {
        max-width: none;
    }
}

/* ================================================================
   Advanced refine sidebar — search.view, search.results, search.advanced
   Multi-field rows preserved; aligned chips + stacked actions
   ================================================================ */

/* Neutralize legacy .search-content rules from conference-detail.css + custom.css */
.search-content--advanced-refine {
    margin-bottom: 0 !important;
    padding: 0 !important;
    align-self: stretch !important;
}

.search-content--advanced-refine .main-header {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0.625rem !important;
}

.search-content--advanced-refine .select-query.flex-grow-1,
.search-content--advanced-refine .select-query-additional.flex-grow-1 {
    min-width: 0;
}

.search-panel--advanced-refine {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.search-panel--advanced-refine .main-header {
    margin-bottom: 0.625rem !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.search-panel--advanced-refine .header-1 {
    margin-bottom: 0 !important;
    font-size: var(--font-size-base) !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
    color: #212529 !important;
}

.search-panel--advanced-refine .sub-text {
    margin: 0.25rem 0 0 !important;
    padding: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
    letter-spacing: 0.01em !important;
    color: #9ca3af !important;
    white-space: normal !important;
}

.search-panel--advanced-refine .error-message {
    min-height: 0 !important;
    margin-top: 0 !important;
}

.search-panel--advanced-refine .error-message:empty {
    display: none !important;
}

.search-panel--advanced-refine > .row {
    max-width: 100%;
}

.search-panel--advanced-refine > .row.g-0 > .col-12 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.search-panel--advanced-refine .sub-text-1 {
    font-size: var(--font-size-xs) !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #6c757d !important;
    margin: 0.625rem 0 0.375rem !important;
    margin-left: 0 !important;
}

.search-panel--advanced-refine .search-terms-container {
    margin-bottom: 12px !important;
}

.search-panel--advanced-refine .form-control.term,
.search-panel--advanced-refine .form-select.searchField,
.search-panel--advanced-refine .form-select.operator {
    min-height: 38px;
    font-size: var(--font-size-sm) !important;
    border-radius: 6px !important;
}

/* Operator select (And / Or / Not) collapses to ~45px with w-auto — ensure it is
   wide enough to be readable and tappable on mobile */
.search-panel--advanced-refine .form-select.operator {
    min-width: 88px;
}

/* Inline search rows: input 75%, select 25% — fixed ratio, no expansion on long option text */
.search-panel--advanced-refine .search-query-1,
.search-panel--advanced-refine .search-query-additional {
    flex: 3 1 0 !important;
    min-width: 0;
}
.search-panel--advanced-refine .select-query-1,
.search-panel--advanced-refine .select-query-additional {
    flex: 1 1 auto !important;
    min-width: 120px;
}
.search-panel--advanced-refine .select-query-1 .searchField,
.search-panel--advanced-refine .select-query-additional .searchField {
    width: 100% !important;
    min-width: 120px;
}

.search-panel--advanced-refine .add-button,
.search-panel--advanced-refine .close-button {
    margin: 0 !important;
}

.search-panel--advanced-refine .sp-chip-list--advanced-refine .sp-filter-chip {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.search-panel--advanced-refine .sub-text-1,
.search-panel--advanced-refine .sp-chip-list--advanced-refine {
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.search-panel__actions--advanced-refine {
    margin-top: 0;
    padding-top: 9px !important;
    border-top: 1px solid #e9ecef;
}

.search-panel__actions--advanced-refine .search-panel__action-icon {
    margin-left: 0;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.search-panel__actions--advanced-refine .conference-reset-button .app-icon,
.search-panel__actions--advanced-refine .conference-search-button .app-icon {
    color: currentColor !important;
    margin-right: 0;
}

.search-panel__actions--advanced-refine .conference-reset-button,
.search-panel__actions--advanced-refine .conference-search-button {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 0.875rem !important;
    font-size: var(--font-size-sm) !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    letter-spacing: 0.01em !important;
    border-radius: 7px !important;
    margin: 0 !important;
}

.search-panel__actions--advanced-refine .conference-reset-button {
    background: #ffffff !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6 !important;
}

.search-panel__actions--advanced-refine .conference-reset-button:hover {
    background: #f8f9fa !important;
    color: #495057 !important;
}

.search-panel__actions--advanced-refine .conference-search-button {
    background: #334155 !important;
    border: none !important;
    color: #ffffff !important;
}

.search-panel__actions--advanced-refine .conference-search-button:hover {
    background: #1e293b !important;
    color: #ffffff !important;
}

@media (max-width: 991.98px) {
    .search-content--advanced-refine {
        width: 100%;
        padding-right: 0 !important;
    }

    .search-panel--advanced-refine {
        max-width: 100%;
    }

    .search-panel__actions--advanced-refine {
        max-width: none;
    }

    .search-help-panel {
        padding-top: 0 !important;
    }

    .search-help-panel .advanced-search-header {
        margin-top: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .search-panel--advanced-refine .sp-chip-list--advanced-refine {
        max-height: 153px;
    }

    .search-help-list li {
        font-size: 0.9375rem;
    }

    /* On very narrow phones: let the inline row wrap so input is full-width
       and the "in [select] [btn]" group sits on the next line */
    .search-panel--advanced-refine .search-terms-container .d-flex.flex-nowrap {
        flex-wrap: wrap !important;
        gap: 0.375rem !important;
    }
    .search-panel--advanced-refine .search-query-1,
    .search-panel--advanced-refine .search-query-additional {
        flex: 1 1 100% !important;
    }
}

/* ============================================================
   Filter Modal (#filterModal) — matches compact-refine / controls bar
   ============================================================ */

.filter-modal {
  border: 1px solid var(--color-border, #e9ecef);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
}

.filter-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.filter-modal__header-text {
  min-width: 0;
  flex: 1 1 auto;
}

.filter-modal__title {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--color-text, #212529);
}

.filter-modal__subtitle {
  margin: 0.35rem 0 0;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-secondary, #6c757d);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.filter-modal__close {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.filter-modal__body {
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;
}

.filter-modal__label {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6c757d;
}

.filter-modal__input,
.filter-modal .form-select.filter-modal__input {
  width: 100%;
  min-height: 38px;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.4;
  color: #212529;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-modal__input::placeholder {
  color: #adb5bd;
}

.filter-modal__input:focus,
.filter-modal .form-select.filter-modal__input:focus {
  border-color: var(--primary-color, #1e40af);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #1e40af) 12%, transparent);
  outline: none;
}

.filter-modal .select2-container {
  width: 100% !important;
  max-width: 100%;
}

.filter-modal .select2-container--default .select2-selection--multiple {
  min-height: 38px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px 8px;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
}

.filter-modal .select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--primary-color, #1e40af);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #1e40af) 12%, transparent);
}

.filter-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
  max-width: calc(100% - 8px);
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1e40af;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 2px 8px;
  margin-top: 3px;
}

.filter-modal .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.filter-modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #64748b;
  margin-right: 4px;
  border-right: none;
}

.filter-modal .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #1e40af;
  background: transparent;
}

.filter-modal .select2-container .select2-search--inline .select2-search__field {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  margin-top: 2px;
  color: #475569;
}

.filter-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}

.filter-modal__clear-link {
  text-decoration: none;
}

.filter-modal__btn {
  min-height: 38px;
  padding: 0 1rem;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.35;
  border-radius: 8px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-modal__btn--secondary {
  background: #ffffff;
  border: 1px solid #dee2e6;
  color: #6c757d;
}

.filter-modal__btn--secondary:hover {
  background: #f8f9fa;
  border-color: #ced4da;
  color: #495057;
}

.filter-modal__btn--primary {
  background: #334155;
  border: 1px solid #334155;
  color: #ffffff;
}

.filter-modal__btn--primary:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}

@media (max-width: 575.98px) {
  .filter-modal__header,
  .filter-modal__body,
  .filter-modal__footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .filter-modal__footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .filter-modal__footer .filter-modal__clear-link,
  .filter-modal__footer .filter-modal__btn {
    width: 100%;
  }

  .filter-modal__footer .filter-modal__clear-link .filter-modal__btn {
    width: 100%;
  }
}

/* -- Mobile: reduce search-help-panel horizontal padding on phones -- */
@media (max-width: 575.98px) {
  .search-help-panel {
    padding: 1.25rem 1rem 1.25rem;
  }
}

/* ================================================================
   Chip-group inline filter (.sp-chip-filter)
   Shown above a chip list when there are more than 5 options.
   Pure client-side — input has no name so it is never submitted.
   ================================================================ */
.sp-chip-filter {
    position: relative;
}

.sp-chip-filter__input {
    display: block;
    width: 100%;
    height: 28px;
    padding: 0 8px 0 26px;
    font-size: var(--font-size-xs, 0.75rem);
    font-family: var(--font-family);
    color: #475569;
    background-color: #f8fafc;
    /* magnifying-glass icon embedded as data URI */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.846-3.846a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 7px center;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.sp-chip-filter__input:focus {
    border-color: var(--primary-color, #334155);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #334155) 12%, transparent);
}

.sp-chip-filter__input::placeholder {
    color: #94a3b8;
    font-size: var(--font-size-xs, 0.75rem);
}

.sp-chip-filter__no-match {
    display: block;
    font-size: var(--font-size-xs, 0.75rem);
    font-family: var(--font-family);
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 4px 0 2px;
}

/* Applied by JS when a chip doesn't match the filter query.
   Must use !important to beat .sp-filter-chip { display: flex !important } */
.sp-filter-chip--filtered-out {
    display: none !important;
}
