﻿/* ===================================================================
   LAF_CheckBox bilesenine ait stiller. Onek: 'laf-checkbox-'.
   Durumlar native <input> pseudo-class'lariyla yonetilir; kapsayicida
   ayri state class'i YOKTUR (editor sinif adlariyla cakismayi onler).
   =================================================================== */

.laf-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-family: var(--mud-typography-body1-family, 'Roboto', sans-serif);
}

/* Native input: gorunmez ama tiklanabilir/odaklanabilir; kutunun uzerinde durur */
.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(--mud-palette-primary); /* eski: text-secondary */
    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(--mud-palette-primary-text, #fff);
    transform: scale(0);
    transition: transform .15s cubic-bezier(.4,0,.2,1);
}

/* ── Checked ──────────────────────────────────────────────────── */
.laf-checkbox-native:checked ~ .laf-checkbox-box {
    background: var(--mud-palette-primary);
    border-color: var(--mud-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(--mud-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(--mud-palette-primary) 25%, transparent);
}

/* ── Label ────────────────────────────────────────────────────── */
.laf-checkbox-label {
    font-size: var(--mud-typography-body1-size, .875rem);
    color: var(--mud-palette-text-primary);
    line-height: 1.2;
    cursor: inherit;
}

/* ── Disabled (native :disabled uzerinden; container'a class binmez) ── */
.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(--mud-palette-text-disabled);
        cursor: default;
    }
