﻿/* Mobile-First Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

.input-validation-error {
    border: 1px solid #ff0000;
    background-color: #ffeeee;
}

.clsheaderAccountNa {
    cursor: pointer;
}

.clsdetailAccountNa {
    background-color: #f1efef;
    color: black;
}

.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
}

.AccountClass {
    color: #0041f7 !important;
    cursor: pointer !important;
}

.clsIconsGreen {
    color: #358a39;
    cursor: pointer;
}

.clsIconsBlack {
    color: black;
    cursor: pointer;
}

.clsIconsRed {
    color: #ff0000;
    cursor: pointer;
}

.clsIconsBlue {
    color: #0008ff;
    cursor: pointer;
}

@media (max-width:768px) {
    .layouthdr, .LogoUser, .clsHideMobile {
        display: none;
    }

    #btnSave, #btnDelete, #btnPost, #btnFind, #btnPrint, #btnExcel, #btnUpdateBalance, #btnClear, #btnNew, #btnAdd, #btnClosed, #btnRefresh {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
    }

    .clsBtnSave .btn-success {
        margin-bottom: 10px;
    }

    .Radiolabel {
        padding: 8px 25px;
    }

        .Radiolabel input {
            margin-top: 15px;
        }

    .clsEmptyDiv, .clsEmptyLabel {
        display: none;
    }

    /* Mobile Navigation */
    .navbar-collapse {
        max-height: 400px;
        overflow-y: auto;
    }

    /* Mobile Forms */
    .form-control {
        font-size: 16px;
        min-height: 44px;
        padding: 10px 12px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
    }

    /* Mobile Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin-bottom: 15px;
    }

    .table {
        font-size: 14px;
        min-width: 100%;
    }

    .table thead th {
        white-space: nowrap;
        padding: 8px 4px;
        font-size: 13px;
    }

    .table tbody td {
        padding: 8px 4px;
        font-size: 13px;
    }

    /* Mobile Container */
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Mobile Cards */
    .card {
        margin-bottom: 15px;
    }

    .card-body {
        padding: 15px;
    }

    /* Mobile Modals */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-body {
        padding: 15px;
    }

    /* Touch-friendly Links */
    a, button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Text */
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 16px;
    }

    /* Mobile Spacing */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .col, [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Stack columns on mobile */
    [class*="col-"] {
        width: 100%;
        float: none;
    }
}

@media (min-width:768px) {
    /*.clsBtnSave {
                padding-top: 2em;
            }*/
    .Radiolabel {
        float: left;
        padding: 1em 1em;
        text-align: center;
    }
}


.Radiolabel input {
    margin-left: 7px;
}

input[type="checkbox"] {
    width: 20px;
    height: 17px;
    cursor: pointer;
}

input[type="radio"] {
    width: 20px;
    height: 17px;
    cursor: pointer;
}

/*.dropdown:hover .dropdown-menu {
            display: block;
            margin-top: 0;
        }*/

#loading {
    background: url('../Images/New-Loading.gif') no-repeat center center;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 9999999;
}

.overlay {
    background: #ffffff;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /*opacity: 0.5;*/
}

/*.checkbox, .radio {
            margin-bottom: 0px !important;
        }

        .icon-home {
            color: #ffffff;
            padding: 4px;
            padding-left: 10px;
            cursor: pointer;
        }

        .selectedRow {
            background-color: #c9ffe6 !important;
            color: black;
        }

        .datepicker {
            padding: 6px 12px !important;
        }

        .myTextArea {
            width: 100%;
            height: 80px;
            min-height: 60px;
            min-width: 326px;
            max-height: 100px;
            max-width: 100%;
        }

        .form-control {
            border-radius: 4px;
        }

        ul::-webkit-scrollbar {
            display: none;
        }*/

.form-control:focus {
    color: #000000 !important;
}

.form-control {
    color: #000000 !important;
    border: 1px solid #9e9e9e;
}

.inlineDisply {
    display: inline-block !important;
}

.clsDataTableHead {
    color: #6e707e;
    background-color: #165986;
    border-color: #e3e6f0;
}

    .clsDataTableHead tr th {
        border-bottom: 2px solid #ddf1ff;
        color: #ffffff;
    }

.clsDataTableFooter {
    color: #6e707e;
    background-color: #165986;
    border-color: #e3e6f0;
}

    .clsDataTableFooter th {
        border-top: 2px solid #ddf1ff;
        color: #ffffff;
    }

.table tr:nth-child(even) {
    /*background-color: rgb(104 193 253 / 18%);*/
    background-color: #EDF3DF;
}

