/* Fix for AdminLTE scrolling - Keep sidebar fixed and main content scrollable */

/* Make sure wrapper takes full height and PREVENT DOUBLE SCROLLBARS */
html {
    height: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll on html element */
}

body {
    min-height: 100vh; /* Ensure body takes at least full viewport height */
    margin: 0;
    overflow-y: auto;  /* Allow body to scroll vertically */
    overflow-x: hidden; /* Prevent horizontal scroll on body element */
    display: flex;
    flex-direction: column;
}

.wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Wrapper takes up available space within body's flex context */
    overflow-x: hidden; /* Prevent horizontal scroll on wrapper */
}

/* Main Sidebar fixed with its own scrollbar */
.main-sidebar {
    position: fixed;
    height: 100vh;
    overflow-y: hidden;
    z-index: 1038;
}

/* Sidebar inner scrolling area */
.sidebar {
    height: calc(100% - (3.5rem + 1px));
    overflow-y: auto;
    padding: 0 0.5rem;
}

/* Enable native scrollbar for sidebar on hover */
.sidebar:hover::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

.sidebar:hover {
    scrollbar-width: thin;
}

/* Content wrapper scrollable independently */
.content-wrapper {
    flex-grow: 1; /* Allow content to take available vertical space */
    /* Removed fixed height, independent overflow, and bottom padding for fixed footer */
    /* scrollbar-width: thin; Removed as it's not independently scrolling */
}

/* Fix for content wrapper in layout-fixed - This rule is no longer needed with a non-fixed footer */
/*
.layout-fixed .content-wrapper {
    padding-bottom: 60px;
}
*/

/* Make sure content wrapper has proper margins with fixed navbar */
.layout-navbar-fixed .wrapper .content-wrapper {
    margin-top: calc(3.5rem + 1px);
}

/* Footer adjustments - make it part of the normal document flow */
.main-footer {
    position: relative; /* Changed from fixed to relative (or static) */
    flex-shrink: 0; /* Prevent footer from shrinking in flex layout */
    /* Removed bottom, width, z-index properties related to fixed positioning */
}

/* Adjust content bottom padding to account for footer - This rule is no longer needed */
/*
.layout-footer-fixed .wrapper .content-wrapper {
    padding-bottom: calc(3.5rem + 1px);
}
*/

/* Ensure brand link is fixed at the top of sidebar */
.brand-link {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Fix for smaller screens */
@media (max-width: 767.98px) {
    .content-wrapper {
        margin-left: 0 !important;
    }
    
    .main-sidebar, .main-sidebar::before {
        box-shadow: none !important;
        margin-left: -250px;
    }
    
    .sidebar-open .main-sidebar, .sidebar-open .main-sidebar::before {
        margin-left: 0;
    }
}

/* Dark Mode Fixes */
body.dark-mode .navbar-white {
    background-color: #343a40 !important;
    border-color: #4b545c !important;
}

body.dark-mode .navbar-light .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-mode .navbar-light .navbar-nav .nav-link:hover,
body.dark-mode .navbar-light .navbar-nav .nav-link:focus {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.dark-mode .navbar-light .navbar-brand,
body.dark-mode .navbar-light .navbar-brand:hover {
    color: #fff !important;
}

body.dark-mode .navbar-light .navbar-toggler {
    color: rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .form-control-navbar {
    background-color: #3f474e !important;
    border: 1px solid #4b545c !important;
    color: #fff !important;
}

body.dark-mode .form-control-navbar::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.dark-mode .btn-navbar {
    background-color: #3f474e !important;
    border: 1px solid #4b545c !important;
    color: #fff !important;
}

body.dark-mode .btn-navbar:hover {
    background-color: #4b545c !important;
} 