/* ============================================================================
   Z-INDEX HIERARCHY SYSTEM
   ============================================================================
   Centralized z-index management using CSS custom properties.
   This ensures proper layering of components and prevents conflicts.

   VISUAL HIERARCHY (lowest to highest):

   ┌─────────────────────────────────────────────────────────────────┐
   │ Layer 10000+: SYSTEM OVERLAYS (notifications, loading screens)  │ ← Highest priority
   ├─────────────────────────────────────────────────────────────────┤
   │ Layer 1200-1299: APPLICATION MODALS & POPUPS                    │
   ├─────────────────────────────────────────────────────────────────┤
   │ Layer 1000-1199: DROPDOWNS, TOOLTIPS, FILTER BUTTON             │
   ├─────────────────────────────────────────────────────────────────┤
   │ Layer 900-999: MOBILE DRAWER                                    │
   ├─────────────────────────────────────────────────────────────────┤
   │ Layer 1-899: STICKY ELEMENTS, DESKTOP DRAWER                    │
   ├─────────────────────────────────────────────────────────────────┤
   │ Layer 0: BASE CONTENT & COMPONENT INTERNALS                     │ ← Lowest priority
   └─────────────────────────────────────────────────────────────────┘

   USAGE GUIDELINES:

   1. ALWAYS use these CSS variables instead of hardcoded z-index values
   2. If you need a new z-index layer, add it here first with documentation
   3. Use the appropriate layer for your component type:
      - Notifications/Alerts: Use --z-notification or --z-loading
      - Modals/Dialogs: Use --z-modal
      - Mobile-specific overlays: Use --z-drawer-mobile or --z-filter-button-mobile
      - Dropdowns/Selects: Use --z-dropdown (overrides DevExpress/Bootstrap defaults)
      - Fixed headers/footers: Use --z-sticky
      - Desktop navigation: Use --z-drawer-desktop

   4. COMMON PITFALL - Mobile Drawer Conflicts:
      On mobile, the DxDrawer uses z-index 900 with background shading.
      Dropdowns (1150) and interactive elements appear above the drawer.
      Sticky headers (50) appear below the drawer to avoid showing through.
      This creates proper layering: content < drawer < dropdowns < modals.

   5. When in doubt, refer to this file or the Z-INDEX-REFERENCE.md documentation.

   ========================================================================= */

:root {
    /* System Layer - 10000+ (Always on top) */
    --z-loading: 9999;              /* Loading screen overlay */
    --z-notification: 30001;        /* Snackbar notifications (DevExpress) */

    /* Application Modal Layer - 1050-1099 (Aligned with DevExpress defaults) */
    --z-modal: 1050;                /* Popup dialogs, confirmation modals (DevExpress default) */

    /* Interactive Layer - 1000-1049 */
    --z-dropdown: 1060;             /* Dropdowns, comboboxes, select menus (DevExpress default) */
    --z-tooltip: 1080;              /* Bootstrap tooltips */
    --z-popover: 1070;              /* Bootstrap popovers */
    --z-filter-button-mobile: 1040; /* Mobile filter toggle button (above drawer, below modals) */
    --z-offcanvas: 1045;            /* Bootstrap offcanvas */
    --z-error-ui: 1000;             /* Blazor error UI banner */

    /* Navigation Layer - 900-999 */
    --z-drawer-mobile: 900;         /* DxDrawer on mobile (with shading) - lowered to allow dropdowns at 1150 */

    /* Content Layer - 1-899 */
    --z-sticky: 50;                 /* Sticky table headers, fixed elements (below drawer) */
    --z-drawer-desktop: 10;         /* DxDrawer on desktop (no shading) */

    /* Base Layer - 0 */
    --z-base: 0;                    /* Default stacking context */
}

