/* Hybrid Theme CSS - Isolates MudBlazor from LeptonX */
/* Phase 7 Implementation - Tested and Verified */

/* Ensure MudBlazor styles don't affect LeptonX components */
.lpx-sidebar,
.lpx-topbar,
.lpx-toolbar,
.lpx-header,
.lpx-menu,
.lpx-breadcrumb,
.lpx-page-title,
.lpx-content-toolbar,
.lpx-mobile-navbar,
.lpx-footer {
    /* Protect LeptonX components from MudBlazor styling */
    /* Using revert-layer for better isolation */
    all: revert-layer;
}

/* Fix any spacing issues between shell and content */
.lpx-content-container {
    padding: 0;
    margin: 0;
}

/* Ensure consistent background for content area */
.lpx-content {
    background-color: var(--lpx-content-bg, #f5f5f5);
    min-height: calc(100vh - var(--lpx-topbar-height, 64px));
}

/* MudBlazor content area adjustments */
.mud-container {
    /* Ensure MudBlazor containers work well within LeptonX content area */
    width: 100%;
    box-sizing: border-box;
}

/* Fix potential z-index conflicts */
.lpx-sidebar {
    z-index: 1040; /* Above MudBlazor overlays but below dialogs */
}

.lpx-topbar {
    z-index: 1030;
}

/* MudBlazor dialogs and overlays should be on top */
.mud-dialog-container,
.mud-overlay {
    z-index: 1050 !important;
}

.mud-popover {
    z-index: 1060 !important;
}

.mud-snackbar {
    z-index: 1070 !important;
}

/* Ensure MudBlazor theme colors don't override LeptonX navigation */
.lpx-sidebar .mud-theme-primary,
.lpx-topbar .mud-theme-primary {
    color: inherit !important;
    background-color: inherit !important;
}

/* Fix any potential font conflicts */
.lpx-sidebar,
.lpx-topbar {
    font-family: var(--lpx-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif) !important;
}

/* Ensure proper content area padding when using MudContainer */
.lpx-content .mud-container {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Additional visual consistency improvements */
.lpx-content {
    /* Smooth transition when navigating between pages */
    transition: opacity 0.15s ease-in-out;
}

/* Ensure MudBlazor tables align well with LeptonX layout */
.lpx-content .mud-table {
    background-color: var(--lpx-card-bg, #ffffff);
    border-radius: var(--lpx-border-radius, 0.25rem);
}

/* Align MudBlazor card shadows with LeptonX style */
.lpx-content .mud-paper {
    box-shadow: var(--lpx-card-shadow, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .lpx-content .mud-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Ensure LeptonX menu items aren't affected by MudBlazor */
.lpx-menu-item {
    all: revert-layer;
}

/* Fix any button conflicts in the navigation area */
.lpx-sidebar .mud-button,
.lpx-topbar .mud-button {
    all: revert;
}