﻿/* ------------------------------------------
   Global app styles for all devices & screens
   - Works on iPad/iPhone (Safari), Android tablets/phones (Chrome),
     Windows tablets (Edge), and desktop browsers.
   - Keep this file linked in index.html.
------------------------------------------- */

    /* Respect user zoom/text size behavior on iOS/iPadOS */
    html {
        -webkit-text-size-adjust: 100%;
    }

    :root,
    body {
        height: 100%;
        box-sizing: border-box;
    }

    /* Prevent accidental horizontal scroll (long labels, tables, etc.) */
    body {
        overflow-x: hidden;
        word-break: break-word;
        margin: 0;
        padding: 0;
        min-width: 320px; /* prevents ultra-narrow breakage on phones */
    }

    /* Safe-area support (iPad/iPhone notches, home indicators)
       constant() is for older iOS; env() is current. Non-Apple browsers treat these as 0. */
    html, body {
        /* Older iOS */
        padding-top: constant(safe-area-inset-top);
        padding-right: constant(safe-area-inset-right);
        padding-bottom: constant(safe-area-inset-bottom);
        padding-left: constant(safe-area-inset-left);
        /* Current */
        padding-top: env(safe-area-inset-top);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
    }

    /* Scrollbars (global, cross-theme; they reference theme vars) */
    * {
        scrollbar-width: thin !important;
        scrollbar-color: var(--on-surface-4) var(--background);
    }

    ::-webkit-scrollbar {
        -webkit-appearance: none;
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: var(--background);
        border-radius: 0;
    }

    ::-webkit-scrollbar-thumb {
        cursor: pointer;
        border-radius: 3px;
        background: var(--on-surface-4);
    }

    /* Smooth focus outlines for keyboard users */
    :focus-visible {
        /*outline: 2px solid #47A7F5;*/ /* your link blue; adjust if needed */
        /*outline-offset: 2px;*/
    }

    /* Screen-reader only helper (useful for aria-labelledby / aria-describedby) */
    .sr-only {
        border: 0 !important;
        clip: rect(1px,1px,1px,1px) !important;
        -webkit-clip-path: inset(50%) !important;
        clip-path: inset(50%) !important;
        height: 1px !important;
        margin: -1px !important;
        overflow: hidden !important;
        padding: 0 !important;
        position: absolute !important;
        width: 1px !important;
        white-space: nowrap !important;
    }

    .mud-input.mud-input-outlined .mud-input-outlined-border legend{
        font-size:1.25rem;
    }
    
    .mud-container, .mud-container--gutters {
	    padding : 0 !important;
	    margin-top: 0 !important;
	}
	
	
    /* Popovers/menus/dialog lists: keep them within the viewport on tablets/phones */
    .mud-popover {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Selected item emphasis in the open list */
    .mud-popover .mud-list-item.mud-selected {
        font-weight: 500;
    }

    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item {
        display: flex;
        align-items: center;
    }

        .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item .mud-list-item-icon {
            flex: 0 0 30% !important;
            width: 30% !important;
            max-width: 30% !important;
            min-width: 0 !important;
            margin-right: 0 !important;
            justify-content: center;            
        }

    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item .mud-list-item-icon .mud-icon-root {
        width: 2.1rem;
        height: 2.1rem;
    }

    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-icon,
    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-icon .mud-icon-root,
    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-icon svg,
    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-icon svg * {
        color: var(--mud-palette-secondary) !important;
    }

    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-text,
    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-text *,
    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item.parking-plan-weekday-item-selected .mud-list-item-text span {
        color: var(--mud-palette-text-primary) !important;
    }

    .mud-popover.parking-plan-schedule-weekdays-popover .mud-list .mud-list-item .mud-list-item-text {
        flex: 0 0 70% !important;
        width: 70% !important;
        max-width: 70% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        padding-left: 1.6rem !important;
    }

    /* Keep popover/menu text readable if container is narrow */
    .mud-popover,.mud-menu {
        max-inline-size: 100vw;
    }

    /* Dialogs: ensure tall content remains scrollable on tablets/phones */
    .mud-dialog .mud-dialog-content {
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Touch-friendly hit targets on tablets/phones */
    @media (pointer: coarse) {
        /*.mud-button,
        .mud-select,
        .mud-text-field,
        .mud-input-root {
            min-height: 48px;*/ /* recommended touch size */
        /*}*/

        /* Slightly larger click area inside outlined inputs/selects */
        .mud-input-root {
            padding-block: 0.4rem;
        }
    }

    /* Respect users who prefer reduced motion */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }

    @media (min-width: 1920px) {
        .mud-container-maxwidth-xl {
            max-width: 100%;
        }
    }

    /* subtle hover/selected backgrounds across lists/menus */
    .mud-list-item:hover {
        background-color: #aec8de; /* your --surface-hover */
    }

    .mud-list-item.mud-selected, .mud-list-item:focus {
        background-color: #DAE6F1; /* your --surface-active */
        outline: none;
    }

    /* Notifications panel: snackbar toast background override.
       Snackbars render through MudBlazor's MudSnackbarProvider portal, outside the
       Notifications component's DOM tree, so a scoped (Notifications.razor.css) rule
       cannot reach it - this must live in the global stylesheet. Applied via the
       Snackbar.Add(..., Configuration.SnackbarTypeClass/Class) CssClass parameter. */
    .notification-snackbar.mud-snackbar {
        background-color: #333333 !important;
        /* Prevent MudBlazor's built-in hover pause/resume behavior: the snackbar
           listens for mouseenter/mouseleave to pause its auto-dismiss timer, which
           can cause it to reopen/reappear if the pointer moves over it while it is
           fading out. Disabling pointer events stops those events from firing at
           all, so once the auto-dismiss timer elapses the snackbar closes for good. */
        pointer-events: none !important;
    }

    /* General notification snackbar: keep message content on a single line with a
       smaller font size, and hide the close ("X") icon action entirely. */
    .notification-snackbar.mud-snackbar .mud-snackbar-content-message {
        font-size: 14px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

/* App bar & Navigation menu section Start */

:root {
    /* Keep the mudblazor component related configs */
    --mud-drawer-width: clamp(256px, 300px, 512px);
    --mud-palette-drawer-icon: var(--TextSecondary);
}


/* TRUE visual centering of page title */
.app-bar-root {
    position: relative;
}

.page-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none; /* title never blocks clicks */
}

.app-bar-right {
    margin-left: auto; /* ✅ final guarantee */
    padding-right: 1rem;
}

.app-bar-icon svg {
    width: 1.6em;
    height: 1.6em;
}
.mud-nav-link.active:not(.mud-nav-link-disabled) {
    color: var(--mud-palette-drawer-text) !important;
}

.mud-appbar {
    border-bottom-color: var(--mud-palette-lines-default);
    border-bottom-style: solid;
    border-bottom-width: .8px;
}

.tag-status-notifications-popover-surface {
    position: fixed !important;
    top: 6.6rem !important;
    left: 71vw !important;
    right: auto !important;
    z-index: 999999 !important;
    max-width: 90vw;
    overflow: hidden;
    border-radius: 1.2rem;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 4px 4px 0px;
    transform: none !important;
    padding: 1.6rem;
}

@media (max-width: 800px), (pointer: coarse) and (max-width: 1024px) {
    .mud-popover.tag-status-notifications-popover-surface {
        top: 6.6rem !important;
        right: max(8px, env(safe-area-inset-right)) !important;
        left: auto !important;
        width: max-content !important;
        max-width: calc(100% - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)) !important;
        box-sizing: border-box;
    }

    .mud-popover.tag-status-notifications-popover-surface .tag-status-summary {
        min-width: 0 !important;
    }
}

