/* Mobile responsive overrides */

/* Mobile header bar with hamburger toggle */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.15);
    z-index: 25;
    align-items: center;
    padding: 0 15px;
}

.mobile-header .mobile-brand {
    font-size: 16px;
    font-weight: 500;
    color: #54667a;
    margin-left: 10px;
}

.mobile-header .hamburger-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #54667a;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
}

/* Sidebar overlay backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 19;
}

@media (max-width: 767px) {
    .mobile-header {
        display: flex;
    }

    /* Push page content below the fixed mobile header */
    .page-wrapper {
        margin-left: 0 !important;
        padding-top: 60px !important;
    }

    /* Sidebar as a slide-out drawer */
    .left-sidebar {
        position: fixed !important;
        left: -240px !important;
        top: 0;
        transition: left 0.3s ease;
        z-index: 30 !important;
        height: 100% !important;
        padding-top: 10px;
    }

    body.mobile-sidebar-open .left-sidebar {
        left: 0 !important;
    }

    body.mobile-sidebar-open .sidebar-overlay {
        display: block;
    }

    /* Prevent horizontal scroll */
    #main-wrapper {
        overflow-x: hidden;
    }

    /* Free version limits box - don't float on mobile */
    .free-limits-box {
        float: none !important;
        margin-top: 15px;
    }

    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Chosen dropdown responsive */
    .chosen-container {
        max-width: 100% !important;
    }

    /* Sidebar scroll - disable slimScroll fixed height on mobile */
    .scroll-sidebar,
    .scroll-sidebar > .slimScrollDiv {
        height: auto !important;
        overflow: visible !important;
    }

    /* Tables in forms shouldn't force width */
    table {
        max-width: 100%;
    }

    /* Projection select should be responsive */
    select.chosen,
    select[style*="width: 350px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Tablet tweaks */
@media (min-width: 768px) and (max-width: 1023px) {
    .page-wrapper {
        margin-left: 240px;
    }
}

/* Ensure content sections don't overflow */
.container-fluid.content {
    overflow-x: hidden;
    word-wrap: break-word;
}
