/*
 * Farsight Theme Web Overrides
 *
 * This file restores web-only CSS properties that were removed from FarsightTheme.uss
 * because they are not supported by Unity USS. These are valid standard CSS properties
 * that are needed for correct rendering in the Blazor web implementation.
 *
 * This file must be loaded immediately after farsight-theme.css.
 */

/* ============================================
   Foldout
   ============================================ */

/* USS uses display:flex; web prefers inline-block for the arrow icon */
.foldout-arrow {
    display: inline-block;
}

/* USS uses cursor:link; web standard is cursor:pointer */
.foldout-header {
    cursor: pointer;
}

/* ============================================
   Dropdown / Select
   ============================================ */

/* Dropdown wrapper: label above, select below (uses :has() which is supported in modern browsers) */
.input.variant-default.btn:has(label):has(select) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Native HTML <select> element - reset browser default appearance and apply theme styles */
select.input.variant-default.btn {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-family: inherit;
}

/* USS uses cursor:link; web standard is cursor:pointer */
.select__trigger,
.select-trigger,
.item,
.custom-dropdown__trigger,
.custom-dropdown__item {
    cursor: pointer;
}

/* ============================================
   Checkbox / Switch (Web Toggle Adaptation)
   ============================================ */

/* USS uses display:flex; web uses inline-flex for inline flow */
label.field.checkbox,
label.field.switch {
    display: inline-flex;
    box-sizing: border-box;
}

/* Restore pointer-events:none on hidden inputs (Unity uses PickingMode.Ignore set in C# via the IUIElement.IgnorePointer() extension) */
label.field.checkbox > input.checkbox-input,
label.field.switch > input.switch-input {
    pointer-events: none;
}

/* USS uses display:flex; web uses inline-flex */
label.field.checkbox > .checkbox-indicator {
    display: inline-flex;
    box-sizing: border-box;
    /* USS expands border-width/border-color separately; web can use shorthand */
    border: 1px solid var(--input);
    /* USS expands transition to multi-value form; web supports shorthand */
    transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}

/* USS uses display:flex; web uses inline-flex for switch track */
label.field.switch > .switch-field__track {
    display: inline-flex;
    box-sizing: border-box;
    border: 1px solid var(--border);
    /* Restore justify-content transition (not animatable in USS but valid in CSS) */
    transition: background-color 0.15s, border-color 0.15s, justify-content 0.15s;
}

label.field.switch > .switch-field__track > .switch-field__thumb {
    transition: background-color 0.15s, opacity 0.15s;
}

/* ============================================
   Text Input
   ============================================ */

/* USS removes box-sizing as Unity always uses border-box; restore for web */
.input.variant-default .unity-base-text-field__input,
.input.variant-default #unity-text-input,
.unity-text-field.input.variant-default .unity-text-field__input,
.field.input-field.variant-default .input {
    box-sizing: border-box;
}
