/* Flag Icons Styles */
.fi {
    margin-right: 5px;
    vertical-align: middle;
    border-radius: 2px;
}

.dropdown-item .fi {
    margin-right: 8px;
}

.btn .fi {
    margin-right: 5px;
}

/* Global Fonts */
[lang="ar"], [dir="rtl"] {
    font-family: 'Cairo', 'DejaVu Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

[lang="en"], [lang="fr"], [dir="ltr"] {
    font-family: 'Cabin', 'DejaVu Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

body {
    font-family: 'Cabin', 'DejaVu Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[dir="rtl"] body {
    font-family: 'Cairo', 'DejaVu Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

body {
    background-color: #f5f5f5;
    margin: 0 !important;
    padding: 0 !important;
}

html {
    margin: 0 !important;
    padding: 0 !important;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] .main-content {
    margin-right: 250px;
    margin-left: 0;
    margin-top: 56px;
}

[dir="ltr"] .main-content {
    margin-left: 250px;
    margin-right: 0;
    margin-top: 56px;
}

[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

[dir="ltr"] .sidebar {
    left: 0;
    right: auto;
}

.main-content {
    padding: 20px;
    min-height: calc(100vh - 56px);
    margin-top: 56px;
}

.sidebar {
    position: fixed;
    top: 0;
    width: 250px;
    height: 100vh;
    background-color: #343a40;
    overflow-y: auto;
    z-index: 1000;
    margin: 0 !important;
    padding: 0 !important;
    border-top: none !important;
    padding-top: 56px !important;
    box-sizing: border-box;
}

.sidebar .nav-link {
    color: #fff;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

[dir="rtl"] .sidebar .nav-link i {
    margin-left: 10px;
    margin-right: 0;
}

[dir="ltr"] .sidebar .nav-link i {
    margin-right: 10px;
    margin-left: 0;
}

.sidebar .nav-link i {
    width: 20px;
}

.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 20px;
}

.table-responsive {
    border-radius: 0.375rem;
}

.btn {
    border-radius: 0.375rem;
}

.form-control, .form-select {
    border-radius: 0.375rem;
}

/* Global Input Field Border Styling */
input.form-control,
select.form-select,
textarea.form-control {
    border: 1px solid #555 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
    border-radius: 0.35rem !important;
}

input.form-control:focus,
select.form-select:focus,
textarea.form-control:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.badge {
    font-size: 0.875em;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

[dir="rtl"] .page-header {
    flex-direction: row-reverse;
}

/* Invoice Logo Styles */
.invoice-logo {
    max-height: 80px;
    max-width: 200px;
}

[dir="rtl"] .invoice-logo-container {
    text-align: right;
}

[dir="ltr"] .invoice-logo-container {
    text-align: left;
}

/* POS Menu Highlight */
.sidebar .nav-link[href*="pos"] {
    background-color: #28a745 !important;
    color: #fff !important;
    font-weight: 600;
}

.sidebar .nav-link[href*="pos"]:hover {
    background-color: #218838 !important;
    color: #fff !important;
}

.sidebar .nav-link[href*="pos"].active {
    background-color: #1e7e34 !important;
    color: #fff !important;
}

/* Navbar z-index to ensure it's above other elements */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    margin: 0 !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    box-sizing: border-box;
}

/* Ensure navbar dropdown menus appear above sticky elements */
.navbar .dropdown-menu,
.navbar .dropdown-menu.show {
    z-index: 1055 !important;
    position: absolute !important;
}

/* Ensure dropdown toggle and nav-item have proper stacking */
.navbar .nav-item.dropdown {
    position: relative;
    z-index: 1031;
}

/* POS Cart Sticky Positioning - lower z-index than navbar dropdown */
.pos-cart-sticky,
.pos-cart-sticky.sticky-top {
    z-index: 1020 !important;
    position: sticky !important;
}

/* Footer Styles */
.footer {
    margin-top: auto;
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6;
    min-height: 50px;
    padding: 12px 15px !important;
    width: 100%;
    display: block;
}

.footer .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

.footer-text {
    color: #495057 !important;
    font-size: 0.95rem !important;
    display: block !important;
    line-height: 1.8 !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    text-align: center !important;
}

.footer-brand {
    color: #0d6efd !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    margin-right: 8px;
    letter-spacing: 0.5px;
    display: inline !important;
    visibility: visible !important;
}

.footer-version {
    color: #6c757d !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    display: inline !important;
    visibility: visible !important;
}

.footer-company {
    color: #0d6efd !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin: 0 5px;
    display: inline !important;
    visibility: visible !important;
}

/* Force visibility for footer brand and version */
.footer .footer-brand,
.footer .footer-version,
.footer .footer-company {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding-bottom: 20px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    
    [dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        margin-left: 0;
    }
    
    .footer {
        text-align: center !important;
    }
    
    .footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 5px;
    }
}

