/* Global Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* Remove Bootstrap's default focus outline and add a better one */
*:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Typography */
body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover {
        color: #0056b3;
    }

/* Buttons */
.btn {
    transition: all 0.2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* Print Styles */
@media print {
    .sidebar,
    .main-navbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
    }
}



/* ============================================================ */
/* Loading overlay styling */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.labels-container {
    /* background-color: #61398f; */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 14px;
    color: #fff;
}



/* ============================================================ */
table input {
    height: 35px !important;
}

    table input[type="checkbox"] {
        height: 15px !important;
        width: 15px !important;
    }


.select2.select2-container.select2-container--default {
    width: 100% !important;
}

.custom-toast.toast-success {
    background-color: green !important;
}

.custom-toast.toast-error {
    background-color: red !important;
}

.custom-toast.toast-info {
    background-color: blue !important;
}

.custom-toast.toast-warning {
    background-color: yellow !important;
    color: black !important;
}
/* Ensure LTR alignment for English */
.text-start-ltr {
    direction: ltr !important;
    text-align: left !important;
}

/* Ensure RTL alignment for Arabic */
.text-start-rtl {
    direction: rtl !important;
    text-align: right !important;
}


.sidebar .nav-link.active,
.sidebar .nav-item.active > .nav-link {
    background: #4361ee;
    color: white;
    font-weight: 600;
}






















/* Mobile Responsive Fix for Sidebar */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

        /* Show sidebar when toggled */
        .sidebar.show {
            left: 0;
        }

    /* Ensure main content takes full width on mobile */
    .content_inside,
    .layout-page,
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Add overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

        .sidebar-overlay.show {
            display: block;
        }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Ensure tables are responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Tablet and below */
@media (max-width: 991px) {
    .content_inside {
        padding: 15px !important;
    }

    /* Make form controls stack better on mobile */
    .form_Handle {
        flex-direction: column !important;
        align-items: stretch !important;
    }

        .form_Handle .form-control,
        .form_Handle .form-select,
        .form_Handle .btn {
            width: 100% !important;
            margin-bottom: 10px;
        }
}