/* Prevent theme flash */
:root {
    color-scheme: light dark;
}

/* Apply a default dark background if dark mode was previously enabled */
html[data-dark-mode="true"] {
    background-color: #0F172A; /* Matches AppTheme.DarkPalette.Background */
}

/* Default styles */
.content-container {
    padding: 1rem;
    border-radius: 4px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* toolbar container for _table filters */
.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .filter-toolbar > * {
        width: 100% !important;
    }
}

/* Section Headers - Multiple approaches for better compatibility */
.section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.mud-typography.section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* Quill Editor Styles */
.quill-editor-container {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.quill-editor-container .ql-toolbar {
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.quill-editor-container .ql-toolbar .ql-formats {
    margin-right: 8px;
}

.quill-editor-container .ql-toolbar button {
    width: 28px;
    height: 28px;
    margin: 2px;
    border: 1px solid transparent;
    border-radius: 3px;
}

.quill-editor-container .ql-toolbar button:hover {
    background-color: #e6e6e6;
}

.quill-editor-container .ql-toolbar button.ql-active {
    background-color: #d4d4d4;
}

.quill-editor-container .ql-toolbar .ql-picker {
    height: 28px;
    margin: 2px;
}

.quill-editor-container .ql-container {
    border: none;
    font-family: inherit;
}

.quill-editor-container .ql-editor {
    min-height: 120px;
    padding: 12px;
}

/* Dark mode support for Quill */
html[data-dark-mode="true"] .quill-editor-container {
    border-color: #424242;
}

html[data-dark-mode="true"] .quill-editor-container .ql-toolbar {
    background-color: #303030;
    border-bottom-color: #424242;
}

html[data-dark-mode="true"] .quill-editor-container .ql-toolbar button {
    color: #ffffff;
}

html[data-dark-mode="true"] .quill-editor-container .ql-toolbar button:hover {
    background-color: #404040;
}

html[data-dark-mode="true"] .quill-editor-container .ql-toolbar button.ql-active {
    background-color: #505050;
}

html[data-dark-mode="true"] .quill-editor-container .ql-toolbar .ql-picker {
    color: #ffffff;
}

html[data-dark-mode="true"] .quill-editor-container .ql-container {
    background-color: #1e1e1e;
    color: #ffffff;
}

html[data-dark-mode="true"] .quill-editor-container .ql-editor {
    color: #ffffff;
}

/* Higher specificity for MudText components */
.mud-text.section-header,
.mud-typography-subtitle1.section-header,
.mud-typography.mud-typography-subtitle1.section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.section-subtitle {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.mud-typography.section-subtitle {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* High specificity section header */
.mud-paper .section-header,
.mud-grid .section-header,
div .section-header {
    font-weight: bold !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* OneBox Components Styles */

.text-right {
    text-align: right;
}

/* Reusable flex utility for right-aligned action rows */
.actions-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* Date Range Filter - Theme-aware background */
.date-range-filter-background {
    background-color: #F1F5F9; /* Slate 100 - matches AppTheme.LightPalette.GrayLighter */
}

html[data-dark-mode="true"] .date-range-filter-background {
    background-color: #1E293B; /* Slate 800 - matches AppTheme.DarkPalette.BackgroundGray */
}
