/* alignvu UI v2.1: the feeds menu (application/views/comparable_filter_menu.php), split from css/v21_app.css */

/* ---------- Feeds menu (application/views/comparable_filter_menu.php): a cascading v2.1 menu. The panel and each
   flyout are raised menu surfaces; rows highlight on hover, the open row stays highlighted and the chosen feed is
   ticked. js/modules/shared/ui/feed_menu.js places each open flyout beside its row and inside the window (long lists
   scroll). */
.vendor-filter-menu {
    font-family: var(--font-display);
    color: var(--body-ink);
}

.vendor-filter-menu .source-filter-menu-toggle-button {
    width: var(--control-height);
    height: var(--control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--heading-ink);
    box-shadow: 0 1px 3px rgba(26, 26, 46, 0.12);
    cursor: pointer;
}

.vendor-filter-menu .source-filter-menu-toggle-button:hover {
    background: var(--fill);
}

.vendor-filter-menu .vendor-filter-menu-container {
    width: 320px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.16);
}

.vendor-filter-menu .app-feedmenu__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--row-rule);
}

.vendor-filter-menu .app-feedmenu__head .filterMenuCloseButton {
    box-shadow: none;
    margin-right: auto;
}

.vendor-filter-menu .app-feedmenu__head .filter-menu-comparable-container {
    flex-basis: 100%;
}

.vendor-filter-menu .sources-main-container {
    max-height: calc(100vh - var(--app-sticky-top) - 80px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
    gap: 8px;
}

.vendor-filter-menu .source-selection[data-sourcetype="secondary"] {
    padding-top: 8px;
    border-top: 1px solid var(--row-rule);
}

/* rows that open a flyout: the panel's "Select a primary feed" and every list level */
.vendor-filter-menu .source-type-container > :is(h2, p).source-type {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto;
    min-height: 36px;
    margin: 0;
    padding: 0 8px 0 12px;
    border-radius: var(--radius-sm);
    font: 400 14px/20px var(--font-display);
    font-style: normal;
    color: var(--heading-ink);
    cursor: pointer;
}

.vendor-filter-menu .source-type-container > :is(h2, p).selection-heading.source-type {
    font-weight: 600;
}

.vendor-filter-menu .source-type-container > .source-type:hover,
.vendor-filter-menu .source-type-container:has(> .sources-container[data-status="active"]) > .source-type {
    background: var(--fill);
}

/* the ">" after each row's name, drawn as the v2.1 chevron */
.vendor-filter-menu .source-type > span:last-child {
    flex: none;
    width: 16px;
    height: 16px;
    font-size: 0;
    background: var(--muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
}

/* flyouts: v2.1 menu surfaces, placed in the window by feed_menu.js */
.vendor-filter-menu .source-selection .sources-container[data-group] {
    position: fixed;
    top: 0;
    width: max-content;
    min-width: 220px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(26, 26, 46, 0.12);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vendor-filter-menu .source-selection .sources-container[data-group] .selection-sources {
    gap: 0;
}

/* feeds to choose */
.vendor-filter-menu .source-selection .sources-container .source-container[onclick] {
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font: 400 14px/20px var(--font-display);
    color: var(--heading-ink);
}

.vendor-filter-menu .source-selection .sources-container .source-container[onclick]:hover {
    background: var(--fill);
}

.vendor-filter-menu .source-selection .sources-container .source-container[onclick].selected {
    background: none;
    font-weight: 600;
}

.vendor-filter-menu .source-selection .sources-container .source-container[onclick].selected::after {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    margin-left: auto;
    background: var(--heading-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E") center / 16px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.vendor-filter-menu .source-selection .sources-container .source-container[onclick].disabled {
    background: none;
    color: var(--muted);
}

/* the chosen feeds under each heading, each with a remove button */
.vendor-filter-menu .selected-sources {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vendor-filter-menu .selected-sources .source-container.deselectsource {
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    font: 400 13px/18px var(--font-display);
    color: var(--body-ink);
}

.vendor-filter-menu .selected-sources .deselectsource .datafeed-source-vendor-name {
    color: var(--muted);
}

.vendor-filter-menu .selected-sources .deselectsource img {
    display: none;
}

.vendor-filter-menu .selected-sources .deselectsource > p:last-child {
    flex: none;
    width: 16px;
    height: 16px;
    background: var(--muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 14px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.vendor-filter-menu .selected-sources .deselectsource:hover > p:last-child {
    background: var(--heading-ink);
}

/* feed types a screen does not offer (comparable_filter_menu.php's $feedMenuExclude) */
.vendor-filter-menu[data-exclude-primary~="Issuer"] .source-selection[data-sourcetype="primary"] .source-type-container[data-type="Issuer"],
.vendor-filter-menu[data-exclude-primary~="Internal"] .source-selection[data-sourcetype="primary"] .source-type-container[data-type="Internal"],
.vendor-filter-menu[data-exclude-primary~="Aggregator"] .source-selection[data-sourcetype="primary"] .source-type-container[data-type="Aggregator"],
.vendor-filter-menu[data-exclude-primary~="Integration"] .source-selection[data-sourcetype="primary"] .source-type-container[data-type="Integration"],
.vendor-filter-menu[data-exclude-secondary~="Issuer"] .source-selection[data-sourcetype="secondary"] .source-type-container[data-type="Issuer"],
.vendor-filter-menu[data-exclude-secondary~="Internal"] .source-selection[data-sourcetype="secondary"] .source-type-container[data-type="Internal"],
.vendor-filter-menu[data-exclude-secondary~="Aggregator"] .source-selection[data-sourcetype="secondary"] .source-type-container[data-type="Aggregator"],
.vendor-filter-menu[data-exclude-secondary~="Integration"] .source-selection[data-sourcetype="secondary"] .source-type-container[data-type="Integration"] {
    display: none;
}

/* the last list: each provider's name as a heading over its feeds, in one flyout */
.vendor-filter-menu .source-selection .sources-container[data-group].app-feedmenu__feeds {
    position: static;
    display: flex;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}

.vendor-filter-menu .app-feedmenu__provider + .app-feedmenu__provider {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--row-rule);
}

.vendor-filter-menu .app-feedmenu__provider-name {
    margin: 0;
    padding: 8px 12px 4px;
    font: 600 12px/16px var(--font-display);
    color: var(--muted);
}

/* feeds sit a little in from their provider's name */
.vendor-filter-menu .source-selection .app-feedmenu__feeds .source-container[onclick] {
    padding-left: 24px;
}

/* the chosen feed's name in bold (the global p rule in css/application.css would otherwise reset its weight) */
.vendor-filter-menu .source-selection .sources-container .source-container[onclick].selected > p {
    font-weight: 600;
}

/* Assess screens: compared feeds without a cross reference with the chosen primary feed, and groups left with none
   (js/modules/assess/feed_rules.js) */
.vendor-filter-menu .app-xref-hidden {
    display: none !important;
}
