/* Match material-dashboard input styles */

.sidenav {
    overflow-y: auto !important;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: #fff;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    height: auto;
    font-size: 0.875rem;
    font-family: 'Roboto', sans-serif;
    box-shadow: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057;
    padding: 0;
    line-height: 1.5;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 10px;
    right: 10px;
}

.select2-container .select2-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'Roboto', sans-serif;
}

.quill-editor {
    min-height: 150px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem !important;
    background-color: #fff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.quill-editor:focus {
    border-color: #6b7280 !important;
    box-shadow: 0 0 0 0.2rem rgba(107, 114, 128, 0.25) !important;
    outline: none !important;
}

.ql-toolbar {
    background-color: #f8f9fa !important;
    border: 1px solid #e5e7eb !important;
    border-bottom: none !important;
    border-radius: 0.375rem 0.375rem 0 0 !important;
    padding: 0.25rem !important;
}

.ql-toolbar .ql-formats {
    margin-right: 0.5rem !important;
}

.ql-toolbar button,
.ql-toolbar .ql-picker {
    background-color: #fff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.25rem !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0 0.1rem !important;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out !important;
}

/* Fix for icon pickers (color, align) being broken by the padding above */
.ql-toolbar .ql-picker.ql-color-picker,
.ql-toolbar .ql-picker.ql-icon-picker {
    padding: 0 !important;
    width: 32px !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
}

.ql-toolbar .ql-picker.ql-color-picker .ql-picker-label,
.ql-toolbar .ql-picker.ql-icon-picker .ql-picker-label {
    padding: 2px 4px !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.ql-toolbar button:hover,
.ql-toolbar .ql-picker:hover {
    background-color: #e5e7eb !important;
    border-color: #9ca3af !important;
}

.ql-toolbar button.ql-active,
.ql-toolbar .ql-picker.ql-expanded {
    background-color: #d1d5db !important;
    border-color: #6b7280 !important;
}

.ql-picker-options {
    border: 1px solid #d1d5db !important;
    border-radius: 0.25rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    z-index: 1050 !important;
    /* Ensure it shows above other elements */
}

.ql-picker-item:hover {
    background-color: #e5e7eb !important;
}

.quill-editor h1 {
    font-size: 1.5em !important;
    font-weight: bold !important;
    margin: 0.5em 0 !important;
}

.quill-editor h2 {
    font-size: 1.3em !important;
    font-weight: bold !important;
    margin: 0.5em 0 !important;
}

.quill-editor h3 {
    font-size: 1.1em !important;
    font-weight: bold !important;
    margin: 0.5em 0 !important;
}

.ql-container {
    border-radius: 0.375rem !important;
}

/* ===== Table Text Wrapping Utility Classes ===== */

/* Apply this class to table or table cells that should wrap text */
table.text-wrap,
table.text-wrap td,
.text-wrap {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
}

/* Prevent wrapping on last column (usually Actions) */
table.text-wrap td:last-child,
table.text-wrap th:last-child {
    white-space: nowrap !important;
}

/* Apply to cells with long text that need width limit */
.text-wrap-sm {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 150px;
}

.text-wrap-md {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 200px;
}

.text-wrap-lg {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 300px;
}

/* ===== Table Number Field Alignment ===== */
table td.text-end,
table th.text-end {
    text-align: right !important;
}

/* ===== Navbar Dropdown Hover Fix ===== */
.dropdown-menu.bg-gradient-dark .dropdown-item:hover,
.dropdown-menu.bg-gradient-dark .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

/* ===== Table Dropdown Fix ===== */
/* For tables with dropdowns that need to overflow the container */
.table-responsive.dropdown-overflow-visible,
.dropdown-overflow-visible {
    overflow: visible !important;
}

/* Ensure dropdown menus have high z-index */
.dropdown .dropdown-menu,
.dropup .dropdown-menu {
    z-index: 1060 !important;
    /* Higher than sticky headers/navbars */
}

/* Position dropup menus correctly */
.dropup .dropdown-menu {
    bottom: 100%;
    top: auto;
    margin-bottom: 0.5rem !important;
    /* Added a bit more space */
}

/* Ensure the table header doesn't overlap when overflow is visible */
.table-responsive.dropdown-overflow-visible {
    position: relative;
    z-index: 2;
}

.table-responsive.dropdown-overflow-visible table thead {
    position: relative;
    z-index: 1;
    /* Lower than the dropdown menu's 1060 */
}

.page-header-bg-sign-in {
    background-image: url('../assets/img/login_bg.jpg') !important;
    background-size: cover;
    background-position: center;
}