/* ========================================
   GLOBAL UI/UX IMPROVEMENTS
   ======================================== */

/**
 * Fix: Clear/Reset Button Hover Readability
 * Issue: Content becomes unreadable when hovering over clear/reset buttons
 * Solution: Improve hover states with proper contrast and visibility
 */

/* Enhanced button hover states for better readability */
.btn-secondary:hover,
.btn-reset:hover,
.reset-btn:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Ensure clear icons remain visible on hover */
.btn-secondary:hover i,
.btn-reset:hover i,
.reset-btn:hover i {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Fix for pill-shaped (rounded) buttons */
.btn-secondary.rounded-pill:hover {
    background-color: rgba(108, 117, 125, 0.9) !important;
}

/* Fix for button groups */
.btn-group .btn-secondary:hover {
    z-index: 1;
    background-color: #5a6268 !important;
}

/**
 * Enhanced validation error display
 * Ensures errors are clearly visible and properly styled
 */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

.invalid-feedback:empty,
.invalid-feedback[style*="display: none"] {
    display: none !important;
    opacity: 0;
    max-height: 0;
}

/* Validation error transition effects */
.is-invalid {
    border-color: #dc3545 !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%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);
}

.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Smooth transition when clearing validation errors */
.form-input,
.form-select,
.form-select-enhanced,
select,
textarea {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/**
 * Date picker styling for consistency
 * Applied when date standardization is implemented
 */
.form-input.datepicker,
input[type="text"].datepicker {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23666' d='M11 1v1h2a2 2 0 012 2v9a2 2 0 01-2 2H3a2 2 0 01-2-2V4a2 2 0 012-2h2V1h1v1h4V1h1zm3 9H2v3a1 1 0 001 1h10a1 1 0 001-1v-3zm-11-5a1 1 0 00-1 1h12a1 1 0 00-1-1H3z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

/* ========================================
   END GLOBAL UI/UX IMPROVEMENTS
   ======================================== */