﻿.laf-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

    /* Gerçek checkbox gizli; sadece davranış + erişilebilirlik için var */
    .laf-switch input {
        position: absolute;
        width: 0;
        height: 0;
        margin: 0;
        opacity: 0;
    }

.laf-switch-track {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 9px;
    border-radius: 999px;
    transition: box-shadow .2s ease;
}

    /* Arka plan + opaklık burada; thumb'ı etkilemez */
    .laf-switch-track::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: var(--mud-palette-action-disabled, rgba(0, 0, 0, .26));
        opacity: .5;
        transition: background-color .2s ease;
    }

.laf-switch-thumb {
    position: absolute;
    top: -4.5px;
    left: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--LAF-palette-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s ease;
    z-index: 1;
}

/* Açık durum: renk ::before'da */
.laf-switch input:checked + .laf-switch-track::before {
    background: var(--laf-switch-color, var(--mud-palette-primary, #594ae2));
}

.laf-switch input:checked + .laf-switch-track .laf-switch-thumb {
    transform: translateX(26px);
}

/* Klavye odağı halkası (opaklık yok, tam belirgin) */
.laf-switch input:focus-visible + .laf-switch-track {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--laf-switch-color, var(--mud-palette-primary, #594ae2)) 25%, transparent);
}

/* Small boyut */
.laf-switch--small .laf-switch-track {
    width: 32px;
}

.laf-switch--small .laf-switch-thumb {
    top: -2.5px;
    width: 14px;
    height: 14px;
}

.laf-switch--small input:checked + .laf-switch-track .laf-switch-thumb {
    transform: translateX(22px);
}

/* Devre dışı */
.laf-switch--disabled {
    cursor: default;
    opacity: .5;
}

.laf-switch-label {
    font-size: .875rem;
    color: var(--mud-palette-text-primary, inherit);
}