/* ============================================================================
   DevExpress Dropdown Z-Index Override
   ============================================================================
   CRITICAL FIX: Override DevExpress/Bootstrap dropdown z-index to ensure
   dropdowns appear above the mobile drawer overlay.

   Problem: DxComboBox and other DevExpress dropdowns use Bootstrap's default
   --bs-dropdown-zindex: 1000, which causes rendering issues with the mobile
   drawer. By setting dropdowns to 1150, they properly appear above the drawer
   (900) and its semi-transparent shading overlay.

   Solution: Set dropdown z-index to 1150 (same as --z-dropdown variable),
   ensuring proper layering: drawer (900) < dropdowns (1150) < modals (1200).
   ========================================================================= */
.dxbl-dropdown > .dxbl-dropdown-dialog,
.dxbl-edit-dropdown,
.dropdown-menu {
    z-index: var(--z-dropdown) !important;
}

/* ============================================================================
   Z-Index Alignment with DevExpress Defaults
   ============================================================================
   We now align with DevExpress's default z-index hierarchy instead of fighting it:

   DevExpress Default Hierarchy:
     - First DxPopup: 1050 (automatically managed by DevExpress)
     - Edit dropdowns: 1060 (inline style, naturally above popups)
     - Subsequent popups: 1051+ (DevExpress auto-increments)

   Previous Approach (REMOVED):
     - Custom ZIndex="1200" on all popups
     - Aggressive CSS override forcing dropdowns to z-index 2250
     - This caused conflicts with DevExpress's inline styles

   Current Approach:
     - Remove custom ZIndex properties from DxPopup components
     - Let DevExpress manage z-index automatically
     - Update CSS variables to match DevExpress defaults (--z-modal: 1050)
     - No CSS overrides needed - everything works naturally

   Result: Dropdowns (1060) appear correctly above popups (1050) without any
   CSS fighting or !important rules.

   Reference: https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxPopupBase.ZIndex
   ========================================================================= */

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body, #app, .page {
    height: 100%;
    margin: 0;
}

.page {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* prevent page-level scroll */
}

article.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* Highlight “Apply” button when active */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), .7);
    }

    70% {
        box-shadow: 0 0 0 0.75rem rgba(var(--bs-primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

/* Apply class is added dynamically via GetApplyButtonCss() */
.apply-highlight {
    animation: pulse 1.6s cubic-bezier(0.66, 0, 0, 1) infinite;
    transition: transform 0.15s ease-in-out;
}

    .apply-highlight:hover {
        transform: scale(1.03);
    }

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .apply-highlight {
        animation: none;
    }
}


.dxbl-image {
    vertical-align: middle;
}

.dxbl-treeview-item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    max-width: clamp(150px, 15vw, 250px);
    display: inline-block;
    vertical-align: middle;
}

/* Add padding between tab separator line and tab content */
.dxbl-tabs .dxbl-tabs-content-panel .dxbl-tabs-content {
    padding-top: 0.5rem;
}

/* Constrain DevExpress tabs ONLY when nested inside .module-content (e.g., ParkingMain tabs) */
.module-content > .dxbl-tabs {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.module-content > .dxbl-tabs .dxbl-tabs-content-panel {
    flex: 1;
    min-height: 0; /* Critical for flex child height constraint */
    overflow: hidden;
}

.module-content > .dxbl-tabs .dxbl-tabs-content-panel .dxbl-tabs-content {
    height: 100%;
    overflow: hidden;
    padding-top: 0.5rem;
}

/* Allow grid children to shrink below content size */
.module-content > * {
    min-height: 0;
}

/* Make rows respect parent grid height */
.module-content > .row {
    min-height: 0;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: var(--z-error-ui);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.filled-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24
}

#loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
    z-index: var(--z-loading);
}

    #loading-screen .loading-logo {
        width: clamp(120px, 12vw, 200px);
        height: auto;
        margin-bottom: 1.5rem;
    }

    #loading-screen .bar-container {
        width: 60%;
        max-width: min(90%, 500px);
        height: 0.375rem;
        background: rgba(0,0,0,0.1);
        border-radius: 3px;
        overflow: hidden;
    }

    /* paddle is 50% wide, slides full-width of itself (i.e. half the container) */
    #loading-screen .bar {
        width: 50%;
        height: 100%;
        background: var(--bs-primary);
        /* start at left edge */
        transform: translateX(0);
        /* slide to 100% of its own width, then back, forever */
        animation: slide 0.6s ease-in-out infinite alternate;
    }