.nav-header {
    padding: 12px 9px 12px 9px;
    border-bottom-color: var(--mud-palette-lines-default);
    border-bottom-style: solid;
    border-bottom-width: .8px;
}
.nav-header svg {
    color: var(--mud-palette-drawer-text) !important;
}
.vontas-logo {
    width: 8rem;
    height: 4rem;
}
.appName{
    margin-top: 1.5rem;
}
.nav-icon svg {
    width: 1.25em;
    height: 1.5em;
    margin-top: .15em;
}
.mud-nav-link-text{
    font-weight: 500;
}
/*.mud-navmenu {
    margin-top: 15px;
}*/
.nav-menu {
    font-size: 14px;
    margin-top: 15px;
}
/* App bar & Navigation menu section Ends */
/* App bar & Navigation menu section tarts */
.asset-sidebar {
    background-color: #FFFFFF !important;
    color: #1d272f !important;
    width: min(400px, 100vw) !important;
}

.site-notes {
    background-color: #FFFFFF !important;
    color: #1d272f !important;
    width: min(400px, 100vw) !important;
}

#assetSideBar-assetId {
    color: #333f48;
    float: left;
    line-height: 46px;
    font-weight: 600;
    width: 98%;
    height: 52px;
    vertical-align: middle;
}
.description-text {
    float: left;
    color: #1d272f;
    font-family: Roboto;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.text-capitalize{
    text-transform: capitalize;
}

/* ── AssetSearch / AssetSidebar z-index stacking ────────────────────────────
   These rules MUST live in app.css (global), NOT in scoped .razor.css files.

   MudBlazor renders DrawerVariant.Temporary as a portal — a direct child of
   <body> — which is OUTSIDE AssetSidebar's scoped DOM subtree. Scoped ::deep
   selectors in .razor.css files cannot reach portal elements, so the drawer
   z-index override must be declared globally here.

   Stacking order (lowest → highest):
     1000  .asset-sidebar__overlay   — transparent close-tap target (AssetSidebar only)
     1050  .asset-search-backdrop    — dropdown dismiss target; below sidebar drawer
     1100  .asset-sidebar drawer     — AssetSidebar MudDrawer (pinned via .asset-sidebar)
     1300  .mud-popover              — MudBlazor default (menus, tooltips, kebab inside sidebar)
     1350  .asset-search-container   — AppBar search field + clear button
     1350  .asset-search-dropdown    — result list; always above the drawer

   Key design:
     - asset-search-backdrop (1050) is BELOW the sidebar drawer (1100), so the
       sidebar remains fully interactive while the backdrop is visible.
     - The backdrop is rendered ONLY when the dropdown is open, and hidden
       once an asset is selected.
     - The AssetSidebar has its own overlay (1000) for closing itself.
   ────────────────────────────────────────────────────────────────────────── */

/* Pin ONLY the AssetSidebar MudDrawer below the search dropdown.
   The .asset-sidebar class is applied only to the AssetSidebar's MudDrawer,
   so the NavMenu drawer retains MudBlazor's default z-index (1300). */
.mud-drawer.mud-drawer--open.mud-drawer-temporary.asset-sidebar {
    z-index: 1100 !important;
}

/* Search container — positions the input above the backdrop */
.asset-search-container {
    position: relative;
    z-index: 1350;
}

/* Dropdown result list — always above the sidebar drawer */
.asset-search-dropdown {
    position: absolute;
    top: 50px;
    left: auto !important;
    z-index: 1350 !important;
    right:-68px;
}

/* Backdrop — BELOW the sidebar drawer so the sidebar stays accessible.
   Only closes the search dropdown; the sidebar has its own close overlay. */
.asset-search-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: transparent;
    cursor: default;
}

