/* Dynamic Theme CSS - Generated from Theme Settings */
/* This file MUST be loaded last to override all other CSS files */

:root {
    --theme-font-english: 'Lexend', sans-serif;
    --theme-font-arabic: 'IBM Plex Sans Arabic', sans-serif;
    --theme-color: #63121b;
    --theme-color-primary: #63121b;
    --theme-color-secondary: #6c757d;
    --theme-color-success: #28a745;
    --theme-color-danger: #dc3545;
    --theme-color-warning: #ffc107;
    --theme-color-info: #17a2b8;
    --theme-color-dark: #343a40;
    --theme-color-light: #f8f9fa;
}

/* ============================================
   FONTS - Apply to ALL elements (EXCEPT ICONS)
   ============================================ */

/* Exclude icon fonts from theme font override - Let icon fonts use their own font families */
/* Don't override icon fonts - they already have their font-family defined in their CSS files */
[class*="ri-"], [class^="ri-"], i[class*="ri-"], i[class^="ri-"] {
    font-family: 'remixicon' !important;
}

[class*="fa-"], [class^="fa-"], .fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-light, .fa-brands, i[class*="fa-"], i[class^="fa-"] {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'FontAwesome', 'Font Awesome 5 Free', 'Font Awesome 5 Pro' !important;
}

[class*="iconly-"], [class^="iconly-"], i[class*="iconly-"], i[class^="iconly-"] {
    font-family: 'iconly' !important;
}

[data-feather], svg[data-feather], .feather, i[data-feather] {
    font-family: 'Feather Icons' !important;
}

/* Apply theme fonts to ALL text elements - Comprehensive coverage */
/* Apply to body first, then override specific elements */
body, html {
    font-family: var(--theme-font-english) !important;
}

/* Apply to all common text elements */
p, span, div, h1, h2, h3, h4, h5, h6, 
a:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]), 
li, td, th, 
label:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]),
input, textarea, select, button:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]),
.navbar, .navbar *, .sidebar, .sidebar *, .card, .card *, .table, .table *, 
.btn:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]), 
.form-control, .form-select, .dropdown-menu, .dropdown-menu *, .modal, .modal *, 
.alert, .alert *, .badge, .breadcrumb, .breadcrumb *,
.page-body, .page-body *, .page-wrapper, .page-wrapper *,
.title-header, .title-header *, .option-title, .option-title *,
.sidebar-link, .sidebar-title, .card-title, .card-header, .card-body, .card-body *,
.nav-link, .dropdown-item, .breadcrumb-item, .pagination, .page-link,
.table-responsive, .table-responsive *, .dataTables_wrapper, .dataTables_wrapper *,
.toast, .toast *, .tooltip, .popover, .popover * {
    font-family: var(--theme-font-english) !important;
}

/* Apply Arabic font for RTL direction */
[dir='rtl'] body, [dir='rtl'] html {
    font-family: var(--theme-font-arabic) !important;
}

[dir='rtl'] p, [dir='rtl'] span, [dir='rtl'] div,
[dir='rtl'] h1, [dir='rtl'] h2, [dir='rtl'] h3, [dir='rtl'] h4, [dir='rtl'] h5, [dir='rtl'] h6,
[dir='rtl'] a:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]), 
[dir='rtl'] li, [dir='rtl'] td, [dir='rtl'] th, 
[dir='rtl'] label:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]),
[dir='rtl'] input, [dir='rtl'] textarea, [dir='rtl'] select, 
[dir='rtl'] button:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]),
[dir='rtl'] .navbar, [dir='rtl'] .navbar *, [dir='rtl'] .sidebar, [dir='rtl'] .sidebar *, 
[dir='rtl'] .card, [dir='rtl'] .card *, [dir='rtl'] .table, [dir='rtl'] .table *,
[dir='rtl'] .btn:not([class*="ri-"]):not([class^="ri-"]):not([class*="fa-"]):not([class^="fa-"]):not([class*="iconly-"]):not([class^="iconly-"]), 
[dir='rtl'] .form-control, [dir='rtl'] .form-select, [dir='rtl'] .dropdown-menu, [dir='rtl'] .dropdown-menu *,
[dir='rtl'] .modal, [dir='rtl'] .modal *, [dir='rtl'] .alert, [dir='rtl'] .alert *, 
[dir='rtl'] .badge, [dir='rtl'] .breadcrumb, [dir='rtl'] .breadcrumb *,
[dir='rtl'] .page-body, [dir='rtl'] .page-body *, [dir='rtl'] .page-wrapper, [dir='rtl'] .page-wrapper *,
[dir='rtl'] .title-header, [dir='rtl'] .title-header *, [dir='rtl'] .option-title, [dir='rtl'] .option-title *,
[dir='rtl'] .sidebar-link, [dir='rtl'] .sidebar-title, [dir='rtl'] .card-title, [dir='rtl'] .card-header, 
[dir='rtl'] .card-body, [dir='rtl'] .card-body *, [dir='rtl'] .nav-link, [dir='rtl'] .dropdown-item, 
[dir='rtl'] .breadcrumb-item, [dir='rtl'] .pagination, [dir='rtl'] .page-link,
[dir='rtl'] .table-responsive, [dir='rtl'] .table-responsive *, [dir='rtl'] .dataTables_wrapper, [dir='rtl'] .dataTables_wrapper * {
    font-family: var(--theme-font-arabic) !important;
}

