/* Form Validation Styles - Bootstrap 4 Compatible */

/* Required field indicator */
.required-field:after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Validation error summary box */
.validation-errors {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.validation-errors ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.validation-errors h5 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #721c24;
}

/* Invalid field styling */
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Invalid feedback text */
.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Valid field styling (optional - for when validation passes) */
.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Help text styling */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Disabled field styling */
.form-control:disabled,
.form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Required field legend */
.form-required-legend {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.form-required-legend .required-indicator {
    color: #dc3545;
    font-weight: bold;
}

/* DataTables search styling */
.dataTables_wrapper .dataTables_filter,
.dt-container .dt-search {
    float: right;
    margin-bottom: 5px;
    margin-right: 8px;
    margin-top: 5px;
}

.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 10px;
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 15px;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 15px;
}