.selectedRow {
    background-color: #8aacc3 !important;
    color: white;
}

    /*.selectedRow:hover {
        color: #000000 !important;
    }*/

.clsErrorMsg {
    color: red;
    display: none;
    padding-top: 15px;
}

.buttonsToHide {
    display: none;
}

.Redcolor {
    color: red !important;
}

/* Styles for PC or computer website */
@media (min-width: 768px) {
    #accordionSidebar {
        display: block; /* Show the ul element */
    }

    #accordionSidebarMobile {
        display: none; /* Hide the div element */
    }

    #sidebarToggleTop {
        display: none !important;
    }

    /* Desktop sidebar styles */
    #accordionSidebar .nav-item {
        width: 200px;
    }

    #accordionSidebar .nav-link {
        text-align: left !important;
        font-size: 13px !important;
        width: 200px;
    }

    #accordionSidebar .collapse {
        margin-left: 105px;
    }

    /* Override toggled class to show menu text on desktop */
    #accordionSidebar.toggled .nav-item .nav-link span {
        display: inline !important;
    }
}

/* Styles for mobile browser */
@media (max-width: 767px) {
    #accordionSidebar {
        display: block !important;
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }

    #accordionSidebar.show-mobile-sidebar {
        left: 0;
    }

    #accordionSidebarMobile {
        display: block; /* Show the div element */
    }

    /* Sidebar backdrop */
    body.sidebar-toggled::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        animation: fadeIn 0.3s;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Ensure sidebar content is visible */
    #accordionSidebar .sidebar-brand,
    #accordionSidebar .nav-item,
    #accordionSidebar hr {
        display: block !important;
    }

    /* Mobile sidebar toggle button */
    #sidebarToggleTop {
        display: inline-flex !important;
        font-size: 24px;
        color: #fff;
        padding: 8px 12px;
        background: transparent;
        border: none;
    }

    #sidebarToggleTop:hover,
    #sidebarToggleTop:focus {
        background: rgba(255, 255, 255, 0.1);
        outline: none;
    }

    /* Adjust content wrapper for mobile */
    #content-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Fix submenu visibility on mobile */
    #accordionSidebar .collapse {
        margin-left: 0 !important;
        width: 100% !important;
    }

    #accordionSidebar .collapse-inner {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }

    #accordionSidebar .collapse-item {
        padding: 10px 15px !important;
        font-size: 13px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    #accordionSidebar .collapse-header {
        padding: 8px 15px !important;
        font-size: 12px !important;
    }

    #accordionSidebar .nav-item {
        width: 100% !important;
    }

    #accordionSidebar .nav-link {
        width: 100% !important;
        padding: 12px 15px !important;
    }
}

/* Small Mobile Devices (phones in portrait) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .form-control {
        font-size: 14px;
    }

    .btn {
        font-size: 14px;
        padding: 10px 16px;
    }

    .table {
        font-size: 12px;
    }

    .table thead th,
    .table tbody td {
        padding: 6px 2px;
        font-size: 12px;
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
}

/* Tablet Devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
    }

    .table {
        font-size: 15px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }

    .sidebar {
        width: 200px;
    }
}

/* Mobile Utility Classes */
.mobile-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-no-padding {
    padding: 0 !important;
}

.mobile-full-width {
    width: 100% !important;
}

/* Responsive Images */
/*img {
    max-width: 100%;
    height: auto;
}*/

/* Improved Mobile Touch Targets */
.btn, .form-control, select, textarea, input[type="text"], 
input[type="password"], input[type="email"], input[type="number"], 
input[type="tel"], input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Mobile-friendly Dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: absolute;
        max-height: 300px;
        overflow-y: auto;
        width: 100%;
        border-radius: 8px;
    }

    .dropdown-item {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Mobile Pagination */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination li {
        margin: 2px;
    }

    .pagination li a,
    .pagination li span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Mobile Alert Messages */
@media (max-width: 768px) {
    .alert {
        margin: 10px;
        padding: 12px;
        font-size: 14px;
    }
}

/* Improve table readability on mobile */
@media (max-width: 768px) {
    .table-hover tbody tr:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    /* Sticky table header for better mobile scrolling */
    .table-responsive thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

/* Mobile-friendly Icons */
@media (max-width: 768px) {
    .clsIconsGreen,
    .clsIconsBlack,
    .clsIconsRed,
    .clsIconsBlue {
        font-size: 20px;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Prevent horizontal scroll */
body, html {
    overflow-x: hidden;
    max-width: 100%;
}

/* Mobile Loading Overlay */
@media (max-width: 768px) {
    #loading {
        background-size: 100px 100px;
    }
}