/*
 * TopBar.css - presentation of the top navigation bar; no script is involved. Entries are ordinary
 * Navigation Bar list entries carrying a CSS class. Below 1280px only the icon shows (the label stays for
 * screen readers), except a running refresh, which keeps its label because progress is shown there.
 */
.bug-reporter-btn { display: none !important; }

.t-NavigationBar-item.ur-manualRefresh,
.t-NavigationBar-item.ur-reportBug { position: relative; margin-inline-end: 10px; padding-inline-end: 10px; }
.t-NavigationBar-item.ur-manualRefresh::after,
.t-NavigationBar-item.ur-reportBug::after {
    content: ""; position: absolute; inset-inline-end: 0; top: 25%; height: 50%; width: 1px;
    background: currentColor; opacity: .35;
}

/* Report Bug stands out by colour only: red icon and red label, no fill. Dark red, because a bright red
   has almost no contrast against the olive header (1.0 to 1.4 to 1); this one reaches 2.0 to 1. */
.t-NavigationBar-item.ur-reportBug .t-Button { font-weight: 600; }
.t-NavigationBar-item.ur-reportBug .t-Button .t-Icon,
.t-NavigationBar-item.ur-reportBug .t-Button .t-Button-label { color: #8b0000 !important; }

@media (max-width: 1279px) {
    .t-NavigationBar-item.ur-manualRefresh .t-Button-label,
    .t-NavigationBar-item.ur-openDrop .t-Button-label,
    .t-NavigationBar-item.ur-reportBug .t-Button-label,
    .t-NavigationBar-item.a-pwaInstall .t-Button-label {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
        clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .t-NavigationBar-item.ur-manualRefresh a[aria-disabled="true"] .t-Button-label {
        position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto;
    }
}

/* Toasts stay top right but start below the 48px header, so they never cover its controls */
#toast-container.toast-top-right { top: 56px; right: 16px; }

/* the bug icon in a dialog title bar, left of the close cross (added by TopBarLinksJS.js) */
.ui-dialog .ui-dialog-titlebar .ur-dialogBug {
    position: absolute; inset-inline-end: 48px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: #ff6b5e; cursor: pointer; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.ui-dialog .ui-dialog-titlebar .ur-dialogBug:hover,
.ui-dialog .ui-dialog-titlebar .ur-dialogBug:focus { background: rgba(255, 107, 94, .18); }
.ui-dialog .ui-dialog-titlebar:has(.ur-dialogBug) .ui-dialog-title { margin-inline-end: 84px; }

/* The page name renders right of the logo, after a separator line; hidden below 640px. */
.t-Header-logo { display: flex; align-items: center; min-width: 0; }
/* APEX wraps the Dynamic Content body in <a-dynamic-content>, so the two spans were
   aligning to that element's text baseline, not to the header's centre. Make the wrapper a
   centred inline-flex row as well, and give the separator a fixed height. */
.t-Header-logo .ur-pageName-wrap,
.t-Header-logo .ur-pageName-wrap > a-dynamic-content { display: inline-flex; align-items: center; min-width: 0; padding: 0; margin: 0; line-height: 1; }
.t-Header-logo .ur-pageName-sep {
    display: inline-block; width: 1px; height: 16px; min-height: 0; margin-inline: 12px 12px; align-self: center;
    background: currentColor; opacity: .35;
}
.t-Header-logo .ur-pageName {
    display: inline-block; max-width: 320px; font-size: 15px; font-weight: 500; line-height: 1; align-self: center; color: #ffffff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 640px) {
    .t-Header-logo .ur-pageName-wrap { display: none; }
}

/*
 * Global hotel selector (P0_HOTEL_ID). APEX renders a popup-LOV group holding the text input (the hotel
 * NAME; the hex id is in the hidden P0_HOTEL_ID_HV) and button.a-Button--popupLOV. The group is painted as
 * the field and the input and button sit inside it borderless. The label is hidden but kept for screen readers.
 */
.t-Header-navBar--start { display: flex; align-items: center; min-width: 0; }
/* the same thin divider as after Refresh Strategies and Report Bug, only when a selector is rendered */
.t-Header-navBar--start:has(#P0_HOTEL_ID, #P0_NO_HOTEL_ACCESS) {
    position: relative; margin-inline-end: 10px; padding-inline-end: 10px;
}
.t-Header-navBar--start:has(#P0_HOTEL_ID, #P0_NO_HOTEL_ACCESS)::after {
    content: ""; position: absolute; inset-inline-end: 0; top: 25%; height: 50%; width: 1px;
    background: currentColor; opacity: .35;
}
.t-Header-navBar--start .t-Form-fieldContainer { margin: 0; padding: 0; }
.t-Header-navBar--start .t-Form-inputContainer,
.t-Header-navBar--start .t-Form-itemWrapper { min-width: 0; }
#P0_HOTEL_ID,
#P0_HOTEL_ID_DISPLAY,
#P0_NO_HOTEL_ACCESS_DISPLAY,
#P0_NO_HOTEL_ACCESS,
.t-Header-navBar--start .apex-item-group--popup-lov {
    display: block; width: 260px; max-width: 260px; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* the field: the popup LOV group carries the box; a bare select (any page still rendering one) too */
.t-Header-navBar--start .apex-item-group--popup-lov,
select#P0_HOTEL_ID {
    height: 32px; box-sizing: border-box; font-size: 13px; font-weight: 600;
    /* header colours, stated here so a page stylesheet cannot repaint it */
    background-color: rgba(255, 255, 255, .08); color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 4px; box-shadow: none;
}
select#P0_HOTEL_ID { padding-block: 0; padding-inline: 8px 28px; }
select#P0_HOTEL_ID option { background-color: #ffffff; color: #1f1f1f; }
select#P0_HOTEL_ID:focus,
.t-Header-navBar--start .apex-item-group--popup-lov:focus-within {
    outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 1px;
}
.t-Header-navBar--start .apex-item-group--popup-lov { display: inline-flex; align-items: center; }
/* the text input inside the group: borderless, fills the field, shows the name with an ellipsis */
.t-Header-navBar--start .apex-item-group--popup-lov input#P0_HOTEL_ID {
    flex: 1 1 auto; width: auto; max-width: none; min-width: 0; height: 30px; margin: 0;
    padding: 0 0 0 8px; font-size: 13px; font-weight: 600; line-height: 30px; color: #ffffff;
    background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: none; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-Header-navBar--start .apex-item-group--popup-lov input#P0_HOTEL_ID::placeholder { color: rgba(255, 255, 255, .7); }
/* the LOV button inside the field: transparent, white icon */
.t-Header-navBar--start .apex-item-group--popup-lov .a-Button--popupLOV {
    flex: 0 0 auto; width: 28px; min-width: 0; height: 30px; min-height: 0; margin: 0; padding: 0;
    background: transparent; border: 0; border-radius: 0; box-shadow: none; color: #ffffff;
    display: inline-flex; align-items: center; justify-content: center;
}
.t-Header-navBar--start .apex-item-group--popup-lov .a-Button--popupLOV:hover,
.t-Header-navBar--start .apex-item-group--popup-lov .a-Button--popupLOV:focus,
.t-Header-navBar--start .apex-item-group--popup-lov .a-Button--popupLOV:active {
    background: rgba(255, 255, 255, .12); color: #ffffff; box-shadow: none; outline: none;
}
.t-Header-navBar--start .apex-item-group--popup-lov .a-Button--popupLOV .a-Icon { color: #ffffff; }
#P0_HOTEL_ID_DISPLAY,
#P0_NO_HOTEL_ACCESS_DISPLAY,
#P0_NO_HOTEL_ACCESS { padding: 6px 8px; font-size: 13px; font-weight: 600; color: inherit; }
/* a user with one hotel: the item is read-only. APEX 26.1 renders the read-only select as
   input#P0_HOTEL_ID.apex-item-select-readonly; the read-only popup LOV is a readonly text input
   without the LOV button. Both show as plain header text, no box. A group without the button is the
   read-only popup LOV rendered inside its group: same treatment. */
input#P0_HOTEL_ID.apex-item-select-readonly,
input#P0_HOTEL_ID.apex-item-popup-lov-readonly,
input#P0_HOTEL_ID[readonly]:not(.apex-item-group--popup-lov:has(.a-Button--popupLOV) input),
.t-Header-navBar--start .apex-item-group--popup-lov:not(:has(.a-Button--popupLOV)) {
    height: 32px; padding: 0 8px; font-size: 13px; font-weight: 600; color: #ffffff;
    background: transparent; border: 0; box-shadow: none; cursor: default;
}
.t-Header-navBar--start .apex-item-group--popup-lov:not(:has(.a-Button--popupLOV)) input#P0_HOTEL_ID { cursor: default; }
#P0_NO_HOTEL_ACCESS_DISPLAY,
#P0_NO_HOTEL_ACCESS { font-style: italic; font-weight: 400; }

@media (max-width: 1279px) {
    #P0_HOTEL_ID,
    #P0_HOTEL_ID_DISPLAY,
    #P0_NO_HOTEL_ACCESS_DISPLAY,
    #P0_NO_HOTEL_ACCESS,
    .t-Header-navBar--start .apex-item-group--popup-lov { width: 160px; max-width: 160px; }
    .t-Header-navBar--start .apex-item-group--popup-lov input#P0_HOTEL_ID { width: auto; max-width: none; }
}
@media (max-width: 640px) {
    #P0_HOTEL_ID,
    #P0_HOTEL_ID_DISPLAY,
    #P0_NO_HOTEL_ACCESS_DISPLAY,
    #P0_NO_HOTEL_ACCESS,
    .t-Header-navBar--start .apex-item-group--popup-lov { width: 120px; max-width: 120px; }
    .t-Header-navBar--start .apex-item-group--popup-lov input#P0_HOTEL_ID { width: auto; max-width: none; }
}

/* At phone width the selector gets its own header row. The nav bar's three slots become items of the
   branding grid (display: contents), the start slot spans a second row, and the nav icons tighten so the
   logo keeps its words. One row cannot hold menu, logo, selector and five icons in 390px. */
@media (max-width: 640px) {
    .t-Header-branding {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "controls logo navbar" "hotel hotel hotel";
        row-gap: 0;
        padding-bottom: 8px;
    }
    .t-Header-navBar { display: contents; }
    .t-Header-navBar--center { grid-area: navbar; justify-self: end; }
    .t-Header-navBar--end:empty { display: none; }
    .t-Header-navBar--start,
    .t-Header-navBar--start:has(#P0_HOTEL_ID, #P0_NO_HOTEL_ACCESS) {
        grid-area: hotel; justify-content: flex-start; margin: 0; padding: 0;
    }
    .t-Header-navBar--start:has(#P0_HOTEL_ID, #P0_NO_HOTEL_ACCESS)::after { display: none; }
    .t-Header-navBar--start .t-Form-fieldContainer,
    .t-Header-navBar--start .t-Form-inputContainer,
    .t-Header-navBar--start .t-Form-itemWrapper { width: 100%; }
    #P0_HOTEL_ID,
    #P0_HOTEL_ID_DISPLAY,
    #P0_NO_HOTEL_ACCESS_DISPLAY,
    #P0_NO_HOTEL_ACCESS,
    .t-Header-navBar--start .apex-item-group--popup-lov { width: 100%; max-width: none; }
    .t-Header-navBar--start .apex-item-group--popup-lov input#P0_HOTEL_ID { width: auto; max-width: none; }
    .t-Header .t-NavigationBar-item .t-Button { padding-inline: 6px; }
    .t-NavigationBar-item.ur-manualRefresh,
    .t-NavigationBar-item.ur-reportBug { margin-inline-end: 6px; padding-inline-end: 6px; }
    .t-Header-logo .t-Header-logo-link { margin-inline-end: 0; }
}

/*
 * Refresh status dot after the hotel field (span.ur-hotelDot). The header is dark in both themes, so the dot
 * carries its own colours plus a half-transparent dark ring; the pulse is dropped under reduced motion.
 * The itemWrapper becomes a flex row only when the dot is present so the field keeps its width.
 */
.t-Header-navBar--start .t-Form-itemWrapper:has(.ur-hotelDot) {
    display: inline-flex; align-items: center; min-width: 0; flex-wrap: nowrap;
}
.ur-hotelDot {
    display: none; flex: 0 0 auto; width: 10px; height: 10px; margin-inline-start: 8px;
    border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); cursor: help;
}
.ur-hotelDot--running { display: inline-block; background: #ffb020; animation: ur-hotelDot-pulse 1.2s ease-in-out infinite; }
.ur-hotelDot--queued  { display: inline-block; background: rgba(255, 255, 255, .55); }
.ur-hotelDot--done    { display: inline-block; background: #3ec46d; }
@keyframes ur-hotelDot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.8); }
}
@media (prefers-reduced-motion: reduce) {
    .ur-hotelDot--running { animation: none; }
}
@media (max-width: 1279px) {
    .ur-hotelDot { margin-inline-start: 6px; }
}
