/*!
 * -------------------------------------------------------------------------
 * advancedforms plugin for GLPI
 * -------------------------------------------------------------------------
 *
 * MIT License
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * -------------------------------------------------------------------------
 * @copyright Copyright (C) 2025 by the advancedforms plugin team.
 * @license   MIT https://opensource.org/licenses/mit-license.php
 * @link      https://github.com/pluginsGLPI/advancedforms
 * -------------------------------------------------------------------------
 */

/* Hide ldap preview on active questions */
[data-glpi-form-editor-active-question] [data-ldap-question-preview] {
        display: none !important;
}

[data-glpi-form-editor-question]:has([data-af-table-admin]) label.form-check:has([data-glpi-form-editor-original-name="is_mandatory"]) {
    display: none !important;
}

[data-af-table-column] .select2-selection--single .select2-selection__rendered,
[data-af-table-question] td .select2-selection--single .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    line-height: normal !important;
    direction: ltr !important;
    height: 100% !important;
}
[data-af-table-column] .select2-selection--single .select2-selection__rendered::before,
[data-af-table-question] td .select2-selection--single .select2-selection__rendered::before {
    display: none !important;
}

.af-required-toggle {
    display: inline-flex;
    align-items: center;
    color: var(--tblr-secondary);
}
.af-required-toggle:hover {
    color: var(--tblr-body-color);
}
.af-required-toggle:has(:checked) {
    color: var(--tblr-danger);
}
.af-required-toggle:has(:focus-visible) {
    outline: 2px solid var(--tblr-primary);
    outline-offset: 2px;
    border-radius: var(--tblr-border-radius);
}

[data-af-table-question]:has(select.is-invalid) td:not(:has(select.is-invalid)) .select2-container--default .select2-selection {
    border-color: var(--tblr-border-color) !important;
}
[data-af-table-question] td:has(select.is-invalid) .select2-container--default .select2-selection {
    border-color: var(--tblr-form-invalid-border-color) !important;
}
