/* Gatepass System - Dark Theme Aggressive Overrides */
html.dark-theme body,
html[data-theme="dark"] body {
    background-color: #232333 !important;
    color: #a3a4cc !important;
}

html.dark-theme .bg-menu-theme,
html.dark-theme .bg-navbar-theme,
html.dark-theme .card,
html[data-theme="dark"] .bg-menu-theme,
html[data-theme="dark"] .bg-navbar-theme,
html[data-theme="dark"] .card {
    background-color: #2b2c40 !important;
    color: #a3a4cc !important;
    border-color: #4b4c6e !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25) !important;
    /* Added subtle shadow for depth */
    transition: box-shadow 0.2s ease-in-out;
    /* Smooth hover transition */
}

/* Card hover effect for better aesthetics */
html.dark-theme .card:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4) !important;
}

html.dark-theme .card-header,
html.dark-theme .card-body,
html.dark-theme .card-footer {
    background-color: transparent !important;
    color: inherit !important;
}

html.dark-theme .text-heading,
html.dark-theme .menu-text {
    color: #c3c4e3 !important;
}

/* Form Controls & Inputs */
html.dark-theme .form-control,
html.dark-theme .form-select,
html.dark-theme .input-group-text,
html.dark-theme .select2-selection--single,
html.dark-theme .select2-dropdown,
html.dark-theme .selectize-input,
html.dark-theme .selectize-dropdown {
    background-color: #3b3c54 !important;
    border-color: #4b4c6e !important;
    color: #a3a4cc !important;
    transition: all 0.2s ease-in-out !important;
    /* Smooth focus transitions */
}

/* Enhanced focus state for inputs */
html.dark-theme .form-control:focus,
html.dark-theme .form-select:focus {
    border-color: #696cff !important;
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.25) !important;
}

html.dark-theme .form-control[readonly] {
    background-color: #2b2c40 !important;
}

html.dark-theme .select2-container--default .select2-selection--single .select2-selection__rendered,
html.dark-theme .select2-results__option {
    color: #a3a4cc !important;
}

html.dark-theme .select2-results__option[aria-selected="true"],
html.dark-theme .selectize-dropdown .active {
    background-color: #696cff !important;
    color: #fff !important;
}

html.dark-theme .form-control::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.8) !important;
}

/* Tables */
html.dark-theme .table {
    color: #a3a4cc !important;
}

/* 
 * FIX: Override table-striped white alternating backgrounds 
 * We set box-shadow to transparent because Bootstrap uses inset box-shadow for row striping 
 */
html.dark-theme .table> :not(caption)>*>* {
    background-color: #2b2c40 !important;
    color: #a3a4cc !important;
    border-bottom-color: #4b4c6e !important;
    box-shadow: inset 0 0 0 9999px transparent !important;
    transition: background-color 0.2s ease;
}

/* Add a subtle dark hover effect for table rows if .table-hover is used */
html.dark-theme .table-hover>tbody>tr:hover>* {
    background-color: #323348 !important;
    color: #c3c4e3 !important;
}

html.dark-theme .dtfc-fixed-right {
    background-color: #2b2c40 !important;
}

/* Force DataTables alternate row styling to remain completely dark */
html.dark-theme table.dataTable.table-striped>tbody>tr.odd>*,
html.dark-theme table.dataTable.table-striped>tbody>tr.even>*,
html.dark-theme table.dataTable tbody tr.odd>*,
html.dark-theme table.dataTable tbody tr.even>* {
    background-color: #2b2c40 !important;
    box-shadow: inset 0 0 0 9999px transparent !important;
}

/* DataTables Pagination Override */
html.dark-theme div.dataTables_wrapper .dataTables_length label,
html.dark-theme div.dataTables_wrapper .dataTables_filter label,
html.dark-theme div.dataTables_wrapper .dataTables_info,
html.dark-theme div.dataTables_wrapper .dataTables_paginate,
html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #a3a4cc !important;
}

html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    margin: 0 4px !important;
    transition: all 0.2s ease;
    /* Smooth pagination hover */
}

html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover {
    background-color: #3b3c54 !important;
    color: #fff !important;
    border-color: #3b3c54 !important;
}

html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: #696cff !important;
    color: #fff !important;
    border-color: #696cff !important;
    box-shadow: 0 2px 5px rgba(105, 108, 255, 0.4) !important;
    /* Glow on current page */
}