@keyframes slide {
    to {
        transform: translateX(100%);
    }
}

.action-buttons {
    display: inline-flex !important;
    gap: 0.5rem;
    align-items: center;
    white-space: nowrap !important;
}

.action-buttons-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

/* Whitelist add button colors based on status */
.btn-add-none {
    color: var(--bs-primary);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

    .btn-add-none:hover {
        transform: scale(1.15);
        filter: brightness(1.2);
    }

.btn-add-some {
    color: dodgerblue; /* Bright Teal - in some but not all whitelists */
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

    .btn-add-some:hover {
        transform: scale(1.15);
        filter: brightness(1.2);
    }

.btn-add-all {
    color: #6c757d; /* Grey - in all whitelists (disabled state) */
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Utility Classes - Icon Sizing
   ======================================== */
.icon-xxs {
    font-size: 0.75em;
}

.icon-xs {
    font-size: 1.25em;
}

.icon-sm {
    font-size: 1.375em;
}

.icon-md {
    font-size: 1.5em;
}

.icon-base {
    font-size: 1.625em;
}

.icon-lg {
    font-size: 1.75em;
}

.icon-xl {
    font-size: 1.8125em;
}

.icon-2xl {
    font-size: 1.875em;
}

.icon-3xl {
    font-size: 2em;
}

.icon-4xl {
    font-size: 2.375em;
}

/* ========================================
   Utility Classes - Heights
   ======================================== */
.h-25-percent {
    height: 25%;
}

.h-40-percent {
    height: 40%;
}

.h-60-percent {
    height: 60%;
}

.h-75-percent {
    height: 75%;
}

.h-80vh {
    height: 80vh;
}

.h-84vh {
    height: 84vh;
}

.h-85vh {
    height: 85vh;
}

.h-86vh {
    height: 86vh;
}

.h-91vh {
    height: 91vh;
}

.min-h-0 {
    min-height: 0;
}

/* ========================================
   Utility Classes - Flexbox
   ======================================== */
.flex-center {
    display: flex;
    align-items: center;
}

.flex-center-justify {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.flex-row-gap {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 8px;
}

/* ========================================
   Utility Classes - Status Colors
   ======================================== */
.status-online {
    color: limegreen;
}

.status-offline {
    color: red;
}

/* ========================================
   Utility Classes - Interaction
   ======================================== */
.clickable {
    cursor: pointer;
}

.non-selectable {
    user-select: none;
}

.clickable-icon {
    cursor: pointer;
    user-select: none;
}

.default-cursor {
    cursor: default;
}

/* ========================================
   Utility Classes - Transforms
   ======================================== */
.rotate-180 {
    transform: rotate(180deg);
}

/* ========================================
   Utility Classes - Overflow
   ======================================== */
.overflow-y-auto {
    overflow-y: auto;
}

.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-hidden {
    overflow: hidden;
}

/* ========================================
   Utility Classes - Text
   ======================================== */
.text-nowrap {
    white-space: nowrap;
}

.font-italic {
    font-style: italic;
}

/* ========================================
   Utility Classes - Positioning
   ======================================== */
.position-relative-full {
    position: relative;
    height: 100%;
}

.position-absolute-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.z-index-modal {
    z-index: var(--z-modal);
}

/* ========================================
   Utility Classes - Spacing
   ======================================== */
.margin-block-sm {
    margin-block: 5px;
}

.padding-inline-lg {
    padding-inline: 5rem;
}

.margin-left-auto {
    margin-left: auto;
}

.margin-right-sm {
    margin-right: 5px;
}

.margin-left-sm {
    margin-left: 4px;
}

.margin-left-md {
    margin-left: 8px;
}

.margin-top-md {
    margin-top: 8px;
}

.margin-bottom-0 {
    margin-bottom: 0;
}

/* ========================================
   Utility Classes - Layout Specific
   ======================================== */
.dashboard-container {
    outline: none;
    box-shadow: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ========================================
   Dashboard Tabs - Proper Height Constraint
   ======================================== */
/* .dashboard-tabs-wrapper base styles moved to inline - see DashboardMain.razor */
/* Descendant selectors remain here as they target DevExpress internals */

.dashboard-tabs-wrapper .dxbl-tabs {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-tabs-wrapper .dxbl-tabs-content-panel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-tabs-wrapper .dxbl-tabs-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Ensure child layouts respect height constraint */
.dashboard-tabs-wrapper .module-layout {
    height: 100%;
    min-height: 0;
}

.container-bg-tertiary {
    background-color: var(--bs-tertiary-bg);
    height: 100%;
    overflow-y: auto;
}

.filter-panel-container {
    background-color: var(--bs-tertiary-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: auto;
    /* DEPRECATED: Use .filter-sidebar instead for new layouts */
}

/* ========================================
   Module Layout - Used inside DxDrawer TargetContent
   ======================================== */
.module-layout {
    height: 100%;
    min-height: 0; /* Allows flex child to respect height constraint */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Filter Sidebar - Used inside DxDrawer BodyTemplate */
.filter-sidebar {
    margin-inline: 0;
    padding-inline: 0.5rem;
    display: grid;
    grid-template-rows: 1fr auto; /* Content takes available space, actions section auto-sized */
    overflow: hidden;
    background-color: var(--bs-tertiary-bg);
    height: 100%;
    width: 100%;
}

.filter-sidebar-content {
    margin-inline: 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Critical: allow grid item to shrink below content size */
    width: 100%;
}

/* Text truncation for filter sidebar elements */
.filter-sidebar-content .card-header span,
.filter-sidebar-content .font-italic,
.filter-sidebar-content span.font-italic {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-sidebar-actions {
    padding: 0.75rem 0;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.5rem;
}

.module-content {
    overflow: hidden;
    min-width: 0; /* Prevents grid blowout with long content */
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%; /* Ensure full height when used inside DxDrawer TargetContent */
}

/* Note: Responsive behavior is now handled by DxDrawer component.
   The drawer automatically manages sidebar visibility on different screen sizes. */

/* ========================================
   DevExpress DxDrawer - Remove Panel Border
   ======================================== */
/* Override DevExpress default border on drawer panel in Shrink mode */
.dxbl-drawer-left.dxbl-drawer-mini.dxbl-drawer.dxbl-drawer-shrink > .dxbl-drawer-panel,
.dxbl-drawer-left.dxbl-drawer-open.dxbl-drawer.dxbl-drawer-shrink > .dxbl-drawer-panel {
    border-right: none !important;
}

.container-bg-secondary {
    background-color: var(--bs-secondary-bg);
}

.border-secondary-subtle {
    border: solid 1px var(--bs-secondary-border-subtle);
}

/* ========================================
   Utility Classes - Sizing
   ======================================== */
.w-auto {
    width: auto;
}

.h-auto {
    height: auto;
}

.h-inherit {
    height: inherit;
}

.h-18 {
    height: 1.125rem;
}

.h-24 {
    height: 1.5rem;
}

.min-width-0 {
    min-width: 0;
}

.max-width-100 {
    max-width: 100%;
}

/* ========================================
   Utility Classes - Display
   ======================================== */
.flex-1 {
    flex: 1;
}

.line-height-1 {
    line-height: 1;
}

.line-height-half {
    line-height: 0.5;
}

.vertical-align-middle {
    vertical-align: middle;
}

/* ========================================
   Utility Classes - Buttons & Forms
   ======================================== */
.btn-unstyled {
    padding: 0;
    border: none;
    background: none;
}

.bg-inherit-no-border {
    background-color: inherit;
    border: none;
}

/* ========================================
   Utility Classes - Text Sizing
   ======================================== */
.text-xs {
    font-size: 0.8em;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base-sm {
    font-size: 0.9rem;
}

.text-center-italic-sm {
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

/* ========================================
   Utility Classes - Image Handling
   ======================================== */
.object-fit-cover {
    object-fit: cover;
}

.object-fit-contain {
    object-fit: contain;
}

/* ========================================
   DevExpress Component Styling Overrides
   Moved from scoped .razor.css files for proper application
   Scoped CSS cannot style third-party component internals
   ======================================== */

/* Menu component styles moved to inline - see Menu.razor */

/* Parking checkbox groups moved to inline - see device selection components */

/* Switch compact and import popup styles moved to inline - see export/import popups */

/* ========================================
   Table Styles for DevExpress DxGrid Components
   Moved from scoped .razor.css files because DxGrid renders table elements internally
   Scoped CSS cannot reach into component-rendered DOM
   ======================================== */

/* ParkingMain.razor - General table styling for DxGrid */
.table {
    width: 100%;
}

.table th {
    background-color: var(--bs-primary);
    color: white;
    border-bottom: none;
}

.table td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.table tr {
    height: 41px;
    align-items: center;
    vertical-align: middle;
    white-space: nowrap;
}

/* Search Module - Grid row hover for virtualized list view */
/* Must be global because GridRow is a child component - scoped CSS cannot reach it */
#resultsTable tbody tr:hover {
    background-color: #f3f6ff !important;
}

:root[data-bs-theme="dark"] #resultsTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075) !important;
}

/* Whitelist Popups - Row hover effects for DxGrid */
/* Used in: AddEntryPopup.razor, EditEntryPopup.razor, AddEntryToWhitelistsPopup.razor */
.row-pointer tbody tr:hover {
    background-color: #f3f6ff;
    cursor: pointer;
}

/* Validation summary and whitelist checkboxes moved to inline - see whitelist popups */

/* Icon button and menu/notification badge styles moved to inline - see ResultsMain.razor and Menu.razor */

/* ============================================================================
   Sortable.js Library Styles
   ============================================================================
   These classes are dynamically added by the Sortable.js drag-and-drop library.
   Since they're added to elements during runtime, scoped CSS cannot target them.
   ========================================================================= */

.sortable-ghost {
    visibility: hidden;
}

.sortable-chosen {
    opacity: 0.5;
    background-color: var(--bs-tertiary-bg) !important;
}

.sortable-fallback {
    opacity: 1 !important;
    transform: scale(1.08) translateY(-4px) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25),
                0 8px 16px rgba(0, 0, 0, 0.15) !important;
    z-index: 10000 !important;
    cursor: grabbing !important;
    transition: none !important;
}

/* ============================================================================
   MainLayout Top Row - Link Styles for Child Components
   ============================================================================
   The .top-row contains child components that render links and buttons.
   Scoped CSS cannot reach into child component elements, so these styles
   must be global. Previously used ::deep selector which is deprecated.
   ========================================================================= */

.top-row a, .top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

    .top-row a:hover, .top-row .btn-link:hover {
        text-decoration: underline;
    }

    .top-row a:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

@media (max-width: 640.98px) {
    .top-row a, .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .top-row.auth a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }
}

/* ============================================================================
   ThumbnailCard - DevExpress LoadingPanel
   ============================================================================
   The .dx-loadingpanel is rendered by DevExpress AnprImageDisplay component.
   Scoped CSS cannot style DevExpress internal elements.
   ========================================================================= */

.thumbnailItem .thumbnail-image .dx-loadingpanel {
    width: 100%;
    height: 100%;
}
