/* Custom Radio Buttons and Checkboxes Styles */

/* Reset default form-check styles to allow custom styling */
.form-check {
    padding-left: 0;
    margin-right: 0.5rem !important;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Style the label as a button/card */
.form-check .form-check-label {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 60px;
    justify-content: center;
    user-select: none;
    white-space: nowrap; /* Prevent text wrapping inside the label */
}

/* Style the input (radio/checkbox) */
.form-check .form-check-input {
    float: none;
    margin-left: 0;
    margin-right: 0.5rem;
    margin-top: 0;
    width: 1.2em;
    height: 1.2em;
    cursor: pointer;
    position: static; /* Override Bootstrap's absolute positioning */
}

/* Hover effect */
.form-check .form-check-label:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

/* Checked state (applied via JS in jpaorder.js) */
.form-check .form-check-label.checked-state {
    background-color: #e7f1ff;
    border-color: #0d6efd;
    color: #0d6efd;
    font-weight: bold;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Active/Focus state */
.form-check .form-check-input:focus {
    box-shadow: none; /* Remove default focus shadow from input as we apply it to label */
}

/* Make disabled checked text visible and distinctive */
fieldset[disabled] .form-check .form-check-label.checked-state,
.form-check .form-check-label.checked-state:has(.form-check-input:disabled),
.form-check .form-check-input:disabled:checked ~ .form-check-label {
    background-color: #e2e3e5;
    border-color: #495057;
    color: #212529 !important;
    font-weight: bold;
    opacity: 1;
}

/* Ensure the radio dot itself remains fully visible when disabled */
fieldset[disabled] .form-check .form-check-input:checked,
.form-check .form-check-input:disabled:checked {
    opacity: 1;
}

/* Improve visibility of disabled input controls (e.g., text, select) */
.form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
    color: #212529;
    font-weight: 500;
}

/* Ensure text is vertically aligned */
.form-check-label {
    vertical-align: middle;
}

/* Custom Select Styles (Bootstrap 5 style for AdminLTE/BS4 environments) */
.form-select {
    display: inline-block;
    width: auto;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    -moz-padding-start: calc(0.75rem - 3px);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    appearance: none;
    min-width: 80px;
    cursor: pointer;
}

.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

.form-select:disabled {
    background-color: #e9ecef;
}
