/* CashFlowPal Dark Theme */

/* Global Dark Theme */
html, body {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

.container, .container-fluid {
    background-color: #1a1a1a !important;
}

/* Override Bootstrap defaults for specific elements */
.form-control, .form-select, .card, .table, .modal-content, .dropdown-menu {
    border-color: #404040 !important;
}

h1, h2, h3, h4, h5, h6, p, span, div {
    color: #e0e0e0 !important;
}

/* Cards */
body.dark-theme .card {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .card-header {
    background-color: #333333 !important;
    border-bottom: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .card-body {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .card-stat {
    border-left: 4px solid #007bff;
    background-color: #2d2d2d !important;
}

body.dark-theme .card-stat.income {
    border-left-color: #28a745;
}

body.dark-theme .card-stat.expense {
    border-left-color: #dc3545;
}

body.dark-theme .card-stat.profit {
    border-left-color: #17a2b8;
}

/* Tables */
body.dark-theme .table {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

body.dark-theme .table th {
    background-color: #333333 !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

body.dark-theme .table td {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

body.dark-theme .table-responsive {
    border-radius: 0.375rem;
    background-color: #2d2d2d !important;
}

/* Table row colors for dark theme */
.table-success {
    background-color: #1e4d2b !important;
    color: #e0e0e0 !important;
}

.table-success td {
    background-color: #1e4d2b !important;
    color: #e0e0e0 !important;
}

.table-danger {
    background-color: #4d1e1e !important;
    color: #e0e0e0 !important;
}

.table-danger td {
    background-color: #4d1e1e !important;
    color: #e0e0e0 !important;
}

.table-warning {
    background-color: #4d3d1e !important;
    color: #e0e0e0 !important;
}

.table-warning td {
    background-color: #4d3d1e !important;
    color: #e0e0e0 !important;
}

.table-secondary {
    background-color: #3d3d3d !important;
    color: #e0e0e0 !important;
}

.table-secondary td {
    background-color: #3d3d3d !important;
    color: #e0e0e0 !important;
}

.table-info {
    background-color: #1e3d4d !important;
    color: #e0e0e0 !important;
}

.table-info td {
    background-color: #1e3d4d !important;
    color: #e0e0e0 !important;
}

/* Forms */
body.dark-theme .form-control {
    background-color: #333333 !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .form-control:focus {
    background-color: #333333 !important;
    border-color: #007bff !important;
    color: #e0e0e0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

body.dark-theme .form-select {
    background-color: #333333 !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

body.dark-theme .form-floating > label {
    color: #b0b0b0 !important;
}

/* Buttons */
.btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Modals */
.modal-content {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

.modal-header {
    background-color: #333333 !important;
    border-bottom: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

.modal-body {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.modal-footer {
    background-color: #333333 !important;
    border-top: 1px solid #404040 !important;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
}

.navbar-dark {
    background-color: #1a1a1a !important;
}

.dropdown-menu {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
}

.dropdown-item {
    color: #e0e0e0 !important;
}

.dropdown-item:hover {
    background-color: #404040 !important;
    color: #e0e0e0 !important;
}

/* Alerts */
.alert {
    border-radius: 0.375rem;
}

.alert-success {
    background-color: #1e4d2b !important;
    border-color: #28a745 !important;
    color: #e0e0e0 !important;
}

.alert-danger {
    background-color: #4d1e1e !important;
    border-color: #dc3545 !important;
    color: #e0e0e0 !important;
}

.alert-warning {
    background-color: #4d3d1e !important;
    border-color: #ffc107 !important;
    color: #e0e0e0 !important;
}

.alert-info {
    background-color: #1e3d4d !important;
    border-color: #17a2b8 !important;
    color: #e0e0e0 !important;
}

/* Text colors for dark theme */
.text-muted {
    color: #b0b0b0 !important;
}

/* Clickable rows */
.clickable:hover {
    background-color: #404040 !important;
}

/* Remove borders from dropdown header buttons */
.card-header .btn-link {
    border: none !important;
}

/* Footer dark theme */
.bg-light {
    background-color: #1a1a1a !important;
}

footer {
    background-color: #1a1a1a !important;
    background: #1a1a1a !important;
}

body.dark-theme footer {
    background-color: #1a1a1a !important;
}

/* Chart container */
canvas {
    background-color: #2d2d2d !important;
    border-radius: 0.375rem;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
}