/* =========================================================
   AUTO DARK MODE (system theme) — neutral black/grey palette
   Trigger: <html data-bs-theme="dark">
   ========================================================= */

[data-bs-theme="dark"] {
    color-scheme: dark;

    --dk-bg: #121212;
    /* page background */
    --dk-surface: #1a1a1a;
    /* header, footer, panels */
    --dk-card: #1e1e1e;
    /* cards, modals, dropdowns */
    --dk-input: #161616;
    /* inputs */
    --dk-border: rgba(255, 255, 255, 0.10);
    --dk-text: #e5e5e5;
    --dk-text-muted: #a3a3a3;
    --dk-heading: #f5f5f5;

    /* Bootstrap 5.3 variables override (header/body/cards sab yahi se follow karte hain) */
    --bs-body-bg: #121212;
    --bs-body-bg-rgb: 18, 18, 18;
    --bs-body-color: #e5e5e5;
    --bs-body-color-rgb: 229, 229, 229;
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: #a3a3a3;
    --bs-secondary-bg: #1a1a1a;
    --bs-tertiary-bg: #1a1a1a;
    --bs-border-color: rgba(255, 255, 255, 0.10);
    --bs-heading-color: #f5f5f5;
}

/* ---------- Base ---------- */
[data-bs-theme="dark"] html,
[data-bs-theme="dark"] body {
    background-color: var(--dk-bg);
    color: var(--dk-text);
}

/* ---------- Headings & text ---------- */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1,
[data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5,
[data-bs-theme="dark"] .h6,
[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-black,
[data-bs-theme="dark"] .heading-title {
    color: var(--dk-heading) !important;
}

[data-bs-theme="dark"] p,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .form-check-label,
[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary {
    color: var(--dk-text-muted) !important;
}

/* Breadcrumb (active item pehle invisible tha) */
[data-bs-theme="dark"] .breadcrumb {
    --bs-breadcrumb-divider-color: var(--dk-text-muted);
    --bs-breadcrumb-item-active-color: var(--dk-heading);
}

[data-bs-theme="dark"] .breadcrumb-item,
[data-bs-theme="dark"] .breadcrumb-item a {
    color: var(--dk-text-muted) !important;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: var(--dk-heading) !important;
}

/* ---------- Hardcoded white / light backgrounds ---------- */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-body,
[data-bs-theme="dark"] .bg-body-tertiary {
    background-color: var(--dk-surface) !important;
    color: var(--dk-text) !important;
}

[data-bs-theme="dark"] header,
[data-bs-theme="dark"] header .navbar,
[data-bs-theme="dark"] .iq-navbar,
[data-bs-theme="dark"] footer,
[data-bs-theme="dark"] .footer,
[data-bs-theme="dark"] .iq-footer {
    background-color: var(--dk-surface) !important;
    color: var(--dk-text) !important;
    border-color: var(--dk-border) !important;
}

/* ---------- Cards / modals / dropdowns ---------- */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .offcanvas,
[data-bs-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .accordion-item {
    background-color: var(--dk-card);
    color: var(--dk-text);
    border-color: var(--dk-border);
}

[data-bs-theme="dark"] .card .card-header,
[data-bs-theme="dark"] .card .card-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    background-color: var(--dk-card);
    border-color: var(--dk-border);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--dk-text);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.07);
    color: #fff;
}

/* ---------- Links (footer etc.) ---------- */
[data-bs-theme="dark"] footer a,
[data-bs-theme="dark"] .footer a,
[data-bs-theme="dark"] .iq-footer-catogery-list li a {
    color: var(--dk-text-muted);
}

[data-bs-theme="dark"] footer a:hover,
[data-bs-theme="dark"] .footer a:hover,
[data-bs-theme="dark"] .iq-footer-catogery-list li a:hover {
    color: var(--bs-primary);
}

/* ---------- Inputs / selects / search ---------- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-dropdown,
[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select,
[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="search"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] textarea {
    background-color: var(--dk-input) !important;
    color: var(--dk-text) !important;
    border-color: var(--dk-border) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--dk-text);
}

[data-bs-theme="dark"] ::placeholder {
    color: #8a8a8a !important;
    opacity: 1;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .form-check-input {
    background-color: var(--dk-input);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* ---------- Borders ---------- */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end,
[data-bs-theme="dark"] hr {
    border-color: var(--dk-border) !important;
}

/* ---------- Pagination / tables / DataTables ---------- */
[data-bs-theme="dark"] .page-link {
    background-color: var(--dk-card);
    color: var(--dk-text);
    border-color: var(--dk-border);
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--dk-surface);
    color: #6b6b6b;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--dk-text);
    --bs-table-border-color: var(--dk-border);
}

[data-bs-theme="dark"] .dataTables_processing {
    background: var(--dk-card) !important;
    color: var(--dk-text) !important;
    border: 1px solid var(--dk-border);
}

/* ---------- Scrollbar ---------- */
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--dk-bg);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a3a3a;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}