/* PWProduction Theme System CSS */

/* Theme Toggle Styles */
.theme-toggle-container {
    display: flex;
    align-items: center;
    margin: 0 15px;
}

.theme-toggle {
    display: flex;
    background: rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
}

.theme-toggle-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
}

.theme-toggle-option:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
}

.theme-toggle-option.active {
    background: #007bff;
    color: white;
}

.theme-toggle-option i {
    font-size: 14px;
}

/* Light mode navbar toggle colors */
.light-mode .theme-toggle {
    background: rgba(0,0,0,0.1);
}

.light-mode .theme-toggle-option {
    color: rgba(0,0,0,0.7);
}

.light-mode .theme-toggle-option:hover {
    background: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.9);
}

/* Theme Toggle Styles for Auth Pages */
.theme-toggle-auth {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    background: rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
    backdrop-filter: blur(10px);
}

.theme-toggle-auth .theme-toggle-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
}

.theme-toggle-auth .theme-toggle-option:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
}

.theme-toggle-auth .theme-toggle-option.active {
    background: #007bff;
    color: white;
}

.theme-toggle-auth .theme-toggle-option i {
    font-size: 14px;
}

/* Light mode adjustments for auth toggle */
.light-mode .theme-toggle-auth {
    background: rgba(255,255,255,0.1);
}

.light-mode .theme-toggle-auth .theme-toggle-option {
    color: rgba(0,0,0,0.7);
}

.light-mode .theme-toggle-auth .theme-toggle-option:hover {
    background: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.9);
}

/* ========================================
   DARK MODE STYLES
   ======================================== */

/* Dark mode styles */
.dark-mode {
    --bs-body-bg: #343a40;
    --bs-body-color: #e9ecef;
}

/* Main Layout Dark Mode */
.dark-mode .main-header.navbar {
    background-color: #2c3e50 !important;
    border-color: #34495e;
}

.dark-mode .main-sidebar {
    background-color: #2c3e50;
}

.dark-mode .content-wrapper {
    background-color: #343a40;
}

/* Cards and Components */
.dark-mode .card {
    background-color: #2c3e50;
    border-color: #34495e;
}

.dark-mode .card-header {
    background-color: #34495e;
    border-color: #34495e;
    color: #e9ecef;
}

.dark-mode .card-body {
    background-color: #2c3e50;
    color: #e9ecef;
}

.dark-mode .card-footer {
    background-color: #34495e;
    border-color: #34495e;
    color: #e9ecef;
}

/* Tables */
.dark-mode .table {
    color: #e9ecef;
}

.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255,255,255,0.05);
}

.dark-mode .table-bordered {
    border-color: #34495e;
}

.dark-mode .table-bordered td,
.dark-mode .table-bordered th {
    border-color: #34495e;
}

/* Forms */
.dark-mode .form-control {
    background-color: #34495e;
    border-color: #4a5f7a;
    color: #e9ecef;
}

.dark-mode .form-control:focus {
    background-color: #34495e;
    border-color: #007bff;
    color: #e9ecef;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.dark-mode .form-control::placeholder {
    color: #adb5bd;
}

.dark-mode .form-select {
    background-color: #34495e;
    border-color: #4a5f7a;
    color: #e9ecef;
}

.dark-mode .form-label {
    color: #e9ecef;
}

/* Buttons */
.dark-mode .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.dark-mode .btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.dark-mode .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.dark-mode .btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
}

.dark-mode .btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
}

/* Text Colors */
.dark-mode .text-muted {
    color: #adb5bd !important;
}

.dark-mode .text-dark {
    color: #e9ecef !important;
}

