/* Mobile Horizontal Scroll Fix */
/* Prevent horizontal scrolling on all devices */

html {
    overflow-x: hidden !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw !important;
    position: relative;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* Ensure all elements stay within viewport */
body * {
    max-width: 100%;
}

/* Fix for rows causing overflow */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

.container, .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Fix for images, videos, and iframes */
img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto !important;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    /* Prevent any element from causing horizontal scroll */
    * {
        max-width: 100vw !important;
    }
    
    /* Fix navigation padding on mobile */
    nav.menu {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Fix for wide tables */
    table {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
    }
    
    /* Fix for pre and code blocks */
    pre, code {
        max-width: 100% !important;
        overflow-x: auto !important;
        word-wrap: break-word !important;
    }
    
    /* Fix for forms */
    form, input, textarea, select {
        max-width: 100% !important;
    }
    
    /* Fix for any absolute positioned elements */
    [style*="position: absolute"],
    [style*="position:absolute"] {
        max-width: 100vw !important;
    }
    
    /* Fix Bootstrap row negative margins */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Fix columns */
    [class*="col-"] {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Fix notification banner and marquee */
.notification-container,
.notification-text,
marquee {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Extra small devices */
@media (max-width: 480px) {
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Reduce padding on very small screens */
    nav.menu {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}