/* Checkbox and Select2 layout fixes for ARCHIDEX frontend (Bootstrap 5) */

/* --- Select2 bootstrap-5 theme: dark login forms --- */
.archidex-loginform .select2-container--bootstrap-5 {
    width: 100% !important;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection,
.archidex-loginform .select2-container--default .select2-selection--multiple,
.archidex-loginform .select2-container--default .select2-selection--single {
    background-color: #66646e !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #fff !important;
    min-height: 40px;
}

/* Match native select/input height (40px) */
.archidex-loginform .select2-container--bootstrap-5 .select2-selection--single,
.archidex-loginform .select2-container--default .select2-selection--single {
    height: 40px;
    padding: 0 20px;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding: 0;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple,
.archidex-loginform .select2-container--default .select2-selection--multiple {
    padding: 2px 20px;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
    align-items: center;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered,
.archidex-loginform .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #fff !important;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #ffffff !important;
    color: #1b1d29 !important;
    border: 1px solid #d8d8dc !important;
    border-radius: 2px;
    padding: 0.1em 0.45em;
    margin: 0.15rem 0.25rem 0.15rem 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    color: #66646e !important;
    border-right: 0;
    margin-right: 0.25rem;
    opacity: 0.75;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover {
    color: #1b1d29 !important;
    opacity: 1;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-search,
.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-search .select2-search__field,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-search,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-search .select2-search__field {
    height: 28px;
    min-height: 28px;
    margin: 0;
    line-height: 28px;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field,
.archidex-loginform .select2-container--default .select2-selection--multiple .select2-search__field {
    color: #fff !important;
}

.archidex-loginform .select2-container--bootstrap-5 .select2-dropdown .select2-results__option--selected,
.archidex-loginform .select2-container--default .select2-results__option--selected {
    background-color: #bfbfbf !important;
}

.archidex-loginform .select2-dropdown {
    z-index: 1056;
}

/* --- Standard checkbox / radio lists --- */
.archidex-loginform ul.input_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archidex-loginform ul.input_list > li,
.archidex-loginform .input_list > label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.archidex-loginform .input_list label {
    font-family: 'SourceSansPro-Light', sans-serif;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.archidex-loginform .input_list input[type="checkbox"]:not(.checkbox-card),
.archidex-loginform .input_list input[type="radio"],
.archidex-loginform input[type="checkbox"]:not(.checkbox-card):not(.form-check-input),
.archidex-loginform input[type="radio"]:not(.form-check-input) {
    width: 1.1em;
    height: 1.1em;
    min-width: 1.1em;
    min-height: 1.1em;
    margin-top: 0.2em;
    margin-right: 0;
    flex-shrink: 0;
}

.archidex-loginform input[type="checkbox"]:not(.checkbox-card):not(.form-check-input) {
    margin-top: 0.15em;
}

.archidex-loginform .checkbox {
    font-family: "Montserrat-Medium", sans-serif;
    margin: 15px 0;
}

/* --- Bootstrap 5 form-check on dark/light forms --- */
.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.75em;
    margin-bottom: 0.5rem;
}

.form-check .form-check-input {
    float: left;
    margin-left: -1.75em;
    margin-top: 0.2em;
}

.form-check label,
.form-check .form-check-label {
    cursor: pointer;
}

/* Survey forms use extra left margin in inline styles */
#main .form-check,
.background .form-check {
    margin-left: 0;
    padding-left: 1.75em;
}

/* --- Event RSVP card checkboxes --- */
.card-container {
    position: relative;
    margin-bottom: 1rem;
}

.card-container > label {
    display: block;
    width: 100%;
    cursor: pointer;
    margin-bottom: 0;
}

.event-card {
    border: 3px solid #8e8e8e;
    border-radius: 4px;
    padding: 5px;
    transition: linear 0.4s;
}

.event-card.center .row {
    display: flex;
}

.event-card.center h4 {
    height: 85%;
    display: flex;
    align-items: center;
}

.event-card img {
    margin: auto;
}

.card-cb-con {
    min-height: 120px;
    position: relative;
}

span.card-cb {
    display: block;
    width: 30px;
    height: 30px;
    border: 3px solid #8e8e8e;
    border-radius: 4px;
    position: absolute;
    top: 40%;
    left: 40%;
}

.archidex-loginform input.checkbox-card,
input.checkbox-card {
    position: absolute;
    top: 50%;
    left: 7%;
    width: 1px;
    height: 1px;
    min-width: 0;
    min-height: 0;
    opacity: 0;
    margin: 0;
    flex-shrink: 0;
    z-index: 1;
}

input.checkbox-card:checked + .event-card {
    border: 3px solid #46c048;
}

input.checkbox-card:checked + .event-card span.card-cb {
    border: 3px solid #46c048;
}

input.checkbox-card:checked + .event-card span.card-cb:after {
    font-family: "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    content: "\f00c";
    position: absolute;
    color: #46c048;
    top: 8%;
    left: 20%;
}

@media only screen and (max-width: 1170px) {
    .archidex-loginform .select2-container--bootstrap-5 .select2-selection,
    .archidex-loginform .select2-container--default .select2-selection--multiple,
    .archidex-loginform .select2-container--default .select2-selection--single {
        min-height: 32px;
    }
}

@media only screen and (max-width: 767px) {
    .event-card.center .row {
        display: block;
        padding-left: 55px;
        position: relative;
    }

    .event-card.center .row > .col-sm-2:first-child {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 35px;
        padding: 0;
    }

    .event-card {
        text-align: center;
    }

    input.checkbox-card {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
    }

    span.card-cb {
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
    }

    .card-cb-con {
        min-height: 0;
    }
}

/* --- Pagination --- */
div.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 2rem;
    width: 100%;
    padding-left: 0;
}

div.pagination a.btn {
    margin: 0;
}

.library-navpagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.library-navpagination .pagination {
    justify-content: center;
    margin-bottom: 0;
}

