﻿/* ===================================================================
   LAF_CheckBox + LAF_Editor_Checkbox stilleri.
   Ust blok: '.laf-checkbox-'  → ic bilesen (native input pseudo-class'lari).
   Alt blok: '.laf-editor-checkbox-' → editor sarmalayici (ortak token'lar).
   =================================================================== */

/* ===================================================================
   IC BILESEN: LAF_CheckBox
   =================================================================== */
.laf-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-family: var(--LAF-default-font-family);
    line-height: 1; /* satir kutusu box ile ayni yukseklikte olsun */
}

/* Native input: gorunmez ama tiklanabilir/odaklanabilir */
.laf-checkbox-native {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    margin: 0;
    opacity: 0;
    cursor: inherit;
    z-index: 1;
}

/* Gorsel kutu */
.laf-checkbox-box {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border: 2px solid var(--LAF-palette-primary);
    border-radius: 4px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.laf-checkbox-check {
    width: 16px;
    height: 16px;
    fill: var(--LAF-palette-text-onprimary);
    transform: scale(0);
    transition: transform .15s cubic-bezier(.4,0,.2,1);
}

/* ── Checked ──────────────────────────────────────────────────── */
.laf-checkbox-native:checked ~ .laf-checkbox-box {
    background: var(--LAF-palette-primary);
    border-color: var(--LAF-palette-primary);
}

    .laf-checkbox-native:checked ~ .laf-checkbox-box .laf-checkbox-check {
        transform: scale(1);
    }

/* ── Hover ────────────────────────────────────────────────────── */
.laf-checkbox:hover .laf-checkbox-native:not(:disabled):not(:checked) ~ .laf-checkbox-box {
    border-color: var(--LAF-palette-primary-darken);
}

/* ── Focus ring (yalniz klavye) ───────────────────────────────── */
.laf-checkbox-native:focus-visible ~ .laf-checkbox-box {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--LAF-palette-primary) 25%, transparent);
}

/* ── Label ────────────────────────────────────────────────────── */
.laf-checkbox-label {
    font-size: var(--LAF-default-font-size);
    color: var(--LAF-palette-text);
    line-height: 1.2;
    cursor: inherit;
}

/* ── Disabled ─────────────────────────────────────────────────── */
.laf-checkbox-native:disabled {
    cursor: default;
}

    .laf-checkbox-native:disabled ~ .laf-checkbox-box {
        opacity: .6;
        border-color: var(--mud-palette-action-disabled, rgba(0,0,0,.26));
    }

    .laf-checkbox-native:disabled:checked ~ .laf-checkbox-box {
        background: var(--mud-palette-action-disabled, rgba(0,0,0,.26));
    }

    .laf-checkbox-native:disabled ~ .laf-checkbox-label {
        opacity: .6;
        color: var(--LAF-palette-text-disabled);
        cursor: default;
    }


/* ===================================================================
   EDITOR SARMALAYICI: LAF_Editor_Checkbox  (onek: 'laf-editor-checkbox-')
   Ortak yukseklik + outline token'lari (laf_editors.css) uzerinden.
   =================================================================== */
.laf-editor-checkbox-field {
    position: relative;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 0px;
    font-family: var(--LAF-default-font-family);
    font-size: var(--LAF-default-font-size, 0.875rem);
}

.laf-editor-checkbox-wrap {
    height: calc(var(--LAF-editor-height) + var(--LAF-editor-border-overhang-top));
    position: relative;
    display: flex;
    align-items: center;
    height: var(--LAF-editor-height);
    padding: 0 var(--LAF-editor-padding-x);
    box-sizing: border-box;
    cursor: pointer;
}

.laf-editor-checkbox-control {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    line-height: 0; /* ic kutunun baseline kaymasini oldur */
    margin-top:-4px;
}

/* ── Outlined border: token'lara bagli (Image/Text ile ayni) ──────── */
.laf-editor-checkbox-border {
    position: absolute;
    inset: -4px 0 0;
    margin: 0;
    padding: 0 10px;
    border-width: var(--LAF-editor-outline-width);
    border-color: var(--LAF-editor-outline-color);
    border-radius: var(--LAF-editor-radius);
    border-style:solid;
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
/*    transition: var(--LAF-editor-transition);*/
    background: var(--LAF-editor-bg);
/*    box-shadow: var(--LAF-editor-inset);*/
}

/* Hover / focus (yalniz outlined varyantta border elemani var) */
.laf-editor-checkbox-field:not(.laf-editor-checkbox-disabled):not(:focus-within):hover .laf-editor-checkbox-border {
/*    border-width: var(--LAF-editor-outline-width-hover);*/
    border-color: var(--LAF-editor-outline-color-hover);
}

.laf-editor-checkbox-field:focus-within .laf-editor-checkbox-border {
/*    border-width: var(--LAF-editor-outline-width-focus);*/
    border-color: var(--LAF-editor-outline-color-focus);
}

/* ── Disabled ─────────────────────────────────────────────────── */
.laf-editor-checkbox-disabled {
    opacity: .62;
    pointer-events: none;
}

    .laf-editor-checkbox-disabled .laf-editor-checkbox-border {
        border-style: dotted;
    }