/* Touch-Friendly UI Plan for Tablets & Phones - Start */
/*### Step 5 — Responsive Breakpoint Adjustments in `app.css`
Add breakpoint-specific rules for layout items that do not yet adapt:*/

/* Phone breakpoint (< 600 px) */
@media (max-width: 599px) {
    /* Hide the centred page title in the AppBar (too narrow for title + icons) */
    .page-title {
        display: none;
    }

    /* Asset sidebar: full-width on phones (already handled by min() but
       explicit rule ensures correct behaviour when drawer width > screen) */
    .mud-drawer.asset-sidebar {
        width: 100vw !important;
    }

    /* Asset search dropdown: full-width on phones */
    .asset-search-dropdown {
        left: 0 !important;
        right: 0 !important;
        width: 100vw;
    }

    /* Reduce AppBar density on small screens */
    .mud-appbar .mud-toolbar {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* ── Profile popup: switch control fixes on phones ──────────────────────
       MudMenu renders its popover as a portal (<body> child), so these rules
       MUST be global (app.css). The .btn-theme-toggle MudStack uses Row="true"
       which causes the icon + label + switch row to overflow the narrow popup.
       Fix: enforce a minimum popup width and allow the toggle row to wrap.
       ────────────────────────────────────────────────────────────────────── */

    /* Ensure the profile popup is always wide enough to show the toggle row */
    #user-profile-menu .mud-popover-open,
    .mud-popover-open:has(#user-profile-display-name) {
        min-width: 240px !important;
    }

    /* Allow the theme-toggle row (icon + label + switch) to wrap onto two
       lines instead of overflowing the popup on narrow phones */
    .btn-theme-toggle {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    /* Push the switch to a dedicated line when the row wraps, keeping it
       left-aligned and visually grouped with the label */
    .btn-theme-toggle .mud-switch {
        margin-left: auto;
    }
}

/* Tablet breakpoint (600 px – 959 px) */
@media (min-width: 600px) and (max-width: 959px) {

    /* Slightly narrower drawer on smaller tablets */
    :root {
        --mud-drawer-width: 240px;
    }

    /* Asset sidebar: cap at 50vw on landscape tablets */
    /*.mud-drawer.asset-sidebar {
        width: min(360px, 50vw) !important;
    }*/
}

/*
### Step 6 — `touch-action` CSS for Scrollable / Map Regions
Declare `touch-action` on interactive scroll containers and map canvases so the browser does
not interfere with custom gesture handling.
*/

/* Allow vertical scroll; prevent accidental horizontal pan on list containers */
.mud-list,
.mud-table-container,
.mud-dialog .mud-dialog-content,
.asset-sidebar__content { /* sidebar scrollable panel */
    touch-action: pan-y;
}

/* YardMap canvas: the map JS handles all pointer events — tell the browser to
   step back entirely so pan/zoom are not swallowed by the page scroll handler */
.yard-map-canvas,
#yard-map-root {
    touch-action: none;
}


/*### Step 7 — Larger Touch Targets on Data Tables and List Items

MudBlazor's `MudTableRow` and `MudListItem` default to compact heights that are below the
48 px recommended touch target on coarse-pointer devices.
*/
@media (pointer: coarse) {
    /* Existing rules (already in file) … */
    /* Ensure table rows have a tappable height */
    .mud-table-row td {
        padding-block: 12px;
    }

    /* Nav links in the drawer */
    .mud-nav-link {
        min-height: 48px;
    }

    /* List items */
    .mud-list-item {
        min-height: 48px;
    }

    /* Icon buttons in the AppBar */
/*    .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }*/
}

/*### Step 9 — Global `touch-action: manipulation` for Tap-Delay Elimination

The 300 ms tap delay on mobile browsers (especially iOS Safari < 13 on older tablets) makes
the UI feel sluggish. Eliminate it globally:*/

/* Eliminate 300 ms tap delay on all interactive elements */
a, button, [role="button"],
.mud-button, .mud-icon-button,
.mud-nav-link, .mud-list-item,
.mud-tab, .mud-chip {
    touch-action: manipulation;
}
/*### Step 11 — Reduce `MudContainer` Padding on Phones

`MainLayout.razor` wraps every page body in `<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="mt-4" > `.
MudBlazor's default horizontal padding is **24 px each side** — that eats 48 px of a 375 px phone screen.
*/

@media (max-width: 599px) {
    /* Reduce MudContainer horizontal padding on phones */
    .mud-container
    {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Also reduce the top margin added by Class="mt-4" */
    .mud-main-content .mud-container {
        margin-top: 8px !important;
    }

}

/* Touch-Friendly UI Plan for Tablets & Phones - End */


/* ── Print utilities ──────────────────────────────────────────────────────── */
@media print {
    .hide-on-print {
        display: none !important;
    }

    @page {
        size: landscape;
        margin: 8mm;
    }

    @page yardGridCombined {
        size: auto;
        margin: 8mm;
    }

    .yard-grid-combined-print-page {
        page: yardGridCombined;
    }

    /* ── Hide the MainLayout chrome so only the page body is printed.
          Mirrors the legacy ym-yard-grid-combined.js printContent(), which hid
          core-workspace-header and released the app-content height before the
          browser print dialog opened. ───────────────────────────────────── */
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-overlay,
    .mud-overlay,
    .mud-popover,
    .mud-popover-provider,
    .mud-snackbar-provider,
    .mud-snackbar,
    .mud-scroll-to-top {
        display: none !important;
    }

    /* MudMainContent reserves space for the (now hidden) fixed AppBar — without
       clearing it the report starts a full AppBar height down the first page
       and the last rows spill/overlap onto the following page. */
    .mud-main-content {
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    .mud-main-content .mud-container {
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
    }

    /* Release every viewport-height / overflow constraint so the full content
       flows across pages instead of being clipped or stacked on top of itself. */
    html,
    body,
    .mud-layout {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Keep status/background colours in the printout (legacy prints coloured
       status badges via -webkit-print-color-adjust: exact). */
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
/* Generic hover tooltip — triggered by data-tooltip-title / data-tooltip-desc attributes.
   Any component can use this by calling window.dataTooltip.init() after first render. */
.data-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: none;
    max-width: 920px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 1.6rem;
    color: #1D272F;
    line-height: 1.4;
    background-color: var(--data-tooltip-bg,#ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    word-break: break-word;
}

.data-tooltip--visible {
    display: block;
}


.css-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--mud-palette-primary, #1976d2);
    border-radius: 50%;
    animation: css-spin 0.8s linear infinite;
}

@keyframes css-spin {
    to { transform: rotate(360deg); }
}

/* ── Button size utilities ──────────────────────────────────────────────────────── */

button.size-small {
    height: 24px;
    padding: 6px 16px;
}

button.size-medium {
    height: 36px;
    padding: 6px 20px;
}

button.size-large {
    height: 48px;
    padding: 6px 24px;
}

.w-100{
    width: 100%;
}

.uppercase {
    text-transform: uppercase !important;
}

label.disabled {
    color: var(--mud-palette-action-disabled);
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Datagrid drag and drop utilities ──────────────────────────────────────────────────────── */

/* Expand the internal drop zone to fill the entire header cell */
.mud-table-head .mud-drop-item {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center;
}

.mud-table-head .mud-drop-zone {
    width: 100% !important;
    height: 100% !important;
}

.mud-data-grid .mud-table-cell .column-header{
    margin-left: 24px !important;
}

/* Ensure the outer grid header cell has no padding choking the drop container */
.mud-table-head .mud-table-cell {
    padding: 0 !important;
}

/* Re-apply padding inside the draggable item so text doesn't hit the cell borders */
.mud-table-head .mud-table-cell-wrapper {
    padding: 16px !important; /* Matches MudBlazor default cell padding */
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-center: center;
}