/**
 * Custom dark mode theme enhancements for DocumentVault
 * This file overrides specific variables to make the dark theme more appealing
 */

/* Override dark theme variables with slightly lighter backgrounds */
.dark-theme {
    /* Make the body background a lighter shade of dark gray */
    --body-bg: #2d2d2d !important;
    
    /* Make the card and sidebar backgrounds slightly lighter */
    --card-bg: #212121 !important;
    --sidebar-bg: #212121 !important;
    
    /* Ensure good contrast for text */
    --body-text: #ffffff !important;
    --sidebar-text: #ffffff !important;
}

/* Override document chat background to be consistent */
.dark-theme .chat-container,
.dark-theme .document-chat,
.dark-theme .chat-panel,
.dark-theme .chat-window {
    background-color: #2d2d2d !important;
}

/* Override document preview background */
.dark-theme .document-preview,
.dark-theme .file-preview,
.dark-theme .preview-panel,
.dark-theme .document-viewer,
.dark-theme .pdf-viewer {
    background-color: #212121 !important;
}

/* Override grid background in dark mode */
.dark-theme .document-vault-grid,
.dark-theme .document-vault-grid table {
    background-color: #212121 !important;
}

.dark-theme .document-vault-grid .rz-datatable-data td,
.dark-theme .document-vault-grid .rz-grid-table td {
    background-color: #212121 !important;
}

.dark-theme .document-vault-grid .rz-datatable-data tr:nth-child(even) td,
.dark-theme .document-vault-grid .rz-grid-table tr:nth-child(even) td {
    background-color: #2a2a2a !important;
}

.dark-theme .document-vault-grid .rz-datatable-data tr:hover td,
.dark-theme .document-vault-grid .rz-grid-table tr:hover td {
    background-color: #383838 !important;
}

/* Solid alert backgrounds in dark mode */
.dark-theme .alert,
.dark-theme .mud-alert {
    background-color: #2d2d2d !important;
    border: 1px solid #424242 !important;
}

.dark-theme .alert-info,
.dark-theme .mud-alert-info {
    background-color: #0d3c61 !important;
    border-color: #1976d2 !important;
    color: #e0e0e0 !important;
}

.dark-theme .alert-success,
.dark-theme .mud-alert-success {
    background-color: #1e3a29 !important;
    border-color: #2a5a40 !important;
    color: #e0e0e0 !important;
}

.dark-theme .alert-danger,
.dark-theme .alert-error,
.dark-theme .mud-alert-error {
    background-color: #541e1e !important;
    border-color: #842029 !important;
    color: #e0e0e0 !important;
}

.dark-theme .alert-warning,
.dark-theme .mud-alert-warning {
    background-color: #5a4a00 !important;
    border-color: #ffc107 !important;
    color: #f8f8f8 !important;
}

/* Alert drawer items with solid backgrounds */
.dark-theme .alert-drawer-container .alert-success {
    background-color: #1e3a29 !important;
}

.dark-theme .alert-drawer-container .alert-error {
    background-color: #541e1e !important;
}

.dark-theme .alert-drawer-container .alert-warning {
    background-color: #5a4a00 !important;
}

.dark-theme .alert-drawer-container .alert-info {
    background-color: #0d3c61 !important;
}

/* Custom alert items */
.dark-theme .custom-alert-item {
    background-color: #383838 !important;
    border: 1px solid #424242 !important;
}

/* MudBlazor Snackbar solid backgrounds in dark mode */
.dark-theme .mud-snackbar,
.dark-theme .mud-snackbar-container {
    background-color: #383838 !important;
    border: 1px solid #424242 !important;
}

.dark-theme .mud-snackbar.mud-snackbar-success {
    background-color: #1e3a29 !important;
    border-color: #2a5a40 !important;
    color: #e0e0e0 !important;
}

.dark-theme .mud-snackbar.mud-snackbar-error {
    background-color: #541e1e !important;
    border-color: #842029 !important;
    color: #e0e0e0 !important;
}

.dark-theme .mud-snackbar.mud-snackbar-warning {
    background-color: #5a4a00 !important;
    border-color: #ffc107 !important;
    color: #f8f8f8 !important;
}

.dark-theme .mud-snackbar.mud-snackbar-info {
    background-color: #0d3c61 !important;
    border-color: #1976d2 !important;
    color: #e0e0e0 !important;
}

/* MudBlazor Alert component solid backgrounds */
.dark-theme .mud-alert.mud-alert-filled-success,
.dark-theme .mud-snackbar.mud-alert-filled-success {
    background-color: #1e3a29 !important;
}

.dark-theme .mud-alert.mud-alert-filled-error,
.dark-theme .mud-snackbar.mud-alert-filled-error {
    background-color: #541e1e !important;
}

.dark-theme .mud-alert.mud-alert-filled-warning,
.dark-theme .mud-snackbar.mud-alert-filled-warning {
    background-color: #5a4a00 !important;
}

.dark-theme .mud-alert.mud-alert-filled-info,
.dark-theme .mud-snackbar.mud-alert-filled-info {
    background-color: #0d3c61 !important;
}

/* Ensure all snackbar content is visible */
.dark-theme .mud-snackbar-content-message {
    color: #e0e0e0 !important;
}

/* Custom Alert Component solid backgrounds */
.dark-theme .custom-alert {
    background-color: #383838 !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.dark-theme .custom-alert.alert-success {
    background-color: #1e3a29 !important;
    border-left-color: #2a5a40 !important;
}

.dark-theme .custom-alert.alert-error {
    background-color: #541e1e !important;
    border-left-color: #842029 !important;
}

.dark-theme .custom-alert.alert-warning {
    background-color: #5a4a00 !important;
    border-left-color: #ffc107 !important;
}

.dark-theme .custom-alert.alert-info {
    background-color: #0d3c61 !important;
    border-left-color: #1976d2 !important;
}

/* Custom alert icon backgrounds - solid colors */
.dark-theme .custom-alert .alert-icon {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-theme .custom-alert.alert-success .alert-icon {
    background-color: #2a5a40 !important;
    color: #8bc34a !important;
}

.dark-theme .custom-alert.alert-error .alert-icon {
    background-color: #842029 !important;
    color: #ff5252 !important;
}

.dark-theme .custom-alert.alert-warning .alert-icon {
    background-color: #886a00 !important;
    color: #ffc107 !important;
}

.dark-theme .custom-alert.alert-info .alert-icon {
    background-color: #1976d2 !important;
    color: #90caf9 !important;
}

/* Custom alert timestamp in dark mode */
.dark-theme .custom-alert .alert-timestamp {
    color: #bdbdbd !important;
}

/* Custom alert close button in dark mode */
.dark-theme .custom-alert .alert-close {
    color: #bdbdbd !important;
}

.dark-theme .custom-alert .alert-close:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* Document Chat - Fix document reference filename visibility */
.dark-theme .document-references .document-name {
    color: #ffffff !important;
}

.dark-theme .document-references .document-reference {
    background-color: #2d2d2d !important;
    border-left: 3px solid #1976d2 !important;
}

.dark-theme .document-references .document-reference:hover {
    background-color: #383838 !important;
}

.dark-theme .document-references .document-description {
    color: #bdbdbd !important;
}

.dark-theme .document-references .document-icon {
    color: #ff6b6b !important; /* Red color for PDF icons */
}

/* Ensure all document info text is visible */
.dark-theme .document-info {
    color: #e0e0e0 !important;
}

.dark-theme .document-info .document-name {
    color: #ffffff !important;
    font-weight: 500;
}
