﻿/* ========================================
   SERVICEDOTT MOBILE RESPONSIVE FIXES
   ======================================== */


/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {


    /* Layout Changes for Mobile */
    .layout-container {
        flex-direction: column;
        min-height: auto;
    }

    /* Quick Access - Collapsible Header Only */
    .left-sidebar {
        width: 100% !important;
        max-width: 100%;
        height: auto !important;
        max-height: none;
        position: relative;
        margin: 5px 0;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        overflow: visible;
    }

    /* Header - Always Visible */
    .sidebar-header {
        padding: 15px;
        cursor: pointer;
        user-select: none;
        position: relative;
        border-radius: 8px 8px 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        /* Add dropdown indicator */
        .sidebar-header::after {
            content: '\f078'; /* fa-chevron-down */
            font-family: 'FontAwesome';
            font-size: 14px;
            transition: transform 0.3s ease;
            margin-left: auto;
        }

    .left-sidebar.mobile-expanded .sidebar-header::after {
        transform: rotate(180deg);
    }

    /* Menu Items - Hidden by Default */
    .left-sidebar-ui {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        padding: 0;
    }

    /* When Expanded */
    .left-sidebar.mobile-expanded .left-sidebar-ui {
        max-height: 600px;
        padding: 10px 0;
    }

    /* Hide Desktop Toggle Button */
    .sidebar-toggle {
        display: none !important;
    }

    /* Menu Items Styling */
    .left-sidebar a {
        padding: 14px 20px;
        font-size: 15px;
    }

        .left-sidebar a .menu-text {
            opacity: 1 !important;
            width: auto !important;
            overflow: visible !important;
        }

        .left-sidebar a i {
            margin-right: 15px;
        }

    .sidebar-header-text {
        opacity: 1 !important;
        width: auto !important;
    }

    /* Main Content - Full Width */
    .main-content-wrapper {
        width: 100%;
        padding: 10px;
        overflow-x: auto;
    }

    /* Ensure Content is Viewable */
    .container.body-content {
        width: 100%;
        padding: 0 10px;
        overflow-x: auto;
    }

    /* Footer Fixes */
    /*.Footer,
    .full-width-footer {
        position: relative !important;
        width: 100% !important;*/
      /*  margin-top: 20px;
        padding: 15px 10px;*/
        /*bottom: auto !important;
    }*/

    footer.Footer,
    .full-width-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 997;
        width: 100%;
        margin: 0;
        padding: 1px 1px !important;
        background: #fff;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    }


    /* Ensure footer doesn't hide content */
    body {
        padding-bottom: 0 !important;
    }

    /* Breadcrumb Responsive */
    .breadcrumb-wrapper {
        padding: 10px;
        overflow-x: auto;
    }

    .e-breadcrumb {
        width: 100%;
        font-size: 13px;
        height:30px !important;
    }

    /* Header Adjustments */
    #headerlayout {
        padding: 10px;
        /*flex-wrap: wrap;*/
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Modals - Responsive */
    .modalCancel1,
    .modalhtml {
        width: 95% !important;
        max-width: 500px;
        height: auto !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Settings Popup */
    .settings-popup {
        right: 0;
        left: auto;
        min-width: 160px;
    }

    /* Ensure Tables are Scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Grid Responsive */
    .e-grid {
        overflow-x: auto;
    }
}

@media (max-width: 767px) {
    .job-title {
        max-width:35ch !important;
    }
}

    /* Small Mobile Devices */
    @media (max-width: 480px) {


        .job-title {
            font-size: 1.5vw !important;
            font-weight: bold;
            color: var(--jo-jobtitle-name);
            margin-bottom: 15px;
            margin-top: 15px;
            max-width: 30ch;
            word-wrap: break-word;
            overflow-wrap: break-word;
            white-space: normal;
        }

        .left-sidebar ul {
            list-style: none;
            padding: 0 0 !important;
            margin: 0;
        }

        .sidebar-header {
            font-size: 14px;
            padding: 12px;
        }

        .left-sidebar a {
            padding: 12px 15px;
            font-size: 14px;
        }

        .main-content-wrapper {
            padding: 5px;
        }

        /* Smaller buttons */
        /*.btn-login,*/
        /*.btn-register,
    .btn-apply {
        font-size: 13px;
        padding: 8px 12px;
    }*/

        /* User greeting - Stack on very small screens */
        /*.user-greeting {
        flex-direction: column;
        align-items: flex-start;
        font-size: 13px;
    }*/
    }

    /* Landscape Orientation */
    @media (max-width: 768px) and (orientation: landscape) {

        .left-sidebar.mobile-expanded .left-sidebar-ui {
            max-height: 300px;
            overflow-y: auto;
        }
    }

    /* ========================================
   ADDITIONAL MOBILE OPTIMIZATIONS
   ======================================== */

    /* Prevent horizontal scroll */
    @media (max-width: 768px) {
        html, body {
            overflow-x: hidden;
            width: 100%;
        }

        .wrapper,
        .container {
            overflow-x: hidden;
            max-width: 100%;
        }

        /* Fix any absolute positioned elements */
        .modal-backdrop {
            width: 100vw !important;
        }

        /* Ensure images don't overflow */
        img {
            max-width: 100%;
            height: auto;
        }

        /* Fix for floating elements */
        .clearfix::after {
            content: "";
            display: table;
            clear: both;
        }
    }

    /* ========================================
   TOUCH INTERACTION IMPROVEMENTS
   ======================================== */

    @media (max-width: 768px) {

        /* Larger touch targets */
        /*.left-sidebar a,
    .sidebar-header,
    button,*/
        /*.btn-login,*/
        /*.btn-apply {
        min-height: 44px;
        min-width: 44px;
    }*/

        /* Remove hover effects on touch devices */
        @media (hover: none) {
            .left-sidebar a:hover {
                background: transparent;
            }

            .left-sidebar a:active {
                background: #f8f9fa;
            }
        }
    }

    /* ========================================
   PRINT STYLES
   ======================================== */

    @media print {
        .left-sidebar,
        .sidebar-toggle,
        .header-actions,
        .Footer {
            /*display: none !important;*/
        }

        .main-content-wrapper {
            width: 100%;
            margin: 0;
            padding: 0;
        }
    }

    /* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

    /* Focus visible for keyboard navigation */
    .left-sidebar a:focus-visible,
    .sidebar-header:focus-visible {
        outline: 2px solid #c0392b;
        outline-offset: 2px;
    }

    /* Screen reader only text */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        white-space: nowrap;
        border: 0;
    }
