/* Dark Mode Enhancements for Better Contrast and Visibility */

/* Ensure all text elements are visible in dark mode */
.dark-mode {
    color-scheme: dark;
}

/* Enhanced text contrast */
.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
    color: #f8fafc !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.dark-mode p,
.dark-mode span,
.dark-mode div,
.dark-mode label {
    color: #e2e8f0;
}

.dark-mode .text-muted {
    color: #94a3b8 !important;
}

/* Enhanced card visibility */
.dark-mode .card,
.dark-mode .section-card,
.dark-mode .snapshot-card,
.dark-mode .summary-card,
.dark-mode .stat-card,
.dark-mode .tool-card,
.dark-mode .role-card,
.dark-mode .nav-card,
.dark-mode .explore-card,
.dark-mode .recent-activity-card,
.dark-mode .net-position-card {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.dark-mode .card:hover,
.dark-mode .section-card:hover,
.dark-mode .tool-card:hover,
.dark-mode .role-card:hover,
.dark-mode .nav-card:hover,
.dark-mode .explore-card:hover {
    background: #334155 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

/* Enhanced button visibility */
.dark-mode .btn {
    border: 1px solid #475569;
}

.dark-mode .btn-primary {
    background: #042e5e !important;
    border-color: #042e5e !important;
    color: #ffffff !important;
}

.dark-mode .btn-primary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

.dark-mode .btn-secondary {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
    color: #ffffff !important;
}

.dark-mode .btn-secondary:hover {
    background: #4b5563 !important;
    border-color: #4b5563 !important;
}

.dark-mode .btn-success {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.dark-mode .btn-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
}

.dark-mode .btn-danger {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

.dark-mode .btn-danger:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

.dark-mode .btn-warning {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #1f2937 !important;
}

.dark-mode .btn-warning:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
}

.dark-mode .btn-outline-primary {
    border-color: #042e5e !important;
    color: #042e5e !important;
}

.dark-mode .btn-outline-primary:hover {
    background: #042e5e !important;
    border-color: #042e5e !important;
    color: #ffffff !important;
}

/* Enhanced form elements */
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background: #374151 !important;
    border: 1px solid #6b7280 !important;
    color: #f9fafb !important;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus,
.dark-mode input:focus,
.dark-mode textarea:focus,
.dark-mode select:focus {
    background: #4b5563 !important;
    border-color: #042e5e !important;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25) !important;
    color: #ffffff !important;
}

.dark-mode .form-control::placeholder,
.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: #9ca3af !important;
}

/* Enhanced table visibility */
.dark-mode .table {
    color: #f1f5f9 !important;
    background: #1e293b !important;
}

.dark-mode .table thead th {
    background: #1e3a8a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

.dark-mode .table tbody tr {
    background: #1e293b !important;
    border-color: #475569 !important;
}

.dark-mode .table tbody tr:nth-child(even) {
    background: #334155 !important;
}

.dark-mode .table tbody tr:hover {
    background: #475569 !important;
}

.dark-mode .table td,
.dark-mode .table th {
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

/* Enhanced navigation */
.dark-mode .navbar {
    background: rgba(31, 31, 31, 0.95) !important;
    border-bottom: 1px solid #475569 !important;
}

.dark-mode .navbar-brand,
.dark-mode .nav-link {
    color: #f1f5f9 !important;
}

.dark-mode .nav-link:hover {
    color: #042e5e !important;
}

.dark-mode .navbar-toggler {
    border-color: #6b7280 !important;
}

.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23f1f5f9' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Enhanced footer */
.dark-mode .footer {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-top: 1px solid #475569 !important;
}

.dark-mode .footer a {
    color: #042e5e !important;
}

.dark-mode .footer a:hover {
    color: #dbeafe !important;
}

/* Enhanced alerts */
.dark-mode .alert {
    border: 1px solid;
}

.dark-mode .alert-success {
    background: #064e3b !important;
    border-color: #10b981 !important;
    color: #a7f3d0 !important;
}

.dark-mode .alert-danger {
    background: #7f1d1d !important;
    border-color: #ef4444 !important;
    color: #fecaca !important;
}

.dark-mode .alert-warning {
    background: #78350f !important;
    border-color: #f59e0b !important;
    color: #fde68a !important;
}

.dark-mode .alert-info {
    background: #1e3a8a !important;
    border-color: #042e5e !important;
    color: #bfdbfe !important;
}

/* Enhanced modals */
.dark-mode .modal-content {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #f1f5f9 !important;
}

.dark-mode .modal-header {
    background: #374151 !important;
    border-bottom: 1px solid #475569 !important;
    color: #f1f5f9 !important;
}

.dark-mode .modal-footer {
    border-top: 1px solid #475569 !important;
}

.dark-mode .modal-title {
    color: #f1f5f9 !important;
}

/* Enhanced dropdowns */
.dark-mode .dropdown-menu {
    background: #374151 !important;
    border: 1px solid #6b7280 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.dark-mode .dropdown-item {
    color: #f9fafb !important;
}

.dark-mode .dropdown-item:hover {
    background: #4b5563 !important;
    color: #ffffff !important;
}

.dark-mode .dropdown-divider {
    border-color: #6b7280 !important;
}

/* Enhanced breadcrumbs */
.dark-mode .breadcrumb {
    background: #374151 !important;
}

.dark-mode .breadcrumb-item a {
    color: #042e5e !important;
}

.dark-mode .breadcrumb-item.active {
    color: #e2e8f0 !important;
}

/* Enhanced pagination */
.dark-mode .page-link {
    background: #374151 !important;
    border-color: #6b7280 !important;
    color: #042e5e !important;
}

.dark-mode .page-link:hover {
    background: #4b5563 !important;
    border-color: #6b7280 !important;
    color: #dbeafe !important;
}

.dark-mode .page-item.active .page-link {
    background: #042e5e !important;
    border-color: #042e5e !important;
    color: #ffffff !important;
}

/* Enhanced badges */
.dark-mode .badge {
    color: #ffffff !important;
}

.dark-mode .badge.bg-primary {
    background: #042e5e !important;
}

.dark-mode .badge.bg-secondary {
    background: #6b7280 !important;
}

.dark-mode .badge.bg-success {
    background: #10b981 !important;
}

.dark-mode .badge.bg-danger {
    background: #ef4444 !important;
}

.dark-mode .badge.bg-warning {
    background: #f59e0b !important;
    color: #1f2937 !important;
}

.dark-mode .badge.bg-info {
    background: #042e5e !important;
}

/* Enhanced tooltips */
.dark-mode .tooltip .tooltip-inner {
    background: #374151 !important;
    color: #f9fafb !important;
}

.dark-mode .tooltip .tooltip-arrow::before {
    border-color: #374151 transparent !important;
}

/* Enhanced progress bars */
.dark-mode .progress {
    background: #374151 !important;
}

.dark-mode .progress-bar {
    background: #042e5e !important;
}

/* Enhanced list groups */
.dark-mode .list-group-item {
    background: #374151 !important;
    border-color: #6b7280 !important;
    color: #f9fafb !important;
}

.dark-mode .list-group-item:hover {
    background: #4b5563 !important;
}

.dark-mode .list-group-item.active {
    background: #042e5e !important;
    border-color: #042e5e !important;
}

/* Enhanced accordions */
.dark-mode .accordion-item {
    background: #374151 !important;
    border: 1px solid #6b7280 !important;
}

.dark-mode .accordion-button {
    background: #374151 !important;
    color: #f9fafb !important;
    border-bottom: 1px solid #6b7280 !important;
}

.dark-mode .accordion-button:not(.collapsed) {
    background: #4b5563 !important;
    color: #ffffff !important;
}

.dark-mode .accordion-body {
    background: #374151 !important;
    color: #e2e8f0 !important;
}

/* Enhanced carousel */
.dark-mode .carousel-control-prev,
.dark-mode .carousel-control-next {
    background: rgba(0, 0, 0, 0.5) !important;
}

.dark-mode .carousel-indicators button {
    background: #6b7280 !important;
}

.dark-mode .carousel-indicators button.active {
    background: #042e5e !important;
}

/* Enhanced offcanvas */
.dark-mode .offcanvas {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.dark-mode .offcanvas-header {
    border-bottom: 1px solid #475569 !important;
}

/* Enhanced close buttons */
.dark-mode .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23f1f5f9'%3e%3cpath d='M2.146 2.146a.5.5 0 0 1 .708 0L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
    opacity: 0.8;
}

.dark-mode .btn-close:hover {
    opacity: 1;
}

/* Enhanced spinners */
.dark-mode .spinner-border {
    color: #042e5e !important;
}

.dark-mode .spinner-grow {
    color: #042e5e !important;
}

/* Enhanced text selection */
.dark-mode ::selection {
    background: #042e5e !important;
    color: #ffffff !important;
}

.dark-mode ::-moz-selection {
    background: #042e5e !important;
    color: #ffffff !important;
}

/* Enhanced scrollbars for webkit browsers */
.dark-mode ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #374151;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Enhanced focus indicators */
.dark-mode *:focus {
    outline: 2px solid #042e5e !important;
    outline-offset: 2px;
}

/* Enhanced border colors for better separation */
.dark-mode hr {
    border-color: #475569 !important;
}

.dark-mode .border {
    border-color: #475569 !important;
}

.dark-mode .border-top {
    border-top-color: #475569 !important;
}

.dark-mode .border-bottom {
    border-bottom-color: #475569 !important;
}

.dark-mode .border-left {
    border-left-color: #475569 !important;
}

.dark-mode .border-right {
    border-right-color: #475569 !important;
}

/* Enhanced shadows for better depth perception */
.dark-mode .shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

.dark-mode .shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4) !important;
}

.dark-mode .shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* Ensure icons are visible */
.dark-mode .bi,
.dark-mode .fa,
.dark-mode .fas,
.dark-mode .far,
.dark-mode .fab {
    color: #e2e8f0 !important;
}

/* Enhanced notification elements */
.dark-mode .notification-bell {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

.dark-mode .notification-badge {
    background: #ef4444 !important;
    color: #ffffff !important;
}

/* Enhanced language toggle */
.dark-mode .language-btn {
    background: transparent !important;
    border-color: #042e5e !important;
    color: #042e5e !important;
}

.dark-mode .language-btn.active {
    background: #042e5e !important;
    border-color: #042e5e !important;
    color: #ffffff !important;
}

.dark-mode .language-btn:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #042e5e !important;
    color: #dbeafe !important;
}

/* Enhanced profile elements */
.dark-mode .profile-avatar-container {
    background-color: #374151 !important;
}

.dark-mode .greeting-text {
    color: #f1f5f9 !important;
}

/* Enhanced bottom navigation */
.dark-mode .bottom-nav {
    background: #1e293b !important;
    border-top: 1px solid #475569 !important;
}

.dark-mode .bottom-nav .nav-item {
    color: #e2e8f0 !important;
}

.dark-mode .bottom-nav .nav-item.active {
    color: #042e5e !important;
    background: rgba(59, 130, 246, 0.2) !important;
}

.dark-mode .bottom-nav .nav-item:hover {
    color: #042e5e !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Ensure all custom components are visible */
.dark-mode .fintech-top-header {
    background-color: #1e293b !important;
    border-bottom-color: #475569 !important;
}

.dark-mode .fintech-top-header .greeting-text,
.dark-mode .fintech-top-header .brand-text {
    color: #f1f5f9 !important;
}

.dark-mode .fintech-top-header .icon-btn {
    color: #e2e8f0 !important;
}

.dark-mode .fintech-top-header .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Media queries for responsive dark mode */
@media (max-width: 768px) {

    .dark-mode .card,
    .dark-mode .section-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }
}

@media (max-width: 576px) {
    .dark-mode .btn {
        font-size: 0.875rem;
    }

    .dark-mode .form-control,
    .dark-mode .form-select {
        font-size: 0.875rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dark-mode {
        --text-color: #ffffff !important;
        --text-muted: #d1d5db !important;
        --card-bg: #000000 !important;
        --background-main: #000000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .dark-mode * {
        transition: none !important;
        animation: none !important;
    }

}
