/* =================================================================
   CRITICAL LAYOUT FIXES FOR MUDBLAZOR LIMITATIONS
   These styles work around known MudBlazor issues with fixed footers
   ================================================================= */

/* Main content padding to account for fixed footer */
.main-content-padding {
    box-sizing: border-box;
}

/* Container wrapper for proper centering */
.standardpage-container-wrapper {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Critical scrolling container with footer clearance */
.standardpage-scrollable {
    max-height: calc(100vh - 8.5rem); /* Viewport - AppBar (64px) - Footer (45px) - margins */
    overflow-y: auto;
    padding-bottom: 1rem;
    margin-top: 0.5rem;
    padding-left: 16px;
    padding-right: 8px; /* Account for scrollbar */
    margin-right: 8px; /* Clearance for scrollbar */
}

/* Outer edge scrolling (default - brand manager preference) */
/* MudBlazor's layout system already handles AppBar/Footer positioning, */
/* so we just need to make MudMainContent scrollable and fill available space */
.scrollbar-outer-edge {
    overflow-y: auto !important;
    height: 100% !important;
}

.scrollbar-outer-edge .standardpage-scrollable {
    max-height: none !important;
    overflow-y: visible !important;
    margin-right: 0;
    padding-right: 16px; /* Normal padding, no scrollbar offset */
}

.scrollbar-outer-edge .standardpage-container-wrapper {
    padding-right: 8px !important; /* Symmetrical padding when scrollbar is on outer edge */
}

/* Ensure MudContainer centers when constrained */
.mud-container:not(.mud-container-maxwidth-false) {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Drawer padding to prevent content behind footer */
.drawer-padding {
    padding-bottom: 60px; /* Slightly more than footer height */
}

/* Navigation drawer three-part structure */
.nav-drawer-content {
    height: calc(100vh - 7rem); /* Account for footer height */
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Top section: UserCard (fixed at top) */
.nav-drawer-top {
    flex-shrink: 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Middle section: Main Navigation (scrollable) */
.nav-drawer-middle {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    padding-right: 8px; /* Account for scrollbar */
}

/* Bottom section: Account Actions (fixed at bottom) */
.nav-drawer-bottom {
    flex-shrink: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background-color: rgba(255, 255, 255, 0.02);
}

/* Ensure nav groups and links don't get cut off */
.mud-nav-group .mud-nav-link {
    padding-left: 16px;
}

.mud-nav-group .mud-nav-group .mud-nav-link {
    padding-left: 32px; /* Nested nav groups get extra indentation */
}

/* Fixed footer bar styling */
/*.footer-bar {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    height: 45px;
    background-color: #373740;
    z-index: 100;
}*/

/* Additional bottom padding for MudMainContent */
.mud-main-content {
    padding-bottom: 50px !important; /* Ensure content doesn't go behind footer */
}

/* Remove bottom padding on mobile when footer is hidden */
@media (max-width: 960px) {
    .pb-0-mobile {
        padding-bottom: 0 !important;
    }

    /* Adjust standardpage scrollable height when footer is hidden on mobile */
    .standardpage-scrollable {
        max-height: calc(100vh - 5rem) !important; /* Only subtract AppBar (64px) on mobile, no footer */
    }

    /* Outer edge scrolling inherits height from MudBlazor layout - no mobile override needed */

    /* Adjust nav drawer height when footer is hidden on mobile */
    .nav-drawer-content {
        height: calc(100vh - 4rem) !important; /* Only subtract AppBar on mobile, no footer */
    }
}
