﻿/*#region Sahzili Flexbox Table*/

/* Outer wrapper */

.sh-table-wrapper {
    display: flex;
    flex-direction: column;
    height: 85vh; /* Set total height you want */
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    font-family: Arial, sans-serif;
    /*direction: rtl;*/
}

.sh-toolbar-wrapper {
    flex: 0 0 auto;
    overflow: hidden;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 15px;
}

/* Toolbar fixed on top */
.sh-toolbar {
    padding-block: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sh-toolbar-selector select {
    width: 60px;
    padding-block: 3px;
}

/* New wrapper enables horizontal scroll for header + body */
.sh-horizontal-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden; /* vertical handled by .sh-table-body */
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Header + filter wrapper fixed below toolbar */
.sh-header-wrapper {
    /*background: #e9ecef;*/ /* Bootstrap header background */
    border-bottom: 1px solid #ccc;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 100;
}

/* Header and filter rows */
.sh-table-row {
    display: flex;
    min-width: max-content;
    border-bottom: 1px solid #ccc;
}

.sh-header {
    font-weight: bold;
    color: #495057;
}

/*.sh-filter {
    background: #f8f9fa;
}*/

/* Cells */
.sh-cell {
    padding: 8px 12px;
    white-space: nowrap;
    border-right: 1px solid #ccc;
    flex-shrink: 0;
}
 

/* Inputs styling */
.sh-filter input {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .sh-filter input:focus {
        outline: none;
        border-color: #00a79d;
        box-shadow: 0 0 0 0.2rem rgba(0, 167, 157, 0.25);
    }

.sh-body-wrapper {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    overflow: hidden; /* hide overflow on wrapper */
}

/* Scrollable table body */
.sh-header-and-body-container {
    max-height: calc(90vh - 130px);
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: auto;
    background: white;
}


    /* Data rows styles */
    .sh-table-body .sh-table-row {
        border-bottom: 1px solid #eee;
        transition: background-color 0.2s ease;
    }

        .sh-table-body .sh-table-row:nth-child(odd) {
            background-color: #fafafa;
        }

        .sh-table-body .sh-table-row:hover {
            background-color: #eaeaea;
        }

/* Footer bar fixed at bottom */
.sh-footer-bar {
    flex: 0 0 auto;
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #495057;
    gap: 10px;
}

    .sh-footer-bar button {
        padding: 6px 12px;
        border: 1px solid #ccc;
        background: white;
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.15s ease;
    }

        .sh-footer-bar button:hover {
            background-color: #e9ecef;
        }

/* === Guest edits: flip & pin Actions column without changing scroll direction === */

/* Arabic mode: Actions column first (left) + data starts from right */
/*.sh-rtl .sh-table-row {*/
    /*flex-direction: row-reverse;*/ /* make data cells flow from right to left */
/*}*/

.sh-rtl .sh-header-and-body-container {
    direction: rtl; /* flips scroll origin */
}

.sh-rtl .sh-cell {
    direction: ltr;
    text-align: right; /* optional: right align text for better Arabic look */
}

/* Make Actions column a fixed width so sticky works cleanly */
.sh-col-actions {
    flex: 0 0 120px; /* adjust if you want wider/narrower */
    background: #fff; /* so it doesn't show cells underneath while sticky */
}

/* Actions column stays sticky on the left */
.sh-rtl .sh-col-actions {
    order: 9999; /* ensure it's visually the first column on the left */
    position: sticky;
    left: 0;
    z-index: 3;
    border-right: 1px solid #ccc;
    box-shadow: 4px 0 6px -4px rgba(0,0,0,0.25);
}


/* English mode: Actions column last (right) + sticky on the right */
.sh-ltr .sh-col-actions {
    order: 9999; /* move it to the end of each row */
    position: sticky;
    right: 0;
    z-index: 3;
    border-left: 1px solid #ccc;
    box-shadow: -4px 0 6px -4px rgba(0,0,0,0.25);
}

/* Ensure header/filter Action cells sit above body cells */
.sh-rtl .sh-header .sh-col-actions,
.sh-rtl .sh-filter .sh-col-actions,
.sh-ltr .sh-header .sh-col-actions,
.sh-ltr .sh-filter .sh-col-actions {
    z-index: 4; /* above the body rows */
}


/*#endregion*/


/*#region Shazili Button*/

.sh-btn {
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, filter 0.2s ease;
    user-select: none;
}

.sh-btn:hover {
  filter: brightness(85%);
}

.sh-btn-pdf {
    background-color: #d9534f; /* red */
}

.sh-btn-excel {
    background-color: #28a745; /* green */
}

.sh-btn-refresh {
    background-color: #17a2b8; /* blue */
}

.sh-btn-add {
    background-color: #20c997; /* teal */
}

.sh-btn-saveas {
    background-color: #fd7e14; /* orange */
}

.sh-btn-delete {
    background-color: #c82333; /* dark red */
}

.sh-btn-edit {
    background-color: #007bff; /* Bootstrap primary blue */
}

/*#endregion*/


/*#region Actions Side Bar*/

.sh-col-actions {
    position: sticky;
    left: 0;
    background: #fff; /* same as table background */
    z-index: 10; /* make sure it’s above other cells */
    border-right: 1px solid #ccc;
    min-width: 120px; /* adjust width as needed */
    padding: 8px 12px;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 100px;
}
    .sh-col-actions button {
        cursor: pointer;
        border: 1px solid #ccc;
        background: #f8f9fa;
        border-radius: 4px;
        transition: background-color 0.2s ease;
        width: 29px;
    }

        .sh-col-actions button:hover {
            background-color: #e2e6ea;
        }

        .sh-col-actions button img {
            width: 100%;
            object-fit: cover;
        }

/*#endregion*/


/* === Dashboard Layout === */
.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

/* Sidebar */
.sidebar {
    flex: 0 0 220px; /* fixed width */
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    width: 230px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sticky-sh-side-container {
    position: sticky;
    top: -16px;
    background-color: #2c3e50;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    width: 100%;
    /*padding-inline: 12px;*/
}

.sidebar .logo {
    font-weight: bold;
    margin-bottom: 1rem;
    color: #fff;
    text-decoration: none;
}

    .sidebar nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .sidebar nav ul li {
            margin: 0.5rem 0;
        }

    .sidebar nav a {
        color: white;
        text-decoration: none;
        display: flex;
        align-items: center;
        column-gap: 10px;
        padding: 0.5rem;
        border-radius: 4px;
        transition: background 0.2s;
    }

        .sidebar nav a.active,
        .sidebar nav a:hover {
            background: #34495e;
        }

/* Main Content */
.main-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden; /* avoid double scrollbars */
}

/* LTR / RTL support for entire dashboard */
.dashboard-layout.ltr {
    direction: ltr;
}

.dashboard-layout.rtl {
    direction: rtl;
}

    .dashboard-layout.rtl .sidebar {
        order: 2; /* move sidebar to right */
    }

    .dashboard-layout.rtl .main-content {
        order: 1;
    }


.sidebar .burger {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
    align-self: start;
}

.sidebar.collapsed .logo,
.sidebar.collapsed nav ul li a {
    opacity: 0; /* hide text when collapsed */
    pointer-events: none;
}

.sidebar.collapsed {
    width: 60px; /* shrink sidebar */
}

.main-content {
    transition: margin 0.3s ease;
}

.dashboard-layout.ltr .sidebar.collapsed ~ .main-content {
    margin-left: 60px; /* grid expands */
}

.dashboard-layout.rtl .sidebar.collapsed ~ .main-content {
    margin-right: 60px;
}


/*#region Buttons*/



/*#endregion*/
                                                      /*Media Query*/
.test-background {
    background-color: yellow;
}

@media(max-width: 1200px) {

    .side-bar-mobile-state {
        width: 60px;
    }
}