/* =========================================================================
   DROPDOWN MENUS (every page)
   =========================================================================
   One look for every dropdown in deckd, copied from the board page's
   "More" menu (.board-detail-header-menu): a frosted, translucent white
   card with soft corners and shadow, and roomy 14px medium-weight rows
   that pick up a faint grey on hover.

   Loaded from base.html on every page. Menus were each styled in their
   own page stylesheet or inline <style> block, often with long
   "html body .page .x" selectors and !important. Rather than edit every
   one of those in place, each selector list below is wrapped in :is()
   together with a never-matching double ID (#deckd-menus#deckd-menus):
   :is() takes the specificity of its most specific argument, which
   lifts these rules above all of those class-based layers.

   Only appearance is set here - never display, position, size, z-index
   or transforms - so every menu still opens, closes and positions
   exactly as its own code says. */

/* -------------------------------------------------------------------
   The card
   ------------------------------------------------------------------- */

/* How see-through the frosted card is. On phones, where menus open
   over large photos and the screen is smaller, it is a lot more solid
   so what's behind shows through less. */
:root {
    --deckd-menu-glass: rgba(255, 255, 255, 0.55);
}

@media (max-width: 800px) {
    :root {
        --deckd-menu-glass: rgba(255, 255, 255, 0.88);
    }
}

html body :is(
    #deckd-menus#deckd-menus,
    .board-menu,
    .product-menu,
    .detail-menu,
    .deck-menu,
    .board-detail-header-menu,
    .board-tools-dropdown-menu,
    .decks-owner-sort-menu,
    .nav-account-dropdown-menu,
    .nav-quick-add-dropdown,
    .nav-currency-dropdown,
    .nav-notifications-dropdown,
    .friends-row-menu,
    .viewer-eye-menu,
    .detail-eye-menu,
    .budget-combo-menu-list,
    .budget-picker-menu,
    .budget-saved-dropdown,
    .custom-select-list,
    .acct-currency-dropdown,
    .add-product-bg-color-menu,
    .add-product-bg-color-custom-menu,
    .deck-mobile-float-menu,
    .ribbon-dropdown-menu:not(.ribbon-color-menu-inline)
) {
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 18px !important;
    background: var(--deckd-menu-glass) !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.12) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.8) !important;
    backdrop-filter: blur(20px) saturate(1.8) !important;
    padding: 10px !important;
}

/* -------------------------------------------------------------------
   Plain menu rows (one line of text, maybe with an icon)
   ------------------------------------------------------------------- */

html body :is(
    #deckd-menus#deckd-menus,
    .menu-delete-button,
    .board-detail-header-menu-item,
    .nav-account-menu-item,
    .nav-quick-add-option,
    .nav-currency-option,
    .fr-menu-item,
    .budget-combo-menu-item,
    .ribbon-dropdown-option,
    .budget-picker-menu > button,
    .custom-select-list > button,
    .decks-owner-sort-menu > button,
    .acct-currency-dropdown > button
) {
    margin: 0 !important;
    padding: 11px 13px !important;
    border: none !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #1f1f1f !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    text-decoration: none !important;
}

/* Keep destructive rows red where a menu marks them that way */
html body :is(
    #deckd-menus#deckd-menus,
    .fr-menu-item-danger
) {
    color: #b3392c !important;
}

/* -------------------------------------------------------------------
   Richer rows (a title plus a description, a switch, thumbnails...):
   only their corners and hover change, so their own layout stays put
   ------------------------------------------------------------------- */

html body :is(
    #deckd-menus#deckd-menus,
    .board-tool-card:not(.board-tool-card-assignee),
    .budget-saved-row
) {
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* -------------------------------------------------------------------
   Hover / keyboard focus, for both kinds of row
   ------------------------------------------------------------------- */

html body :is(
    #deckd-menus#deckd-menus,
    .menu-delete-button,
    .board-detail-header-menu-item,
    .nav-account-menu-item,
    .nav-quick-add-option,
    .nav-currency-option,
    .fr-menu-item,
    .budget-combo-menu-item,
    .ribbon-dropdown-option,
    .budget-picker-menu > button,
    .custom-select-list > button,
    .decks-owner-sort-menu > button,
    .acct-currency-dropdown > button,
    .board-tool-card:not(.board-tool-card-assignee),
    .budget-saved-row
):is(:hover, :focus-visible) {
    background: rgba(17, 17, 17, 0.05) !important;
}

/* The row a menu marks as current (the chosen sort, currency, filter,
   assignee...) keeps a slightly stronger grey */
html body :is(
    #deckd-menus#deckd-menus,
    .menu-delete-button,
    .board-detail-header-menu-item,
    .nav-currency-option,
    .ribbon-dropdown-option,
    .budget-picker-menu > button,
    .custom-select-list > button,
    .decks-owner-sort-menu > button,
    .acct-currency-dropdown > button
):is(.is-selected, .is-active, .active, .selected, [aria-selected="true"], [aria-checked="true"]) {
    background: rgba(17, 17, 17, 0.08) !important;
}

/* -------------------------------------------------------------------
   Dividers and small section titles inside menus
   ------------------------------------------------------------------- */

html body :is(
    #deckd-menus#deckd-menus,
    .nav-account-menu-divider,
    .fr-menu-divider,
    .deck-mobile-float-menu-divider
) {
    height: 1px !important;
    margin: 6px 8px !important;
    border: none !important;
    background: rgba(17, 17, 17, 0.08) !important;
}

html body :is(
    #deckd-menus#deckd-menus,
    .budget-saved-dropdown-title,
    .boards-owner-sort-menu-title,
    .decks-owner-sort-menu-title,
    .nav-notifications-title
) {
    margin: 0 !important;
    padding: 8px 13px 6px !important;
    color: #8a8a8a !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
}