/* Auth Pages Dark Mode */
.dark-mode .login-page,
.dark-mode .register-page {
    background: linear-gradient(135deg, #343a40 0%, #2c3e50 100%);
}

.dark-mode .login-logo a,
.dark-mode .register-logo a {
    color: #e9ecef;
}

/* Alerts */
.dark-mode .alert-info {
    background-color: #1e3a8a;
    border-color: #1e40af;
    color: #e0e7ff;
}

.dark-mode .alert-success {
    background-color: #065f46;
    border-color: #047857;
    color: #d1fae5;
}

.dark-mode .alert-warning {
    background-color: #92400e;
    border-color: #b45309;
    color: #fef3c7;
}

.dark-mode .alert-danger {
    background-color: #991b1b;
    border-color: #dc2626;
    color: #fecaca;
}

/* AdminLTE Specific */
.dark-mode .main-sidebar .nav-sidebar .nav-item > .nav-link {
    color: #e9ecef;
}

.dark-mode .main-sidebar .nav-sidebar .nav-item > .nav-link:hover {
    background-color: #34495e;
    color: #ffffff;
}

.dark-mode .main-sidebar .nav-sidebar .nav-item > .nav-link.active {
    background-color: #007bff;
    color: #ffffff;
}

.dark-mode .content-header {
    background-color: #343a40;
    color: #e9ecef;
}

.dark-mode .breadcrumb {
    background-color: transparent;
}

.dark-mode .breadcrumb-item a {
    color: #007bff;
}

.dark-mode .breadcrumb-item.active {
    color: #e9ecef;
}

/* Dropdown menus */
.dark-mode .dropdown-menu {
    background-color: #2c3e50;
    border-color: #34495e;
}

.dark-mode .dropdown-item {
    color: #e9ecef;
}

.dark-mode .dropdown-item:hover,
.dark-mode .dropdown-item:focus {
    background-color: #34495e;
    color: #ffffff;
}

.dark-mode .dropdown-divider {
    border-color: #34495e;
}

/* Modal */
.dark-mode .modal-content {
    background-color: #2c3e50;
    border-color: #34495e;
}

.dark-mode .modal-header {
    border-color: #34495e;
    color: #e9ecef;
}

.dark-mode .modal-footer {
    border-color: #34495e;
}

/* Pagination */
.dark-mode .page-link {
    background-color: #2c3e50;
    border-color: #34495e;
    color: #e9ecef;
}

.dark-mode .page-link:hover {
    background-color: #34495e;
    border-color: #4a5f7a;
    color: #ffffff;
}

.dark-mode .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Badge */
.dark-mode .badge-secondary {
    background-color: #6c757d;
}

.dark-mode .badge-primary {
    background-color: #007bff;
}

/* Input Groups */
.dark-mode .input-group-text {
    background-color: #34495e;
    border-color: #4a5f7a;
    color: #e9ecef;
}

/* ========================================
   LIGHT MODE ADJUSTMENTS
   ======================================== */

.light-mode .main-header.navbar {
    background-color: #ffffff !important;
}

.light-mode .card {
    background-color: #ffffff;
}

.light-mode .form-control {
    background-color: #ffffff;
    color: #495057;
}

/* ========================================
   SELECT2 DARK MODE STYLES
   ======================================== */

/* Select2 Container - Highest Priority */
body.dark-mode .select2-container--bootstrap4 .select2-selection,
body.dark-mode .select2-container .select2-selection,
.dark-mode .select2-container--bootstrap4 .select2-selection,
.dark-mode .select2-container .select2-selection {
    background-color: #34495e !important;
    border-color: #4a5f7a !important;
    color: #e9ecef !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection:focus,
.dark-mode .select2-container--bootstrap4.select2-container--focus .select2-selection,
.dark-mode .select2-container.select2-container--focus .select2-selection {
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background-color: #343a40 !important;
}

/* Select2 Single Selection */
body.dark-mode .select2-container--bootstrap4 .select2-selection--single,
body.dark-mode .select2-container .select2-selection--single,
.dark-mode .select2-container--bootstrap4 .select2-selection--single,
.dark-mode .select2-container .select2-selection--single {
    background-color: #343a40 !important;
    border-color: #4a5f7a !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
body.dark-mode .select2-container .select2-selection--single .select2-selection__rendered,
.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
.dark-mode .select2-container .select2-selection--single .select2-selection__rendered {
    color: #e9ecef !important;
    /* line-height: calc(1.5em + 0.75rem) !important; */
    background-color: transparent !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder,
.dark-mode .select2-container .select2-selection--single .select2-selection__placeholder {
    color: #adb5bd !important;
}

/* Select2 Dropdown Arrow/Icon */
body.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
body.dark-mode .select2-container .select2-selection--single .select2-selection__arrow,
.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
.dark-mode .select2-container .select2-selection--single .select2-selection__arrow {
    border-left-color: #4a5f7a !important;
    background-color: transparent !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
body.dark-mode .select2-container .select2-selection--single .select2-selection__arrow b,
.dark-mode .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
.dark-mode .select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #e9ecef transparent transparent transparent !important;
}

/* Select2 Dropdown Arrow when opened */
body.dark-mode .select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b,
body.dark-mode .select2-container.select2-container--open .select2-selection--single .select2-selection__arrow b,
.dark-mode .select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b,
.dark-mode .select2-container.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #e9ecef transparent !important;
}

/* Select2 Multiple Selection */
.dark-mode .select2-container--bootstrap4 .select2-selection--multiple,
.dark-mode .select2-container .select2-selection--multiple {
    background-color: #34495e !important;
    border-color: #4a5f7a !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered,
.dark-mode .select2-container .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important;
    background-color: transparent !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice,
.dark-mode .select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #007bff !important;
    border-color: #0056b3 !important;
    color: #ffffff !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove,
.dark-mode .select2-container .select2-selection--multiple .select2-selection__choice__remove {
    color: #ffffff !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover,
.dark-mode .select2-container .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fecaca !important;
}

/* Select2 Dropdown */
.dark-mode .select2-container--bootstrap4 .select2-dropdown,
.dark-mode .select2-dropdown {
    background-color: #2c3e50 !important;
    border-color: #4a5f7a !important;
}

.dark-mode .select2-container--bootstrap4 .select2-results__option,
.dark-mode .select2-results__option {
    color: #e9ecef !important;
    background-color: transparent !important;
}

.dark-mode .select2-container--bootstrap4 .select2-results__option--highlighted,
.dark-mode .select2-results__option--highlighted,
.dark-mode .select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected],
.dark-mode .select2-results__option--highlighted[aria-selected] {
    background-color: #007bff !important;
    color: #ffffff !important;
}

.dark-mode .select2-container--bootstrap4 .select2-results__option[aria-selected=true],
.dark-mode .select2-results__option[aria-selected=true] {
    background-color: #34495e !important;
    color: #e9ecef !important;
}

.dark-mode .select2-container--bootstrap4 .select2-results > .select2-results__options,
.dark-mode .select2-results > .select2-results__options {
    background-color: #343a40 !important;
}

/* Select2 Search */
.dark-mode .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field,
.dark-mode .select2-search--dropdown .select2-search__field {
    background-color: #343a40 !important;
    border-color: #4a5f7a !important;
    color: #e9ecef !important;
}

.dark-mode .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field::placeholder,
.dark-mode .select2-search--dropdown .select2-search__field::placeholder {
    color: #adb5bd !important;
}

.dark-mode .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field:focus,
.dark-mode .select2-search--dropdown .select2-search__field:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background-color: #34495e !important;
}

.dark-mode .select2-container--bootstrap4 .select2-search--dropdown,
.dark-mode .select2-search--dropdown {
    background-color: #343a40!important;
    padding: 4px !important;
}

/* Select2 Clear Button */
.dark-mode .select2-container--bootstrap4 .select2-selection__clear {
    color: #adb5bd !important;
}

.dark-mode .select2-container--bootstrap4 .select2-selection__clear:hover {
    color: #e9ecef !important;
}

/* Select2 Disabled State */
.dark-mode .select2-container--bootstrap4.select2-container--disabled .select2-selection {
    background-color: #23313f !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

/* Select2 Loading State */
.dark-mode .select2-container--bootstrap4 .select2-results__option.loading-results {
    color: #adb5bd !important;
}

/* ========================================
   SMOOTH TRANSITIONS
   ======================================== */

/* Smooth transitions for theme changes */
body,
.main-header,
.main-sidebar,
.content-wrapper,
.card,
.form-control,
.btn,
.dropdown-menu,
.modal-content,
.select2-container--bootstrap4 .select2-selection,
.select2-dropdown {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .theme-toggle-container {
        margin: 0 5px;
    }

    .theme-toggle {
        padding: 2px;
        gap: 1px;
    }

    .theme-toggle-option {
        width: 28px;
        height: 28px;
    }

    .theme-toggle-option i {
        font-size: 12px;
    }

    .theme-toggle-auth {
        top: 15px;
        right: 15px;
    }
}
.dark-mode .select2-container--bootstrap-5 .select2-selection--single {
    padding: .375rem 2.25rem .375rem .75rem;
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='#ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    /* filter: invert(1); */
}

.select2-container--bootstrap4 .select2-selection__clear {
    float: right;
    width: .9em;
    height: .9em;
    padding-left: .15em;
    margin-top: .7em;
    margin-right: 1.5em;
    line-height: .75em;
    color: #6c757d;
}

.dark-mode .select2-container--bootstrap4 .select2-selection__clear {
    color: #ffffff !important;
}


table.table.table-sm.table-bordered.table-striped th {
    background-color: #2c3e50;
    color: #fff;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #000000 !important; /* your desired color */
  caret-color: #000000;
  transition: background-color 5000s ease-in-out 0s;
}

.dark-mode input:-webkit-autofill,
.dark-mode input:-webkit-autofill:hover,
.dark-mode input:-webkit-autofill:focus,
.dark-mode textarea:-webkit-autofill,
.dark-mode select:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important; /* your desired color */
  caret-color: #fff;
  transition: background-color 5000s ease-in-out 0s;
}
