/* Profile dropdown trigger in the public navbar — avatar (or initials) + display name.
   Sits in the .nav-side strip alongside the search/login icons. */

/* Global overrides for the PSC.Blazor.Components.AutoComplete results panel:
   - z-index: library defaults to 10, which loses to the footer once the panel extends
     past the input's container.
   - flag glyph: shared flags.css applies `float: left` to .flag, breaking flexbox
     centering inside our row layouts. Forced float:none + vertical-align:middle. */
.autocomplete__results {
    z-index: 10000 !important;
}

.autocomplete__result .flag,
.country-picker-row .flag,
.language-picker-row .flag {
    float: none !important;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Force flex centering on the nav-side strip. The template lays its icons out as
   baseline-aligned inline-blocks; that pushes our taller user-menu trigger + the
   pill-shaped theme toggle off-axis from the smaller search icon. */
.nav-side {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
}

/* Normalize every icon-link in the nav-side to the 28px toolbar height so the chat
   bubble, login user, and search lens line up with the avatar trigger + theme toggle.
   Bootstrap's `.icon-link` is inline-flex but has no fixed height, so it inherits the
   icon's intrinsic line-box and floats below the taller pill items. */
.nav-side .icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    line-height: 1;
}

/* Sign-up CTA: shrink the default btn-sm footprint (~36-40px) to match the 28px
   toolbar baseline so it stops dwarfing the surrounding icon-links. */
.nav-side .signup-cta {
    height: 28px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 1;
    border-radius: 999px;
}

/* The news-template's style.css applies `.navbar .dropdown-menu { opacity:0; visibility:hidden }`
   to power its own hover-based menus, which keeps Bootstrap's `.show` class from making OUR
   dropdown visible. Bump specificity so the user menu uses the standard Bootstrap toggle. */
.user-menu .dropdown-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Same template, line 2071: `.navbar .dropdown-menu { top: 110px }` is meant for its own
   mega-menus that hang below the navbar bar. Cancel it for the user menu so Popper can
   place the menu directly under the trigger. */
.user-menu .dropdown-menu {
    top: auto !important;
    background-color: #fff;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    color: inherit;
    background: transparent;
    border: 0;
    text-decoration: none;
    transition: background-color 120ms ease-out;
    cursor: pointer;
}

.user-menu-trigger:focus { outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }

.user-menu-trigger:hover,
.user-menu[aria-expanded="true"] .user-menu-trigger {
    background-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .user-menu-trigger:hover,
[data-theme="dark"] .user-menu[aria-expanded="true"] .user-menu-trigger {
    background-color: rgba(255, 255, 255, 0.08);
}

.user-menu-avatar {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-menu-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.user-menu-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-photo {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.user-menu-name {
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 500;
}

.user-menu-chevron {
    font-size: 11px;
    opacity: 0.7;
}

/* Hide the name on narrow viewports so the trigger stays compact. The initial+chevron
   are still meaningful on their own. */
@media (max-width: 768px) {
    .user-menu-name { display: none; }
}

/* Light/dark toggle that sits inline in the navbar's nav-side strip. Two pill buttons
   with the active half filled. Sized to match the search/user icons next to it. */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

.theme-toggle-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background-color 120ms ease-out;
}

.theme-toggle-btn:hover { background-color: rgba(0, 0, 0, 0.06); }

.theme-toggle-btn.active {
    background-color: #fff;
    color: #f59e0b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .theme-toggle { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .theme-toggle-btn:hover { background-color: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .theme-toggle-btn.active {
    background-color: #1f2937;
    color: #93c5fd;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.theme-toggle-btn i { font-size: 16px; }

/* Sidebar nav inside the /my area. Sticky on desktop so the user always has the
   list of account pages visible while scrolling long settings forms. */
.my-area-nav .list-group-item-action.active {
    background-color: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border-color: transparent;
    font-weight: 600;
}

.my-area-nav .list-group-item-action {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 2px;
}

.my-area-nav-section {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    color: #6b7280;
    margin: 16px 12px 6px;
}

.my-area-nav-section:first-child { margin-top: 4px; }

@media (min-width: 992px) {
    .my-area-nav-sticky { position: sticky; top: 90px; }
}
