/*
 * RollWithIt — Global Account Menu
 * Phase 3.5C-HF1
 *
 * Presentation for templates/_account_menu.html only.
 *
 * This component is intentionally independent from PF2e,
 * SWADE and individual page layouts.
 */

.account-menu {
    position: fixed;

    top: 13px;
    right: 18px;

    z-index: 2200;
}

.account-menu > summary {
    list-style: none;
}

.account-menu > summary::-webkit-details-marker {
    display: none;
}

.account-menu-button {
    width: 42px;
    height: 42px;

    box-sizing: border-box;

    display: grid;
    place-items: center;

    cursor: pointer;

    border:
        1px solid rgba(213, 161, 80, .5);

    border-radius: 50%;

    background: rgba(8, 25, 38, .96);

    color: #e1af63;

    box-shadow:
        0 7px 22px rgba(0, 0, 0, .25);

    transition:
        transform .16s ease,
        border-color .16s ease,
        background .16s ease;
}

.account-menu-button:hover,
.account-menu[open] .account-menu-button {
    transform: translateY(-1px);

    border-color:
        rgba(238, 185, 103, .9);

    background: #102a3c;
}

.account-menu-button svg {
    width: 23px;
    height: 23px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-menu-panel {
    position: absolute;

    top: 50px;
    right: 0;

    width: 245px;

    box-sizing: border-box;

    padding: 9px;

    border:
        1px solid rgba(213, 161, 80, .45);

    border-radius: 11px;

    background:
        rgba(8, 25, 38, .985);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, .42);
}

.account-menu-heading {
    padding: 7px 10px 9px;

    color: #7e91a3;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: .12em;

    text-transform: uppercase;
}

.account-menu-item {
    box-sizing: border-box;

    width: 100%;
    min-height: 38px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 8px 10px;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #cdd7e0;

    text-align: left;
    text-decoration: none;

    font: inherit;
    font-size: 13px;

    cursor: pointer;
}

.account-menu-item:hover {
    background:
        rgba(48, 83, 107, .35);

    color: #fff;

    text-decoration: none;
}

.account-menu-primary {
    color: #edbd73;

    font-weight: 800;
}

.account-menu-item-icon {
    width: 20px;

    flex: 0 0 20px;

    color: #d9a75f;

    text-align: center;
}

.account-menu-separator {
    height: 1px;

    margin: 6px 5px;

    background:
        rgba(151, 177, 194, .14);
}

.account-menu-logout {
    margin: 0;
}

.account-menu-logout-button {
    color: #e3a5a5;
}

.account-menu-logout-button .account-menu-item-icon {
    color: #d57e7e;
}

/*
 * The account-menu include is a direct child of <body>.
 * Preserve the final legacy cascade value.
 */
body > .account-menu {
    z-index: 50 !important;
}

@media (max-width: 760px) {
    .account-menu {
        top: 10px;
        right: 10px;
    }

    .account-menu-button {
        width: 39px;
        height: 39px;
    }

    .account-menu-panel {
        top: 46px;

        width:
            min(245px, calc(100vw - 20px));
    }
}

/* PF2E_TABLET_R4_FIX19_ACCOUNT_MENU_LAYER_START */
/*
   PF2e character sheet, tablet landscape.

   account-menu.css currently contains an early z-index:2200 declaration,
   but later forces body > .account-menu down to z-index:50 !important.
   The character Roll History rail therefore paints above the opened profile
   menu. Restore the account menu to the foreground while keeping it below
   high-priority modal layers (~20000).
*/
@media (min-width: 761px) and (max-width: 1440px) and (orientation: landscape) {
    body[data-ui-system="pf2e"][data-ui-page^="/characters/"]
    > .account-menu {
        z-index: 12000 !important;
        isolation: isolate;
    }

    body[data-ui-system="pf2e"][data-ui-page^="/characters/"]
    > .account-menu[open] {
        z-index: 12000 !important;
    }

    body[data-ui-system="pf2e"][data-ui-page^="/characters/"]
    > .account-menu .account-menu-button {
        position: relative;
        z-index: 2;
    }

    body[data-ui-system="pf2e"][data-ui-page^="/characters/"]
    > .account-menu .account-menu-panel {
        position: absolute;
        z-index: 3;
    }
}
/* PF2E_TABLET_R4_FIX19_ACCOUNT_MENU_LAYER_END */
