/* Layout Fix CSS - Remove gaps and ensure proper spacing */

/* Global reset to remove any unwanted margins/padding */
* {
    box-sizing: border-box;
}

/* Ensure no horizontal scroll */
html {
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Main content container fixes */
#main-content {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Content wrapper inside main-content */
#main-content > div {
    width: 100%;
    min-height: calc(100vh - 64px); /* Full height minus header */
    padding-top: 64px; /* Header height */
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Mobile-first approach - no sidebar margin */
@media (max-width: 639px) {
    #main-content {
        margin-left: 0 !important;
        width: 100vw !important;
    }
    
    #main-content > div {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Desktop with sidebar */
@media (min-width: 640px) {
    /* Normal sidebar (256px / 16rem) */
    #main-content.sm\:ml-64 {
        margin-left: 16rem;
        width: calc(100vw - 16rem);
    }
    
    /* Collapsed sidebar (64px / 4rem) */
    #main-content.sm\:ml-16 {
        margin-left: 4rem;
        width: calc(100vw - 4rem);
    }
}

/* Header positioning */
nav.fixed {
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 50;
}

/* Sidebar positioning */
#logo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 40;
}

/* Ensure sidebar overlay doesn't cause horizontal scroll */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
}

/* Remove any Bootstrap container margins that might interfere */
.container,
.container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Ensure page content uses full width */
.page-content,
.content-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Fix for any card or component margins on mobile */
@media (max-width: 639px) {
    .card,
    .container,
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
