/* Custom Toggle Switch - Clear and Compact */

.custom-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.custom-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.custom-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--danger); /* Red for OFF */
    border-radius: 22px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    font-size: 9px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.custom-toggle-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.custom-toggle-slider::after {
    content: "OFF";
    position: absolute;
    right: 6px;
    font-size: 8px;
    letter-spacing: 0.5px;
}

input:checked + .custom-toggle-slider {
    background-color: var(--success); /* Green for ON */
}

input:checked + .custom-toggle-slider::before {
    transform: translateX(22px);
}

input:checked + .custom-toggle-slider::after {
    content: "ON";
    left: 6px;
    right: auto;
}

input:focus + .custom-toggle-slider {
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

input:disabled + .custom-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Label styling */
.custom-toggle-label {
    cursor: pointer;
    user-select: none;
    color: var(--text-primary);
}

.custom-toggle input:disabled ~ .custom-toggle-label {
    opacity: 0.5;
    cursor: not-allowed;
}