/* Dropdowns */
html.dark-theme .dropdown-menu {
    background-color: #3b3c54 !important;
    border-color: #4b4c6e !important;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4) !important;
    /* Better dropdown shadow */
    border-radius: 8px !important;
}

html.dark-theme .dropdown-item {
    color: #a3a4cc !important;
    border-radius: 4px;
    /* Rounded dropdown items */
    margin: 0 4px;
    width: calc(100% - 8px);
    transition: background-color 0.2s ease, color 0.2s ease;
}

html.dark-theme .dropdown-item:hover,
html.dark-theme .dropdown-item:active {
    background-color: #4b4c6e !important;
    color: #fff !important;
}

/* Pagination Links */
html.dark-theme .page-link {
    background-color: #3b3c54 !important;
    border-color: #4b4c6e !important;
    color: #a3a4cc !important;
    transition: all 0.2s ease;
}

html.dark-theme .page-item:not(.active) .page-link:hover {
    background-color: #4b4c6e !important;
    color: #fff !important;
}

html.dark-theme .page-item.disabled .page-link {
    background-color: #2b2c40 !important;
    color: #797a9e !important;
    border-color: #3b3c54 !important;
}

/* Headings & Text */
html.dark-theme h1,
html.dark-theme h2,
html.dark-theme h3,
html.dark-theme h4,
html.dark-theme h5,
html.dark-theme h6,
html.dark-theme .app-brand-text {
    color: #d8d8f0 !important;
    /* Slightly brighter titles for contrast */
}

/* Modals */
html.dark-theme .modal-content {
    background-color: #2b2c40 !important;
    color: #a3a4cc !important;
    border: 1px solid #4b4c6e !important;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.5) !important;
    /* More pronounced modal shadow */
    border-radius: 0.75rem !important;
    /* Softer corners */
}

html.dark-theme .modal-header {
    border-bottom: 1px solid #4b4c6e !important;
}

html.dark-theme .modal-footer {
    border-top: 1px solid #4b4c6e !important;
}


html.dark-theme .content-footer,
html[data-theme="dark"] .content-footer {
    background-color:#2b2c40 !important;
    color: rgb(105, 122, 141) !important;
}


html.dark-theme input:-webkit-autofill,
html.dark-theme input:-webkit-autofill:hover,
html.dark-theme input:-webkit-autofill:focus,
html.dark-theme textarea:-webkit-autofill,
html.dark-theme select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #3b3c54 inset !important; 
    -webkit-text-fill-color: #a3a4cc !important;
    border: 1px solid #4b4c6e !important;
    transition: background-color 9999s ease-in-out 0s;
}


html[data-theme="dark"] input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #3b3c54 inset !important;
    -webkit-text-fill-color: #a3a4cc !important;
}

html.dark-theme .modal-header .btn-close,
html.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) opacity(0.8) !important;
    transition: opacity 0.2s ease;
}

html.dark-theme .btn-close:hover {
    filter: invert(1) grayscale(100%) brightness(200%) opacity(1) !important;
}

html.dark-theme hr {
    border-top-color: #4b4c6e !important;
}

html.dark-theme .light-logo,
html[data-theme="dark"] .light-logo {
    display: none !important;
}

html.dark-theme .dark-logo,
html[data-theme="dark"] .dark-logo {
    display: block !important;
    width: 175px !important; 
}

html.dark-theme .bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle),
html[data-theme="dark"] .bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) {
    background-color: #696cff !important; 
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(105, 108, 255, 0.3) !important;
}

html.dark-theme .bg-menu-theme .menu-inner .menu-item.active:not(.open) > .menu-link,
html.dark-theme .bg-menu-theme .menu-inner .menu-item.active.open > .menu-link {
    background-color: rgba(105, 108, 255, 0.16) !important;
    color: #696cff !important;
}

html.dark-theme .menu-vertical .menu-sub > .menu-item.active > .menu-link:not(.menu-toggle),
html[data-theme="dark"] .menu-vertical .menu-sub > .menu-item.active > .menu-link:not(.menu-toggle) {
    background-color: #696cff !important;
    color: #fff !important;
}

html.dark-theme .menu-vertical .menu-item.active > .menu-link:before,
html[data-theme="dark"] .menu-vertical .menu-item.active > .menu-link:before {
    background-color: #fff !important;
}

