/*
 * SfDropDownButton renders its trigger button and appends its popup to the body, so neither carries
 * the component's scope attribute and ::deep cannot reach them.
 */

.user-profile-menu__control.e-dropdown-btn {
    display: flex;
    align-items: center;
    /* .e-btn centres its content, which pushes the avatar off the rows' 16px gutter. */
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding-inline: 16px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: var(--brand-font-family);
    text-align: start;
    text-transform: none;
}

.user-profile-menu__control.e-dropdown-btn:hover {
    background: var(--theme-surface-hover-color);
}

.user-profile-menu__control.e-dropdown-btn:focus-visible {
    outline: 2px solid var(--theme-focus-ring-color);
    outline-offset: -2px;
}

.user-profile-menu__control.e-dropdown-btn .e-caret {
    display: none;
}

.user-profile-menu__photo {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.user-profile-menu__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface-muted-color);
    color: var(--theme-text-secondary-color);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.user-profile-menu__identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-profile-menu__name {
    overflow: hidden;
    color: var(--theme-text-primary-color);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-menu__email {
    overflow: hidden;
    color: var(--theme-text-secondary-color);
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-navigation-menu="collapsed"] .user-profile-menu__control.e-dropdown-btn {
    justify-content: center;
}

[data-navigation-menu="collapsed"] .user-profile-menu__identity {
    width: 0;
    visibility: hidden;
}

.e-dropdown-popup.user-profile-menu__control {
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--theme-surface-default-color) 92%, transparent);
    border-radius: 0.75rem;
    background: var(--theme-surface-default-color);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--theme-border-default-color) 95%, transparent),
        0 0 0 4px color-mix(in srgb, var(--theme-surface-default-color) 14%, transparent),
        0 18px 42px color-mix(in srgb, var(--theme-text-primary-color) 20%, transparent);
    outline: 1px solid color-mix(in srgb, var(--theme-surface-default-color) 62%, transparent);
    outline-offset: 3px;
    overflow: hidden;
}

/* Syncfusion positions the popup against the trigger with inline styles, which puts it over the rail. */
@media screen and (min-width: 961px) and (not ((hover: none) and (pointer: coarse))) {
    .e-dropdown-popup.user-profile-menu__control {
        position: fixed !important;
        inset: auto auto calc(var(--navigation-menu-user-height) - 26px) max(16px, calc(var(--navigation-menu-width) - 81px)) !important;
    }
}

.user-profile-menu-template {
    width: 330px;
    padding: 16px;
    font-family: var(--brand-font-family);
}

.user-profile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.user-profile-menu-tenant {
    overflow: hidden;
    color: var(--theme-text-secondary-color);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-menu-signout {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid var(--theme-border-default-color);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--theme-text-secondary-color);
    font-family: inherit;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}

.user-profile-menu-signout:hover {
    background: var(--theme-surface-hover-color);
    color: var(--theme-text-primary-color);
}

.user-profile-menu-signout:focus-visible,
.user-profile-menu-link:focus-visible {
    outline: 2px solid var(--theme-focus-ring-color);
    outline-offset: 2px;
}

.user-profile-menu-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 100%;
}

.user-profile-menu-photo {
    flex-shrink: 0;
    width: 76px;
    height: 76px;
    border-radius: 4px;
    object-fit: cover;
    object-position: center;
}

.user-profile-menu-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.user-profile-menu-fullname,
.user-profile-menu-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-menu-fullname {
    color: var(--theme-text-primary-color);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

.user-profile-menu-email {
    color: var(--theme-text-secondary-color);
    font-size: 14px;
    line-height: 20px;
}

.user-profile-menu-link {
    width: fit-content;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--theme-action-primary-rest-color);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
}

.user-profile-menu-link:hover {
    color: var(--theme-action-primary-hover-color);
}