/* ============================================
   PRIMARY COLOR - Override ALL instances
   ============================================ */

/* Bootstrap classes */
.btn-primary, .bg-primary, .text-primary, .border-primary,
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* All elements with primary in class name */
[class*='btn-primary'], [class*='bg-primary'], [class*='text-primary'],
[class*='border-primary'], [class*='primary'] {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* Links */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
    color: var(--theme-color-primary) !important;
}

a:hover:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
    color: var(--theme-color-primary) !important;
    opacity: 0.8;
}

/* Progress bars */
.progress-bar-primary, .progress-bar[style*='primary'] {
    background-color: var(--theme-color-primary) !important;
}

/* Badges */
.badge-primary, .badge[class*='primary'] {
    background-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* Pagination */
.page-item.active .page-link,
.page-item.active .page-link:hover,
.page-item.active .page-link:focus {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

.page-link {
    color: var(--theme-color-primary) !important;
}

.page-link:hover {
    color: var(--theme-color-primary) !important;
    opacity: 0.8;
}

/* Dropdowns */
.dropdown-item.active, .dropdown-item:active,
.dropdown-item.active:hover, .dropdown-item:active:hover {
    background-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* Form controls */
.form-check-input:checked,
.form-check-input[type='checkbox']:checked,
.form-check-input[type='radio']:checked {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
}

.form-switch .form-check-input:checked {
    background-color: var(--theme-color-primary) !important;
}

.form-control:focus, .form-select:focus, .form-control:active {
    border-color: var(--theme-color-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25) !important;
}

/* Range inputs */
.form-range::-webkit-slider-thumb,
.form-range::-moz-range-thumb {
    background-color: var(--theme-color-primary) !important;
}

/* Nav pills */
.nav-pills .nav-link.active,
.nav-pills .nav-link.active:hover,
.nav-pills .nav-link.active:focus {
    background-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* List groups */
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* Cards */
.card-primary, .card-header-primary {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* Tables */
.table-primary, .table-primary > th, .table-primary > td {
    background-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* Alerts */
.alert-primary {
    background-color: var(--theme-color-primary) !important;
    border-color: var(--theme-color-primary) !important;
    color: #fff !important;
}

/* ============================================
   SECONDARY COLOR
   ============================================ */

.btn-secondary, .bg-secondary, .text-secondary, .border-secondary,
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active,
[class*='btn-secondary'], [class*='bg-secondary'], [class*='text-secondary'] {
    background-color: var(--theme-color-secondary) !important;
    border-color: var(--theme-color-secondary) !important;
    color: #fff !important;
}

/* ============================================
   SUCCESS COLOR
   ============================================ */

.btn-success, .bg-success, .text-success, .border-success,
.btn-success:hover, .btn-success:focus, .btn-success:active,
[class*='btn-success'], [class*='bg-success'], [class*='text-success'],
.alert-success, .badge-success {
    background-color: var(--theme-color-success) !important;
    border-color: var(--theme-color-success) !important;
    color: #fff !important;
}

/* ============================================
   DANGER COLOR
   ============================================ */

.btn-danger, .bg-danger, .text-danger, .border-danger,
.btn-danger:hover, .btn-danger:focus, .btn-danger:active,
[class*='btn-danger'], [class*='bg-danger'], [class*='text-danger'],
.alert-danger, .badge-danger {
    background-color: var(--theme-color-danger) !important;
    border-color: var(--theme-color-danger) !important;
    color: #fff !important;
}

/* ============================================
   WARNING COLOR
   ============================================ */

.btn-warning, .bg-warning, .text-warning, .border-warning,
.btn-warning:hover, .btn-warning:focus, .btn-warning:active,
[class*='btn-warning'], [class*='bg-warning'], [class*='text-warning'],
.alert-warning, .badge-warning {
    background-color: var(--theme-color-warning) !important;
    border-color: var(--theme-color-warning) !important;
    color: #212529 !important;
}

/* ============================================
   INFO COLOR
   ============================================ */

.btn-info, .bg-info, .text-info, .border-info,
.btn-info:hover, .btn-info:focus, .btn-info:active,
[class*='btn-info'], [class*='bg-info'], [class*='text-info'],
.alert-info, .badge-info {
    background-color: var(--theme-color-info) !important;
    border-color: var(--theme-color-info) !important;
    color: #fff !important;
}

/* ============================================
   DARK COLOR
   ============================================ */

.btn-dark, .bg-dark, .text-dark, .border-dark,
.btn-dark:hover, .btn-dark:focus, .btn-dark:active,
[class*='btn-dark'], [class*='bg-dark'], [class*='text-dark'] {
    background-color: var(--theme-color-dark) !important;
    border-color: var(--theme-color-dark) !important;
    color: #fff !important;
}

/* ============================================
   LIGHT COLOR
   ============================================ */

.btn-light, .bg-light, .text-light, .border-light,
.btn-light:hover, .btn-light:focus, .btn-light:active,
[class*='btn-light'], [class*='bg-light'], [class*='text-light'] {
    background-color: var(--theme-color-light) !important;
    border-color: var(--theme-color-light) !important;
    color: #212529 !important;
}

/* ============================================
   OVERRIDE INLINE STYLES (if possible)
   ============================================ */

/* Note: Inline styles have higher specificity, so we use !important */
[style*='background-color'][style*='#007bff'],
[style*='background-color'][style*='rgb(0, 123, 255)'],
[style*='background-color'][style*='rgba(0, 123, 255'],
[style*='color'][style*='#007bff'],
[style*='color'][style*='rgb(0, 123, 255)'] {
    background-color: var(--theme-color-primary) !important;
    color: var(--theme-color-primary) !important;
}

/* Override any element that might have hardcoded primary color values */
*[style*='background'][style*='007bff'],
*[style*='background'][style*='0, 123, 255'],
*[style*='color'][style*='007bff'],
*[style*='color'][style*='0, 123, 255'] {
    background-color: var(--theme-color-primary) !important;
    color: var(--theme-color-primary) !important;
}

/* ============================================
   OVERRIDE ALL CSS FILES - Comprehensive Rules
   ============================================ */

/* Override any element with background-color in CSS files */
* {
    /* This will be overridden by more specific selectors below */
}

/* Force override for common Bootstrap and custom classes */
.btn, button, input[type='submit'], input[type='button'] {
    /* Colors will be applied by class-specific rules above */
}

/* Override sidebar and navigation */
.sidebar, .navbar, .nav, .nav-link.active {
    /* Colors applied by class rules */
}

/* Override cards and panels */
.card, .panel, .box {
    /* Colors applied by class rules */
}

/* Override tables */
.table, table {
    /* Colors applied by class rules */
}

/* Override modals */
.modal-header, .modal-footer {
    /* Colors applied by class rules */
}

/* Override all text elements that might have color */
p, span, div, h1, h2, h3, h4, h5, h6, a, li, td, th, label {
    /* Font applied globally above */
}

/* Override all background elements */
div[style*='background'], span[style*='background'],
p[style*='background'], a[style*='background'] {
    /* Inline styles will be overridden by !important rules */
}

/* ============================================
   CHECKBOX ANIMATED - Fastkart Style
   ============================================ */

.checkbox_animated {
    cursor: pointer;
    position: relative;
    margin: 0 16px 0 0;
    z-index: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 1.3rem;
    height: 1.3rem;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 3px;
}

.checkbox_animated:before {
    content: '';
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.45, 1.8, 0.5, 0.75);
    transform: rotate(-45deg) scale(0, 0);
    left: 0.25rem;
    top: 0.225rem;
    z-index: 1;
    width: 0.75rem;
    height: 0.375rem;
    border: 2px solid var(--theme-color);
    border-top-style: none;
    border-right-style: none;
}

.checkbox_animated:after {
    content: '';
    position: absolute;
    top: -0.125rem;
    left: 0;
    width: 1.3rem;
    height: 1.3rem;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.checkbox_animated:checked:before {
    transform: rotate(-45deg) scale(1, 1);
}

.checkbox_animated:checked:after {
    border-color: var(--theme-color);
}

[dir='rtl'] .checkbox_animated {
    margin: 0 0 0 16px;
}