/**
 * Dark Theme Override - Ensures NO white backgrounds anywhere
 * Load this AFTER Bootstrap to override default styles
 */

/* Global overrides */
html, body {
    background-color: #1a1d29 !important;
    color: #e5e7eb !important;
}

/* Override Bootstrap backgrounds */
.bg-white {
    background-color: #2a2d3a !important;
}

.bg-light {
    background-color: #2a2d3a !important;
}

.bg-body {
    background-color: #1a1d29 !important;
}

/* Text colors */
.text-dark {
    color: #e5e7eb !important;
}

.text-body {
    color: #e5e7eb !important;
}

.text-black {
    color: #e5e7eb !important;
}

/* Modals */
.modal {
    color: #e5e7eb !important;
}

.modal-content {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.modal-header {
    background-color: rgba(102, 126, 234, 0.1) !important;
    border-bottom-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.modal-body {
    background-color: #2a2d3a !important;
    color: #e5e7eb !important;
}

.modal-footer {
    background-color: rgba(102, 126, 234, 0.05) !important;
    border-top-color: #3a3d4a !important;
}

.modal-title {
    color: #e5e7eb !important;
}

.modal-backdrop {
    background-color: #000 !important;
}

/* Forms */
.form-control {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: #667eea !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

.form-control::placeholder {
    color: #9ca3af !important;
}

.form-select {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

.form-select option {
    background-color: #2a2d3a !important;
    color: #e5e7eb !important;
}

.form-label {
    color: #e5e7eb !important;
}

.form-text {
    color: #9ca3af !important;
}

/* Input groups */
.input-group-text {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: #3a3d4a !important;
    color: #9ca3af !important;
}

/* Checkboxes and radios */
.form-check-input {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: #3a3d4a !important;
}

.form-check-input:checked {
    background-color: #667eea !important;
    border-color: #667eea !important;
}

.form-check-input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

.form-check-label {
    color: #e5e7eb !important;
}

/* Cards */
.card {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.card-header {
    background-color: rgba(102, 126, 234, 0.1) !important;
    border-bottom-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.card-body {
    background-color: #2a2d3a !important;
    color: #e5e7eb !important;
}

.card-footer {
    background-color: rgba(102, 126, 234, 0.05) !important;
    border-top-color: #3a3d4a !important;
    color: #9ca3af !important;
}

/* Tables */
.table {
    color: #e5e7eb !important;
    border-color: #3a3d4a !important;
    background-color: #2a2d3a !important;
}

.table thead {
    background-color: rgba(102, 126, 234, 0.2) !important;
}

.table thead th {
    background-color: rgba(102, 126, 234, 0.2) !important;
    border-color: #3a3d4a !important;
    color: #ffffff !important;
}

.table tbody {
    background-color: #2a2d3a !important;
}

.table tbody tr {
    border-color: #3a3d4a !important;
    background-color: #2a2d3a !important;
}

.table tbody td {
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
    background-color: #2a2d3a !important;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.15) !important;
}

.table tbody tr:hover td {
    background-color: rgba(102, 126, 234, 0.15) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.table-responsive {
    background-color: #2a2d3a !important;
}

/* Ensure table wrapper also dark */
.card .table-responsive {
    background-color: #2a2d3a !important;
}

.card-body .table-responsive {
    background-color: #2a2d3a !important;
}

/* Alerts */
.alert {
    border: none !important;
    border-radius: 12px !important;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border-left: 4px solid #10b981 !important;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border-left: 4px solid #ef4444 !important;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border-left: 4px solid #f59e0b !important;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border-left: 4px solid #3b82f6 !important;
}

/* List groups */
.list-group-item {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.list-group-item:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.list-group-item.active {
    background-color: #667eea !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

/* Dropdowns */
.dropdown-menu {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
}

.dropdown-item {
    color: #e5e7eb !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(102, 126, 234, 0.2) !important;
    color: #ffffff !important;
}

.dropdown-divider {
    border-top-color: #3a3d4a !important;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
}

.breadcrumb-item {
    color: #9ca3af !important;
}

.breadcrumb-item.active {
    color: #e5e7eb !important;
}

.breadcrumb-item a {
    color: #667eea !important;
}

/* Pagination */
.page-link {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
    color: #667eea !important;
}

.page-link:hover {
    background-color: rgba(102, 126, 234, 0.2) !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

.page-item.active .page-link {
    background-color: #667eea !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

.page-item.disabled .page-link {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
    color: #6b7280 !important;
}

/* Progress bars */
.progress {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2) !important;
}

/* Tooltips */
.tooltip-inner {
    background-color: #2a2d3a !important;
    color: #e5e7eb !important;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-top-color: #2a2d3a !important;
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-right-color: #2a2d3a !important;
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-bottom-color: #2a2d3a !important;
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-left-color: #2a2d3a !important;
}

/* Popovers */
.popover {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
}

.popover-header {
    background-color: rgba(102, 126, 234, 0.1) !important;
    border-bottom-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.popover-body {
    color: #e5e7eb !important;
}

/* Toast */
.toast {
    background-color: #2a2d3a !important;
    border-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.toast-header {
    background-color: rgba(102, 126, 234, 0.2) !important;
    border-bottom-color: #3a3d4a !important;
    color: #e5e7eb !important;
}

.toast-body {
    background-color: #2a2d3a !important;
    color: #e5e7eb !important;
}

/* Close button */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* Code blocks */
code {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #f472b6 !important;
}

pre {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #3a3d4a !important;
    color: #e5e7eb !important;
}

/* Links */
a {
    color: #667eea !important;
}

a:hover {
    color: #764ba2 !important;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
    color: #e5e7eb !important;
}

/* Paragraphs */
p {
    color: #d1d5db !important;
}

/* Small text */
small, .small {
    color: #9ca3af !important;
}

/* Strong/bold */
strong, b {
    color: #e5e7eb !important;
}

/* Buttons (maintain their colors but ensure text is visible) */
.btn-light {
    background-color: #3a3d4a !important;
    border-color: #4a4d5a !important;
    color: #e5e7eb !important;
}

.btn-light:hover {
    background-color: #4a4d5a !important;
    border-color: #5a5d6a !important;
    color: #ffffff !important;
}

.btn-outline-light {
    color: #e5e7eb !important;
    border-color: #3a3d4a !important;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: #e5e7eb !important;
    color: #ffffff !important;
}

/* Spinners */
.spinner-border {
    border-color: #667eea !important;
    border-right-color: transparent !important;
}

/* Scrollbar (webkit browsers) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background: #1a1d29;
}

::-webkit-scrollbar-track {
    background: #1a1d29;
}

::-webkit-scrollbar-thumb {
    background: #3a3d4a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

/* Selection */
::selection {
    background-color: rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

::-moz-selection {
    background-color: rgba(102, 126, 234, 0.4);
    color: #ffffff;
}

/* Ensure all containers have proper background */
.container,
.container-fluid,
.row,
.col,
.col-auto,
[class*="col-"] {
    color: #e5e7eb !important;
}

/* HR elements */
hr {
    border-color: #3a3d4a !important;
    opacity: 1 !important;
}

/* Border utilities */
.border {
    border-color: #3a3d4a !important;
}

.border-top {
    border-top-color: #3a3d4a !important;
}

.border-bottom {
    border-bottom-color: #3a3d4a !important;
}

.border-start {
    border-left-color: #3a3d4a !important;
}

.border-end {
    border-right-color: #3a3d4a !important;
}

/* Remove any lingering white backgrounds */
div, span, section, article, aside, header, footer, main, nav {
    background-color: transparent;
}

